@grackle-ai/cli 0.70.0 → 0.70.2

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.
Files changed (2) hide show
  1. package/README.md +593 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,5 +1,596 @@
1
1
  # @grackle-ai/cli
2
2
 
3
- Command-line interface for managing Grackle environments and agents.
3
+ Command-line interface for [Grackle](https://github.com/nick-pape/grackle) — run any AI coding agent on any remote environment. Manage environments, workspaces, tasks, agent sessions, personas, and more from your terminal.
4
4
 
5
- See the [main repository](https://github.com/nick-pape/grackle) for full documentation.
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @grackle-ai/cli
9
+ ```
10
+
11
+ Or run without installing:
12
+
13
+ ```bash
14
+ npx @grackle-ai/cli serve
15
+ ```
16
+
17
+ Requires **Node.js >= 22**.
18
+
19
+ > **pnpm users:** pnpm v8+ blocks native build scripts by default. If `grackle serve` crashes with a `Could not locate the bindings file` error, run `pnpm approve-builds` after installing, or add the following to your `package.json`:
20
+ >
21
+ > ```json
22
+ > { "pnpm": { "onlyBuiltDependencies": ["better-sqlite3"] } }
23
+ > ```
24
+
25
+ ## Quick Start
26
+
27
+ ```bash
28
+ # Start the Grackle server (gRPC + Web UI + MCP — all in one)
29
+ grackle serve
30
+
31
+ # Open the web dashboard at http://localhost:3000
32
+
33
+ # Add a Docker environment
34
+ grackle env add my-env --docker
35
+
36
+ # Spawn an agent session
37
+ grackle spawn my-env "Refactor the auth module to use JWT"
38
+
39
+ # Watch it work
40
+ grackle status
41
+ ```
42
+
43
+ ## Configuration
44
+
45
+ The CLI connects to a running Grackle server over gRPC. Connection is configured via environment variables:
46
+
47
+ | Variable | Description | Default |
48
+ |----------|-------------|---------|
49
+ | `GRACKLE_URL` | Server gRPC address | `http://127.0.0.1:7434` |
50
+ | `GRACKLE_API_KEY` | API key for authentication | Read from `${GRACKLE_HOME:-~}/.grackle/api-key` |
51
+ | `GRACKLE_HOME` | Override the Grackle home directory | `~` |
52
+
53
+ The API key is generated automatically when the server starts for the first time. If `GRACKLE_API_KEY` is not set, the CLI reads the key from `${GRACKLE_HOME:-~}/.grackle/api-key`.
54
+
55
+ ## Command Reference
56
+
57
+ ### Server
58
+
59
+ #### `grackle serve`
60
+
61
+ Start the Grackle server, web UI, MCP server, and local PowerLine.
62
+
63
+ ```bash
64
+ grackle serve
65
+ grackle serve --port 8000 --web-port 4000
66
+ grackle serve --allow-network # bind to 0.0.0.0 for LAN access
67
+ ```
68
+
69
+ | Option | Description | Default |
70
+ |--------|-------------|---------|
71
+ | `--port <port>` | Server gRPC port | `7434` |
72
+ | `--web-port <port>` | Web UI port | `3000` |
73
+ | `--mcp-port <port>` | MCP server port | `7435` |
74
+ | `--powerline-port <port>` | Local PowerLine port | `7433` |
75
+ | `--allow-network` | Bind to all interfaces (0.0.0.0) | Off (127.0.0.1) |
76
+
77
+ ---
78
+
79
+ ### Environments
80
+
81
+ Manage the compute environments where agents run.
82
+
83
+ #### `grackle env list`
84
+
85
+ List all registered environments with their status and adapter type.
86
+
87
+ ```bash
88
+ grackle env list
89
+ ```
90
+
91
+ #### `grackle env add <name>`
92
+
93
+ Register a new environment. Choose an adapter type with one of the mutually exclusive flags.
94
+
95
+ ```bash
96
+ # Docker (default)
97
+ grackle env add my-env --docker
98
+ grackle env add my-env --docker --image node:22 --repo https://github.com/org/repo
99
+ grackle env add my-env --docker --volume /host/path:/container/path --gpu
100
+
101
+ # SSH
102
+ grackle env add staging --ssh --host 10.0.1.50 --user deploy
103
+ grackle env add staging --ssh --host 10.0.1.50 --ssh-port 2222 --identity-file ~/.ssh/id_ed25519
104
+
105
+ # GitHub Codespace
106
+ grackle env add cs --codespace --codespace-name my-codespace-abc123
107
+
108
+ # Local (connect to an existing PowerLine instance)
109
+ grackle env add local --local --host 127.0.0.1 --port 7433
110
+ ```
111
+
112
+ | Option | Description |
113
+ |--------|-------------|
114
+ | `--docker` | Docker adapter (default) |
115
+ | `--ssh` | SSH adapter |
116
+ | `--codespace` | GitHub Codespace adapter |
117
+ | `--local` | Local PowerLine adapter |
118
+ | `--repo <repo>` | GitHub repo to clone (Docker) |
119
+ | `--image <image>` | Docker image |
120
+ | `--volume <mounts...>` | Docker volume mounts (`host:container[:ro]`) |
121
+ | `--gpu [gpus]` | Enable GPU passthrough (default: all) |
122
+ | `--host <host>` | SSH host or local host |
123
+ | `--user <user>` | SSH user |
124
+ | `--ssh-port <port>` | SSH port (default: 22) |
125
+ | `--identity-file <path>` | SSH private key path |
126
+ | `--codespace-name <name>` | Codespace name (from `gh codespace list`) |
127
+ | `--port <port>` | PowerLine port (local adapter) |
128
+
129
+ #### `grackle env provision <id>`
130
+
131
+ Provision and connect an environment. Streams progress events.
132
+
133
+ ```bash
134
+ grackle env provision my-env
135
+ # [10%] pulling: Pulling Docker image...
136
+ # [50%] starting: Starting container...
137
+ # [100%] connected: Environment ready
138
+ ```
139
+
140
+ #### `grackle env stop <id>`
141
+
142
+ Stop a running environment without destroying it.
143
+
144
+ #### `grackle env destroy <id>`
145
+
146
+ Destroy an environment (e.g., remove the Docker container).
147
+
148
+ #### `grackle env remove <id>`
149
+
150
+ Remove an environment from the registry entirely.
151
+
152
+ #### `grackle env wake <id>`
153
+
154
+ Wake a sleeping environment. Equivalent to re-provisioning.
155
+
156
+ ---
157
+
158
+ ### Agent Sessions
159
+
160
+ Spawn, monitor, and interact with AI agent sessions.
161
+
162
+ #### `grackle spawn <env-id> <prompt>`
163
+
164
+ Start a new agent session with the given prompt. Automatically attaches to the live event stream.
165
+
166
+ ```bash
167
+ grackle spawn my-env "Add input validation to the signup form"
168
+ grackle spawn my-env "Fix the failing test" --max-turns 5
169
+ grackle spawn my-env "Review this PR" --persona code-reviewer
170
+ ```
171
+
172
+ | Option | Description |
173
+ |--------|-------------|
174
+ | `--max-turns <n>` | Maximum conversation turns |
175
+ | `--persona <id>` | Persona to use (falls back to app default) |
176
+
177
+ #### `grackle status`
178
+
179
+ List active agent sessions. Shows ID, environment, runtime, status, token usage, cost, and prompt.
180
+
181
+ ```bash
182
+ grackle status
183
+ grackle status --env my-env # filter by environment
184
+ grackle status --all # include completed sessions
185
+ ```
186
+
187
+ #### `grackle attach <session-id>`
188
+
189
+ Attach to a live session and stream events in real time. When the agent requests input, you'll be prompted interactively.
190
+
191
+ ```bash
192
+ grackle attach abc12345
193
+ ```
194
+
195
+ #### `grackle resume <session-id>`
196
+
197
+ Resume a paused or suspended session.
198
+
199
+ #### `grackle kill <session-id>`
200
+
201
+ Stop a running session immediately.
202
+
203
+ #### `grackle send-input <session-id> <text>`
204
+
205
+ Send text input to a session that is waiting for user input.
206
+
207
+ ```bash
208
+ grackle send-input abc12345 "Yes, proceed with the refactor"
209
+ ```
210
+
211
+ ---
212
+
213
+ ### Workspaces
214
+
215
+ Group tasks and agents around a shared repository and environment.
216
+
217
+ #### `grackle workspace list`
218
+
219
+ List all workspaces.
220
+
221
+ ```bash
222
+ grackle workspace list
223
+ grackle workspace list --env my-env # filter by environment
224
+ ```
225
+
226
+ #### `grackle workspace create <name>`
227
+
228
+ Create a new workspace attached to an environment.
229
+
230
+ ```bash
231
+ grackle workspace create "Auth Rewrite" --env my-env --repo https://github.com/org/repo
232
+ grackle workspace create "Quick Fix" --env my-env --no-worktrees
233
+ ```
234
+
235
+ | Option | Description |
236
+ |--------|-------------|
237
+ | `--env <env-id>` | Environment ID (required) |
238
+ | `--repo <url>` | Repository URL |
239
+ | `--desc <description>` | Workspace description |
240
+ | `--no-worktrees` | Disable git worktree isolation |
241
+ | `--worktree-base-path <path>` | Base path for worktrees on the environment |
242
+
243
+ #### `grackle workspace get <id>`
244
+
245
+ Show full details for a workspace.
246
+
247
+ #### `grackle workspace update <id>`
248
+
249
+ Update workspace properties.
250
+
251
+ ```bash
252
+ grackle workspace update ws-123 --name "Auth Rewrite v2" --desc "Updated scope"
253
+ grackle workspace update ws-123 --env other-env # reparent to different environment
254
+ ```
255
+
256
+ | Option | Description |
257
+ |--------|-------------|
258
+ | `--name <name>` | New name |
259
+ | `--desc <description>` | New description |
260
+ | `--repo <url>` | New repository URL |
261
+ | `--env <env-id>` | Reparent to a different environment |
262
+ | `--worktrees` / `--no-worktrees` | Toggle worktree isolation |
263
+ | `--worktree-base-path <path>` | New worktree base path |
264
+
265
+ #### `grackle workspace archive <id>`
266
+
267
+ Archive a workspace.
268
+
269
+ ---
270
+
271
+ ### Tasks
272
+
273
+ Create, manage, and execute tasks within workspaces. Tasks support hierarchical parent/child trees, dependency gating, and agent assignment.
274
+
275
+ #### `grackle task list [workspace-id]`
276
+
277
+ List tasks, optionally scoped to a workspace.
278
+
279
+ ```bash
280
+ grackle task list
281
+ grackle task list ws-123 --status working
282
+ grackle task list ws-123 --search "auth"
283
+ ```
284
+
285
+ | Option | Description |
286
+ |--------|-------------|
287
+ | `--search <query>` | Filter by title/description substring |
288
+ | `--status <status>` | Filter by status: `not_started`, `working`, `paused`, `complete`, `failed` |
289
+
290
+ #### `grackle task create <title>`
291
+
292
+ Create a new task.
293
+
294
+ ```bash
295
+ grackle task create "Implement JWT middleware" --workspace ws-123
296
+ grackle task create "Write tests" --workspace ws-123 --depends-on task-1,task-2
297
+ grackle task create "Fix edge case" --parent task-1 # create a subtask
298
+ grackle task create "Design API" --workspace ws-123 --can-decompose
299
+ ```
300
+
301
+ | Option | Description |
302
+ |--------|-------------|
303
+ | `--workspace <id>` | Workspace to create the task in |
304
+ | `--desc <text>` | Task description |
305
+ | `--depends-on <ids>` | Comma-separated dependency task IDs |
306
+ | `--parent <task-id>` | Parent task ID (creates a subtask) |
307
+ | `--can-decompose` | Allow this task to create subtasks |
308
+
309
+ #### `grackle task show <task-id>`
310
+
311
+ Show full task details including status, branch, dependencies, and token usage.
312
+
313
+ #### `grackle task update <task-id>`
314
+
315
+ Update task properties.
316
+
317
+ | Option | Description |
318
+ |--------|-------------|
319
+ | `--title <text>` | New title |
320
+ | `--desc <text>` | New description |
321
+ | `--status <status>` | `not_started`, `working`, `paused`, `complete`, `failed` |
322
+ | `--depends-on <ids>` | New dependency list |
323
+ | `--session <session-id>` | Bind an existing session |
324
+ | `--persona <id>` | Default persona ID |
325
+
326
+ #### `grackle task start <task-id>`
327
+
328
+ Start a task by spawning an agent session for it.
329
+
330
+ ```bash
331
+ grackle task start task-1
332
+ grackle task start task-1 --persona security-reviewer --env my-env
333
+ grackle task start task-1 --notes "Focus on error handling this time"
334
+ ```
335
+
336
+ | Option | Description |
337
+ |--------|-------------|
338
+ | `--persona <id-or-name>` | Persona override |
339
+ | `--env <env-id>` | Environment to run on |
340
+ | `--notes <text>` | Feedback/instructions for retry |
341
+
342
+ #### `grackle task complete <task-id>`
343
+
344
+ Mark a task as complete.
345
+
346
+ #### `grackle task resume <task-id>`
347
+
348
+ Resume the latest interrupted or completed session for a task.
349
+
350
+ #### `grackle task delete <task-id>`
351
+
352
+ Delete a task.
353
+
354
+ #### `grackle task import-github <workspace-id>`
355
+
356
+ Bulk import GitHub issues as tasks.
357
+
358
+ ```bash
359
+ grackle task import-github ws-123 --repo nick-pape/grackle
360
+ grackle task import-github ws-123 --repo nick-pape/grackle --label "good first issue"
361
+ grackle task import-github ws-123 --repo nick-pape/grackle --state closed --no-include-comments
362
+ ```
363
+
364
+ | Option | Description |
365
+ |--------|-------------|
366
+ | `--repo <owner/repo>` | GitHub repository (required) |
367
+ | `--label <label>` | Filter issues by label |
368
+ | `--state <state>` | Issue state: `open` (default) or `closed` |
369
+ | `--env <env-id>` | Environment ID to assign to created tasks |
370
+ | `--no-include-comments` | Exclude issue comments from descriptions |
371
+
372
+ ---
373
+
374
+ ### Personas
375
+
376
+ Create and manage agent personas — specialized profiles with custom system prompts, runtime preferences, and model configuration.
377
+
378
+ #### `grackle persona list`
379
+
380
+ List all personas.
381
+
382
+ #### `grackle persona create <name>`
383
+
384
+ Create a new persona.
385
+
386
+ ```bash
387
+ # Agent persona with a system prompt
388
+ grackle persona create "Frontend Engineer" --prompt "You are a React specialist." --runtime claude-code
389
+
390
+ # Read the prompt from a file
391
+ grackle persona create "Security Reviewer" --prompt-file ./prompts/security.md --model opus
392
+
393
+ # Script persona (GenAIScript)
394
+ grackle persona create "Nightly Report" --type script --script-file ./scripts/report.genai.mjs --runtime genaiscript
395
+ ```
396
+
397
+ | Option | Description |
398
+ |--------|-------------|
399
+ | `--type <type>` | `agent` (default) or `script` |
400
+ | `--prompt <text>` | System prompt text |
401
+ | `--prompt-file <path>` | Read system prompt from a file |
402
+ | `--script <code>` | Script source code (for script personas) |
403
+ | `--script-file <path>` | Read script from a file |
404
+ | `--desc <text>` | Description |
405
+ | `--runtime <runtime>` | `claude-code`, `copilot`, `codex`, `goose`, or `genaiscript` |
406
+ | `--model <model>` | Default model |
407
+ | `--max-turns <n>` | Maximum turns |
408
+
409
+ #### `grackle persona show <id>`
410
+
411
+ Show full persona details including system prompt or script.
412
+
413
+ #### `grackle persona edit <id>`
414
+
415
+ Edit an existing persona. Accepts the same options as `create`.
416
+
417
+ #### `grackle persona delete <id>`
418
+
419
+ Delete a persona.
420
+
421
+ ---
422
+
423
+ ### Findings
424
+
425
+ Query and post findings — categorized discoveries shared across agents within a workspace.
426
+
427
+ #### `grackle finding list <workspace-id>`
428
+
429
+ List findings in a workspace.
430
+
431
+ ```bash
432
+ grackle finding list ws-123
433
+ grackle finding list ws-123 --category architecture --tag security --limit 10
434
+ ```
435
+
436
+ | Option | Description |
437
+ |--------|-------------|
438
+ | `--category <cat>` | Filter by category |
439
+ | `--tag <tag>` | Filter by tag |
440
+ | `--limit <n>` | Max results (default: 20) |
441
+
442
+ #### `grackle finding post <workspace-id> <title>`
443
+
444
+ Post a new finding.
445
+
446
+ ```bash
447
+ grackle finding post ws-123 "Auth tokens expire silently" --category bug --content "The refresh token..." --tags auth,security
448
+ ```
449
+
450
+ | Option | Description |
451
+ |--------|-------------|
452
+ | `--category <cat>` | Finding category (default: `general`) |
453
+ | `--content <text>` | Finding content |
454
+ | `--tags <tags>` | Comma-separated tags |
455
+
456
+ ---
457
+
458
+ ### Tokens
459
+
460
+ Manage authentication tokens that are forwarded to environments (API keys, access tokens, etc.).
461
+
462
+ #### `grackle token list`
463
+
464
+ List all configured tokens.
465
+
466
+ #### `grackle token set <name>`
467
+
468
+ Set a token value. The value can come from a file, an environment variable, or interactive input.
469
+
470
+ ```bash
471
+ # Interactive prompt
472
+ grackle token set anthropic
473
+
474
+ # From environment variable
475
+ grackle token set anthropic --env ANTHROPIC_API_KEY
476
+
477
+ # From file
478
+ grackle token set anthropic --file ~/.secrets/anthropic.key
479
+
480
+ # Control how the token is delivered to the environment
481
+ grackle token set github --env GITHUB_TOKEN --type env_var --env-var GITHUB_TOKEN
482
+ grackle token set ssh-key --file ~/.ssh/id_rsa --type file --file-path /home/agent/.ssh/id_rsa
483
+ ```
484
+
485
+ | Option | Description |
486
+ |--------|-------------|
487
+ | `--file <path>` | Read value from a file |
488
+ | `--env <var>` | Read value from an environment variable |
489
+ | `--type <type>` | Delivery type: `env_var` (default) or `file` |
490
+ | `--env-var <name>` | Environment variable name on the remote environment |
491
+ | `--file-path <path>` | File path to write on the remote environment |
492
+
493
+ #### `grackle token delete <name>`
494
+
495
+ Delete a token.
496
+
497
+ ---
498
+
499
+ ### Credential Providers
500
+
501
+ Configure automatic credential forwarding from your machine to environments.
502
+
503
+ #### `grackle credential-provider list`
504
+
505
+ Show current credential provider configuration.
506
+
507
+ ```bash
508
+ grackle credential-provider list
509
+ # ┌──────────┬──────────────┐
510
+ # │ Provider │ Status │
511
+ # ├──────────┼──────────────┤
512
+ # │ claude │ subscription │
513
+ # │ github │ on │
514
+ # │ copilot │ off │
515
+ # │ codex │ off │
516
+ # │ goose │ off │
517
+ # └──────────┴──────────────┘
518
+ ```
519
+
520
+ #### `grackle credential-provider set <provider> <value>`
521
+
522
+ Set a credential provider mode.
523
+
524
+ ```bash
525
+ grackle credential-provider set claude subscription
526
+ grackle credential-provider set github on
527
+ grackle credential-provider set copilot off
528
+ ```
529
+
530
+ | Provider | Valid values |
531
+ |----------|-------------|
532
+ | `claude` | `off`, `subscription`, `api_key` |
533
+ | `github` | `off`, `on` |
534
+ | `copilot` | `off`, `on` |
535
+ | `codex` | `off`, `on` |
536
+ | `goose` | `off`, `on` |
537
+
538
+ ---
539
+
540
+ ### Logs
541
+
542
+ View session event logs and transcripts.
543
+
544
+ #### `grackle logs <session-id>`
545
+
546
+ View the event log for a session. Supports short ID prefix matching.
547
+
548
+ ```bash
549
+ grackle logs abc12345 # view JSONL event log
550
+ grackle logs abc12345 --transcript # view markdown transcript
551
+ grackle logs abc12345 --tail # stream live events
552
+ ```
553
+
554
+ | Option | Description |
555
+ |--------|-------------|
556
+ | `--transcript` | Show the markdown transcript instead of raw events |
557
+ | `--tail` | Follow live events (like `tail -f`) |
558
+
559
+ ---
560
+
561
+ ### Pairing
562
+
563
+ #### `grackle pair`
564
+
565
+ Generate a new pairing code for the web UI. Displays the code, a URL, and a QR code for mobile access. Codes expire after 5 minutes.
566
+
567
+ ```bash
568
+ grackle pair
569
+ # Pairing code: AB12CD
570
+ # URL: http://localhost:3000/pair?code=AB12CD
571
+ # [QR code]
572
+ ```
573
+
574
+ ---
575
+
576
+ ### Settings
577
+
578
+ #### `grackle config get <key>`
579
+
580
+ Get an app-level setting value.
581
+
582
+ ```bash
583
+ grackle config get default-persona
584
+ ```
585
+
586
+ #### `grackle config set <key> <value>`
587
+
588
+ Set an app-level setting value.
589
+
590
+ ```bash
591
+ grackle config set default-persona persona-abc123
592
+ ```
593
+
594
+ ## License
595
+
596
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grackle-ai/cli",
3
- "version": "0.70.0",
3
+ "version": "0.70.2",
4
4
  "description": "Command-line interface for managing Grackle environments and agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,8 +34,8 @@
34
34
  "commander": "^13.0.0",
35
35
  "ora": "^8.0.0",
36
36
  "qrcode": "^1.5.4",
37
- "@grackle-ai/common": "0.70.0",
38
- "@grackle-ai/server": "0.70.0"
37
+ "@grackle-ai/server": "0.70.2",
38
+ "@grackle-ai/common": "0.70.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@rushstack/heft": "1.2.7",