@every-env/spiral-cli 0.2.0 → 1.0.0
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 +35 -6
- package/package.json +5 -14
- package/src/api.ts +82 -474
- package/src/auth.ts +49 -214
- package/src/cli.ts +264 -948
- package/src/config.ts +29 -45
- package/src/output.ts +162 -0
- package/src/types.ts +87 -117
- package/src/attachments/index.ts +0 -174
- package/src/drafts/editor.ts +0 -105
- package/src/drafts/index.ts +0 -208
- package/src/notes/index.ts +0 -130
- package/src/styles/index.ts +0 -45
- package/src/suggestions/diff.ts +0 -33
- package/src/suggestions/index.ts +0 -205
- package/src/suggestions/parser.ts +0 -83
- package/src/tools/renderer.ts +0 -104
- package/src/workspaces/index.ts +0 -55
package/README.md
CHANGED
|
@@ -219,17 +219,46 @@ spiral-cli stores local configuration in `~/.config/spiral-cli/`:
|
|
|
219
219
|
|
|
220
220
|
## Authentication
|
|
221
221
|
|
|
222
|
-
|
|
222
|
+
### API Key Authentication (Recommended)
|
|
223
223
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
The recommended way to authenticate is with an API key:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Login with your API key
|
|
228
|
+
spiral auth login
|
|
229
|
+
# Enter your API key when prompted
|
|
230
|
+
|
|
231
|
+
# Check authentication status
|
|
232
|
+
spiral auth status
|
|
233
|
+
|
|
234
|
+
# Logout
|
|
235
|
+
spiral auth logout
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Get your API key:**
|
|
239
|
+
1. Go to https://app.writewithspiral.com
|
|
240
|
+
2. Click your profile → **Account** → **API Keys**
|
|
241
|
+
3. Create a new key and copy it
|
|
227
242
|
|
|
228
|
-
###
|
|
243
|
+
### Environment Variable (CI/CD)
|
|
244
|
+
|
|
245
|
+
For scripts and CI/CD pipelines, use the `SPIRAL_TOKEN` environment variable:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
export SPIRAL_TOKEN=spiral_sk_your_key_here
|
|
249
|
+
spiral send "Generate a summary" --json
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Browser Cookie Fallback
|
|
253
|
+
|
|
254
|
+
If no API key is configured, spiral-cli can extract your session from browser cookies (Safari/Chrome/Firefox). This requires:
|
|
255
|
+
- Being logged into https://app.writewithspiral.com
|
|
256
|
+
- Terminal needs Full Disk Access (macOS Sonoma+)
|
|
229
257
|
|
|
258
|
+
To grant Full Disk Access:
|
|
230
259
|
1. Open **System Preferences** > **Privacy & Security**
|
|
231
260
|
2. Click **Full Disk Access**
|
|
232
|
-
3. Add your terminal app
|
|
261
|
+
3. Add your terminal app
|
|
233
262
|
|
|
234
263
|
## Security Notes
|
|
235
264
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@every-env/spiral-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "CLI for Spiral API - create content from your terminal",
|
|
5
5
|
"author": "Kieran Klaassen",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,29 +32,22 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"dev": "bun run src/cli.ts",
|
|
34
34
|
"build": "bun build src/cli.ts --compile --minify --outfile dist/spiral",
|
|
35
|
-
"build:all": "bun run build:darwin-arm64 && bun run build:darwin-x64",
|
|
35
|
+
"build:all": "bun run build:linux-x64 && bun run build:darwin-arm64 && bun run build:darwin-x64",
|
|
36
36
|
"build:darwin-arm64": "bun build src/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile dist/spiral-darwin-arm64",
|
|
37
37
|
"build:darwin-x64": "bun build src/cli.ts --compile --minify --target=bun-darwin-x64 --outfile dist/spiral-darwin-x64",
|
|
38
|
+
"build:linux-x64": "bun build src/cli.ts --compile --minify --target=bun-linux-x64 --outfile dist/spiral-linux-x64",
|
|
38
39
|
"test": "bun test",
|
|
39
|
-
"
|
|
40
|
-
"lint": "biome check src",
|
|
41
|
-
"lint:fix": "biome check --write src",
|
|
42
|
-
"format": "biome format --write src",
|
|
43
|
-
"typecheck": "tsc --noEmit",
|
|
44
|
-
"prepublishOnly": "bun run typecheck"
|
|
40
|
+
"typecheck": "tsc --noEmit"
|
|
45
41
|
},
|
|
46
42
|
"dependencies": {
|
|
47
43
|
"@inquirer/prompts": "^8.1.0",
|
|
48
|
-
"@steipete/sweet-cookie": "^0.1.0",
|
|
49
44
|
"chalk": "^5.3.0",
|
|
50
45
|
"conf": "^15.0.2",
|
|
51
|
-
"eventsource-parser": "^3.0.0",
|
|
52
46
|
"marked": "^15.0.0",
|
|
53
47
|
"marked-terminal": "^7.0.0",
|
|
54
48
|
"ora": "^8.0.0"
|
|
55
49
|
},
|
|
56
50
|
"devDependencies": {
|
|
57
|
-
"@biomejs/biome": "^1.9.0",
|
|
58
51
|
"@types/bun": "latest",
|
|
59
52
|
"typescript": "^5.6.0"
|
|
60
53
|
},
|
|
@@ -63,7 +56,5 @@
|
|
|
63
56
|
},
|
|
64
57
|
"engines": {
|
|
65
58
|
"bun": ">=1.1.0"
|
|
66
|
-
}
|
|
67
|
-
"os": ["darwin"],
|
|
68
|
-
"cpu": ["arm64", "x64"]
|
|
59
|
+
}
|
|
69
60
|
}
|