@every-env/spiral-cli 0.1.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 CHANGED
@@ -6,15 +6,31 @@ A command-line interface for interacting with the Spiral API from your terminal.
6
6
 
7
7
  ### Prerequisites
8
8
 
9
- - macOS (Safari cookie extraction)
9
+ - macOS (Safari/Chrome/Firefox cookie extraction)
10
10
  - [Bun](https://bun.sh/) >= 1.1.0
11
11
  - Full Disk Access for terminal (macOS Sonoma+)
12
12
 
13
+ ### Install from npm (recommended)
14
+
15
+ ```bash
16
+ # Install globally
17
+ bun add -g @every-env/spiral-cli
18
+
19
+ # Or run directly without installing
20
+ bunx @every-env/spiral-cli chat "Write a tweet about AI"
21
+ ```
22
+
23
+ After installation, the `spiral` command is available globally:
24
+
25
+ ```bash
26
+ spiral chat "Your prompt here"
27
+ ```
28
+
13
29
  ### Install from source
14
30
 
15
31
  ```bash
16
- git clone <repo>
17
- cd spiral-cli
32
+ git clone https://github.com/EveryInc/spiral-next.git
33
+ cd spiral-next/spiral-cli
18
34
  bun install
19
35
  ```
20
36
 
@@ -203,17 +219,46 @@ spiral-cli stores local configuration in `~/.config/spiral-cli/`:
203
219
 
204
220
  ## Authentication
205
221
 
206
- spiral-cli automatically extracts your session from Safari cookies. No manual token management needed.
222
+ ### API Key Authentication (Recommended)
207
223
 
208
- **Requirements:**
209
- - Safari must be logged into https://app.writewithspiral.com
210
- - Terminal needs Full Disk Access (macOS Sonoma+)
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
211
230
 
212
- ### Granting Full Disk Access
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
242
+
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+)
213
257
 
258
+ To grant Full Disk Access:
214
259
  1. Open **System Preferences** > **Privacy & Security**
215
260
  2. Click **Full Disk Access**
216
- 3. Add your terminal app (Terminal.app, iTerm2, etc.)
261
+ 3. Add your terminal app
217
262
 
218
263
  ## Security Notes
219
264
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@every-env/spiral-cli",
3
- "version": "0.1.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
- "test:watch": "bun test --watch",
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
  }