@tryarcanist/cli 0.1.379 → 0.1.381

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 (3) hide show
  1. package/README.md +14 -114
  2. package/dist/index.js +651 -1778
  3. package/package.json +4 -5
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Arcanist CLI
2
2
 
3
- Command-line interface for [Arcanist](https://www.tryarcanist.com): follow session output and manage access tokens from your terminal or automation.
3
+ Command-line interface for [Arcanist](https://www.tryarcanist.com): follow session output and manage environments from your terminal or automation.
4
4
 
5
5
  ## Install
6
6
 
@@ -13,34 +13,27 @@ Requires Node.js 22 or newer.
13
13
  ## Quick start
14
14
 
15
15
  ```bash
16
- arcanist auth login # approve login in your browser
16
+ printf "arc_..." | arcanist auth login --token-stdin
17
17
  arcanist sessions list --json
18
18
  ```
19
19
 
20
20
  ```bash
21
- export ARCANIST_TOKEN=arc_... # write-scoped for prepare, review, and stop
21
+ export ARCANIST_TOKEN=arc_... # write-scoped for prepare, review, and sandbox build
22
22
  SESSION_ID=$(arcanist sessions list --json | jq -r '.sessions[0].id')
23
23
  arcanist sessions events "$SESSION_ID" --follow --json
24
24
  ```
25
25
 
26
26
  ## Authentication
27
27
 
28
- Start browser authorization from the CLI:
28
+ Mint a token in **Settings > CLI**, then pipe it to the CLI:
29
29
 
30
30
  ```bash
31
- arcanist auth login
32
- # approve the request in the browser
31
+ printf "arc_..." | arcanist auth login --token-stdin
33
32
  ```
34
33
 
35
- Token config is stored at `~/.arcanist/config.json`. Existing automation can still provide a token through `ARCANIST_TOKEN` or `--token-stdin`. Multiple active tokens per user are supported; revoke tokens independently when a device or workflow no longer needs access.
36
-
37
- Use a read-scoped token for inspection and debugging; use a write-scoped token to prepare or retry environments, trigger a Zeus review, stop a session, or manage tokens.
38
-
39
- You can also pipe the token via stdin:
34
+ Token config is stored at `~/.arcanist/config.json`. Existing automation can provide a token through `ARCANIST_TOKEN` or `--token`. Multiple active tokens per user are supported; revoke tokens independently when a device or workflow no longer needs access.
40
35
 
41
- ```bash
42
- printf "arc_..." | arcanist auth login --token-stdin
43
- ```
36
+ Use a read-scoped token for inspection and debugging; use a write-scoped token to prepare or retry environments, trigger an Arcanist review, or build a sandbox layer.
44
37
 
45
38
  Auth and API URL precedence:
46
39
 
@@ -115,20 +108,20 @@ Exit codes:
115
108
  130 interrupted
116
109
  ```
117
110
 
118
- `tokens create` and `sandbox build` send an `Idempotency-Key` header. The CLI does not auto-retry those endpoints; retry explicitly with the same `--idempotency-key` when a request may have already reached the server. Both use auto-random keys by default, so only an explicit key makes cross-invocation retries safe.
111
+ `sandbox build` sends an `Idempotency-Key` header. The CLI does not auto-retry that endpoint; retry explicitly with the same `--idempotency-key` when a request may have already reached the server. It uses auto-random keys by default, so only an explicit key makes cross-invocation retries safe.
119
112
 
120
113
  ## Commands
121
114
 
122
115
  ### `arcanist environments prepare`
123
116
 
124
- Prepare the current repository for Zeus. Pass `owner/repo` outside a checkout. A write-scoped token is required.
117
+ Prepare the current repository for Arcanist. Pass `owner/repo` outside a checkout. A write-scoped token is required.
125
118
 
126
119
  ```bash
127
120
  arcanist environments prepare --wait --json
128
121
  arcanist environments prepare owner/repo --wait --poll-interval 5000 --json
129
122
  ```
130
123
 
131
- Agents should follow `repository.nextAction` and `repository.command`. Request a Zeus review only when `nextAction` is `review`. When `command` is `null`, do not invent an API call; surface `question` / `secretRequest` to a human. `--wait` waits through internal handoffs until setup is ready or there is a real action for the user or Arcanist.
124
+ Agents should follow `repository.nextAction` and `repository.command`. Request an Arcanist review only when `nextAction` is `review`. When `command` is `null`, do not invent an API call; surface `question` / `secretRequest` to a human. `--wait` waits through internal handoffs until setup is ready or there is a real action for the user or Arcanist.
132
125
 
133
126
  ### `arcanist environments status`
134
127
 
@@ -139,7 +132,7 @@ arcanist environments status owner/repo --json
139
132
  arcanist environments status owner/repo --wait --poll-interval 5000 --json
140
133
  ```
141
134
 
142
- Agents should follow `repository.nextAction` and `repository.command`. Request a Zeus review only when `nextAction` is `review`. When `command` is `null`, do not invent an API call; surface `question` / `secretRequest` to a human. `--wait` waits through internal handoffs until setup is ready or there is a real action for the user or Arcanist.
135
+ Agents should follow `repository.nextAction` and `repository.command`. Request an Arcanist review only when `nextAction` is `review`. When `command` is `null`, do not invent an API call; surface `question` / `secretRequest` to a human. `--wait` waits through internal handoffs until setup is ready or there is a real action for the user or Arcanist.
143
136
 
144
137
  ### `arcanist environments retry`
145
138
 
@@ -152,7 +145,7 @@ arcanist environments retry owner/repo --wait --poll-interval 5000 --json
152
145
 
153
146
  ### `arcanist environments login`
154
147
 
155
- Log into your app once in a throwaway local browser and save that login on the environment so Zeus sessions start signed in. Alias: `arcanist env login`. A write-scoped token is required. Pass an environment id or `owner/repo` outside a checkout; the environment must have an app runtime configured.
148
+ Log into your app once in a throwaway local browser and save that login on the environment so Arcanist sessions start signed in. Alias: `arcanist env login`. A write-scoped token is required. Pass an environment id or `owner/repo` outside a checkout; the environment must have an app runtime configured.
156
149
 
157
150
  ```bash
158
151
  arcanist environments login owner/repo
@@ -172,28 +165,15 @@ What gets captured is the Playwright storage state for that window: cookies and
172
165
 
173
166
  The capture needs an interactive terminal: stdin and stderr must be a TTY. Instructions and prompts go to stderr, so `--json --yes --validate-path /dashboard > result.json` works. JSON output is `{environmentId, version, counts: {cookieDomainCount, storageOriginCount}, providerHosts, networkPolicy: {added, rejected, skipped}, validatePath}`, or `{environmentId, deleted}` with `--clear`. `arcanist environments status --json` reports the saved login under `browserState`, including whether a re-login is needed.
174
167
 
175
- ### `arcanist setup`
176
-
177
- Connect Arcanist and prepare one or more repository environments. The command starts browser authentication when needed, lists only repositories where GitHub reports write access, and queues at most 20 builds.
178
-
179
- ```bash
180
- arcanist setup
181
- arcanist setup acme/web
182
- arcanist setup acme/web acme/api --json
183
- arcanist setup acme/web acme/api --workspace
184
- ```
185
-
186
- With no repository arguments, the command returns the eligible repositories and `selection_required`. Rerun with the repositories to prepare. `--workspace` prepares them as one multi-repository workspace. Builds continue after the command exits. The command prints an `arcanist environments status owner/repo --wait` command for each build so agents can track progress or leave it running.
187
-
188
168
  ### `arcanist auth login`
189
169
 
190
170
  ```bash
191
- arcanist auth login
192
171
  printf "arc_..." | arcanist auth login --token-stdin
172
+ arcanist auth login --token arc_...
193
173
  arcanist auth login --api-url https://api.tryarcanist.com
194
174
  ```
195
175
 
196
- The default flow prints a browser authorization URL and waits for human approval. `--json` writes the action immediately as JSONL on stderr and writes one final result to stdout. `ARCANIST_TOKEN` authenticates later commands through the same config loader as `~/.arcanist/config.json`. `arcanist auth login --token-stdin`, `--token`, or `ARCANIST_TOKEN` persists a token for later use.
176
+ Pass a token via `--token-stdin`, `--token`, or `ARCANIST_TOKEN`; the CLI verifies it against `/api/auth/whoami` and persists it for later use.
197
177
 
198
178
  ### `arcanist auth whoami`
199
179
 
@@ -236,25 +216,6 @@ arcanist codex status --json
236
216
  JSON mode returns `{eligible, credential: {isSet, lastValidationStatus?, lastValidationReasonCode?}}`; `eligible` is always
237
217
  `true` and remains for compatibility with older clients.
238
218
 
239
- ### `arcanist codex logout`
240
-
241
- Deactivates the selector and removes the stored Codex subscription auth for your user (write-scoped token).
242
-
243
- ```bash
244
- arcanist codex logout
245
- ```
246
-
247
- ### `arcanist sessions stop <session-id>`
248
-
249
- Stops the active run for a session. Idempotent: if no sandbox is active, the server returns `already_stopped`.
250
-
251
- ```bash
252
- arcanist sessions stop abc123
253
- arcanist sessions stop abc123 --json
254
- ```
255
-
256
- JSON mode returns `{sessionId, status}`. `status` is the server stop status or, on a 409 stop-block, the block reason; it is an open set. Known values include `stopping`, `stopped`, `already_stopped`, `not_stoppable`, and lifecycle phase names.
257
-
258
219
  ### `arcanist sessions get <session-id>`
259
220
 
260
221
  ```bash
@@ -291,7 +252,6 @@ arcanist sessions events abc123 --follow --json
291
252
  arcanist sessions events abc123 --follow --timeout 60000 --json
292
253
  ```
293
254
 
294
- `--after` and `--before` are aliases for `--after-sequence` and `--before-sequence`.
295
255
  `--timeout` bounds `--follow`; omit it or pass `0` for unbounded follow. Process exit is a terminal phase, not `session_idle`.
296
256
 
297
257
  JSON mode without `--follow` returns one JSON object from `/events/history`: `{events: [...], ...}`. Canonical events carry `phase`.
@@ -314,13 +274,6 @@ arcanist sessions transcript abc123 --last 20
314
274
 
315
275
  `--last <n>` renders only the last `n` stored transcript events after fetching the session export.
316
276
 
317
- ### `arcanist sessions usage <session-id>`
318
-
319
- ```bash
320
- arcanist sessions usage abc123
321
- arcanist sessions usage abc123 --json
322
- ```
323
-
324
277
  ### `arcanist sessions artifacts <session-id>`
325
278
 
326
279
  Lists the artifacts a session produced (screenshots, videos) as `artifactId`, `kind`, `label`, `filename`, `bytes`, `createdAt`.
@@ -355,59 +308,6 @@ arcanist repos list --json
355
308
 
356
309
  JSON mode returns `{repos, ssoOrgs}`.
357
310
 
358
- ### `arcanist repos branches [repo]`
359
-
360
- ```bash
361
- arcanist repos branches tryarcanist/arcanist
362
- arcanist repos branches https://github.com/tryarcanist/arcanist --json
363
- ```
364
-
365
- JSON mode returns `{branches}`.
366
-
367
- ### `arcanist models list`
368
-
369
- ```bash
370
- arcanist models list
371
- arcanist models list --json
372
- ```
373
-
374
- JSON mode returns `{models}`.
375
-
376
- ### `arcanist tokens list`
377
-
378
- ```bash
379
- arcanist tokens list
380
- arcanist tokens list --limit 10 --json
381
- arcanist tokens list --cursor <cursor> --json
382
- arcanist tokens list --all --json
383
- ```
384
-
385
- `--all` follows cursors until completion and returns `nextCursor: null` in JSON mode.
386
-
387
- ### `arcanist tokens create`
388
-
389
- Creates a CLI token and prints the plaintext token exactly once.
390
-
391
- ```bash
392
- arcanist tokens create --scope read
393
- arcanist tokens create --scope read --expires-in-days 30 --json
394
- arcanist tokens create --scope read --idempotency-key 1f0e6f1a-...
395
- ```
396
-
397
- JSON mode returns `{ok, token, id, scope}`.
398
- The plaintext token is shown only once.
399
- Use `--idempotency-key <uuid>` when manually retrying a token create whose first response may have been lost; duplicate keys return `duplicate_request` rather than replaying the raw token.
400
- Read-scoped tokens cannot create write-scoped tokens; the server enforces that and returns 403.
401
-
402
- ### `arcanist tokens revoke <id>`
403
-
404
- ```bash
405
- arcanist tokens revoke 42
406
- arcanist tokens revoke 42 --yes --json
407
- ```
408
-
409
- Under `--json`, `--yes` is required.
410
-
411
311
  ## Automation recipes
412
312
 
413
313
  Chain commands with `--json` and `jq`: