inflight-cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/lib/config.js +2 -2
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# inflight-cli
|
|
2
|
+
|
|
3
|
+
The official CLI for [Inflight](https://inflight.co) — create and share design versions from the terminal.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g inflight-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Login
|
|
14
|
+
|
|
15
|
+
Authenticate with your Inflight account:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
inflight login
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This opens a browser window to complete authentication. Your credentials are stored in `~/.inflight/config.json`.
|
|
22
|
+
|
|
23
|
+
### Create a version
|
|
24
|
+
|
|
25
|
+
Create a new draft version for the current project:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
inflight create
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
You'll be prompted for a title (defaults to your current git branch name) and a staging URL. Git context (branch, commit, diff) is automatically captured if you're in a git repo.
|
|
32
|
+
|
|
33
|
+
## Requirements
|
|
34
|
+
|
|
35
|
+
- Node.js 18+
|
|
36
|
+
- A free [Inflight](https://inflight.co) account
|
package/dist/lib/config.js
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from "path";
|
|
|
3
3
|
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
|
|
4
4
|
const CONFIG_DIR = join(homedir(), ".inflight");
|
|
5
5
|
const CONFIG_FILE = join(CONFIG_DIR, "config.json");
|
|
6
|
-
const DEFAULT_API_URL = process.env.INFLIGHT_API_URL ?? "https://api.inflight.co";
|
|
6
|
+
const DEFAULT_API_URL = process.env.INFLIGHT_API_URL ?? "https://api-staging.inflight.co";
|
|
7
7
|
export function readGlobalConfig() {
|
|
8
8
|
if (!existsSync(CONFIG_FILE))
|
|
9
9
|
return null;
|
|
@@ -18,5 +18,5 @@ export function readGlobalConfig() {
|
|
|
18
18
|
}
|
|
19
19
|
export function writeGlobalConfig(config) {
|
|
20
20
|
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
21
|
-
writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
21
|
+
writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), { mode: 0o600 });
|
|
22
22
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inflight-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Inflight CLI — create and share design versions from the terminal",
|
|
5
5
|
"bin": {
|
|
6
|
-
"inflight": "
|
|
6
|
+
"inflight": "dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"type": "module",
|