@tryarcanist/cli 0.1.380 → 0.1.382

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 +43 -101
  2. package/dist/index.js +3854 -2633
  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.
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.
38
35
 
39
- You can also pipe the token via stdin:
40
-
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
 
@@ -206,6 +186,8 @@ JSON mode prints the raw `/api/auth/whoami` API response. Fields currently inclu
206
186
 
207
187
  ### `arcanist codex login`
208
188
 
189
+ Local development only; deployed workspaces return 403.
190
+
209
191
  Authenticates a Codex/ChatGPT subscription and stores it for your Codex sessions, then activates it (turns on "use subscription auth for OpenAI sessions"). Runs the Codex CLI device-authorization login locally under a temporary `CODEX_HOME`, then uploads the resulting `auth.json` to Arcanist (encrypted, per user). The credential is never written to your default `~/.codex`. Requires a write-scoped token. If activation fails the credential is still saved; run `arcanist codex use on`.
210
192
 
211
193
  ```bash
@@ -217,6 +199,8 @@ arcanist codex login --codex-path /usr/local/bin/codex
217
199
 
218
200
  ### `arcanist codex use <on|off>`
219
201
 
202
+ `on` works in local development only; deployed workspaces return 403. `off` works everywhere.
203
+
220
204
  Turns using your saved Codex subscription auth for OpenAI sessions on or off, without changing the stored credential. `arcanist codex login` turns it on automatically; use this to toggle it later.
221
205
 
222
206
  ```bash
@@ -226,6 +210,8 @@ arcanist codex use off
226
210
 
227
211
  ### `arcanist codex status`
228
212
 
213
+ Deployed workspaces report subscription auth as unavailable; it works in local development only.
214
+
229
215
  Shows that Codex subscription auth is available and whether an `auth.json` is currently saved.
230
216
 
231
217
  ```bash
@@ -236,25 +222,6 @@ arcanist codex status --json
236
222
  JSON mode returns `{eligible, credential: {isSet, lastValidationStatus?, lastValidationReasonCode?}}`; `eligible` is always
237
223
  `true` and remains for compatibility with older clients.
238
224
 
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
225
  ### `arcanist sessions get <session-id>`
259
226
 
260
227
  ```bash
@@ -291,7 +258,6 @@ arcanist sessions events abc123 --follow --json
291
258
  arcanist sessions events abc123 --follow --timeout 60000 --json
292
259
  ```
293
260
 
294
- `--after` and `--before` are aliases for `--after-sequence` and `--before-sequence`.
295
261
  `--timeout` bounds `--follow`; omit it or pass `0` for unbounded follow. Process exit is a terminal phase, not `session_idle`.
296
262
 
297
263
  JSON mode without `--follow` returns one JSON object from `/events/history`: `{events: [...], ...}`. Canonical events carry `phase`.
@@ -314,13 +280,6 @@ arcanist sessions transcript abc123 --last 20
314
280
 
315
281
  `--last <n>` renders only the last `n` stored transcript events after fetching the session export.
316
282
 
317
- ### `arcanist sessions usage <session-id>`
318
-
319
- ```bash
320
- arcanist sessions usage abc123
321
- arcanist sessions usage abc123 --json
322
- ```
323
-
324
283
  ### `arcanist sessions artifacts <session-id>`
325
284
 
326
285
  Lists the artifacts a session produced (screenshots, videos) as `artifactId`, `kind`, `label`, `filename`, `bytes`, `createdAt`.
@@ -355,58 +314,41 @@ arcanist repos list --json
355
314
 
356
315
  JSON mode returns `{repos, ssoOrgs}`.
357
316
 
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}`.
317
+ ### `arcanist review [pr-url]`
366
318
 
367
- ### `arcanist models list`
319
+ Review your local commits before you open a pull request. Run it inside a checkout of a repository that Arcanist is installed on. A write-scoped token and a paid Arcanist plan or a pilot are required.
368
320
 
369
321
  ```bash
370
- arcanist models list
371
- arcanist models list --json
322
+ arcanist review
323
+ arcanist review --base origin/release --json
324
+ arcanist review --include config/.env.test
325
+ arcanist review --request <id>
326
+ arcanist review --no-wait --json
327
+ arcanist review --request <id> --no-wait --json
372
328
  ```
373
329
 
374
- JSON mode returns `{models}`.
330
+ What is uploaded: the committed changes on your branch that are not on the default branch of `origin`, plus their commit messages. Nothing is posted to GitHub.
375
331
 
376
- ### `arcanist tokens list`
332
+ What is left out:
377
333
 
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
- ```
334
+ - Uncommitted changes are not reviewed. Commit them first.
335
+ - Secret-looking files (dotenv files, keys, certificates) and git-ignored files are held back unless you name them with `--include`.
336
+ - Binary files are skipped.
384
337
 
385
- `--all` follows cursors until completion and returns `nextCursor: null` in JSON mode.
338
+ The upload limit is 3 MB. Each delivered review counts toward your plan's review usage; a review that fails does not.
386
339
 
387
- ### `arcanist tokens create`
340
+ - `--base <ref>` compares against this ref instead of the default branch.
341
+ - `--include <path>` uploads a held-back file or folder. Repeat it for more.
342
+ - `--request <id>` gets the result of a review that is already running or finished. Use it when the command was interrupted; the request id is always printed to stderr when the review starts, also with `--json` and `--quiet`.
343
+ - `--no-wait` starts a review, or checks one with `--request <id>`, and returns at once. It exits `5` while the review is still running.
344
+ - `--poll-interval <ms>` sets how often the CLI checks for the result (default `10000`).
345
+ - `--wait` applies only to a PR URL; a local review waits by default, up to 30 minutes, and prints `Still reviewing (Nm)` with the `--request` command every minute (stderr, not with `--json` or `--quiet`).
388
346
 
389
- Creates a CLI token and prints the plaintext token exactly once.
347
+ Held-back files are committed, so they ship with your branch; the CLI lists them as `Committed but not uploaded for review (pass --include <path> to upload)`.
390
348
 
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
- ```
349
+ Output is the headline (`Arcanist review: Hold off on merging.` when a finding blocks merge, else `Arcanist review: Ready to merge.`), the summary, then each finding as `file:line - title` followed by its full text. A blocking finding's title ends with `(blocks merge)`; a non-blocking finding has no tag. Nitpicks come last, under `Nitpicks (N)`. JSON mode returns `{status, requestId, sessionId, verdict, summary, findings}`, where each finding is `{file, line, blocksMerge, title, body}`, plus `nit: true` on a nitpick.
408
350
 
409
- Under `--json`, `--yes` is required.
351
+ Exit codes: `0` when no finding blocks merge, `1` when a finding blocks merge or the review could not start, `4` when another review of yours is still running, `5` when the review is still running (`--no-wait`), `10` when the review failed, `130` when interrupted (Ctrl-C or SIGTERM).
410
352
 
411
353
  ## Automation recipes
412
354