@tryarcanist/cli 0.1.383 → 0.1.385

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 +60 -60
  2. package/dist/index.js +185 -26876
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -13,7 +13,8 @@ Requires Node.js 22 or newer.
13
13
  ## Quick start
14
14
 
15
15
  ```bash
16
- printf "arc_..." | arcanist auth login --token-stdin
16
+ arcanist auth login # opens the browser; approve once
17
+ printf "arc_..." | arcanist auth login --token-stdin # automation: a token from Settings > CLI
17
18
  arcanist sessions list --json
18
19
  ```
19
20
 
@@ -25,7 +26,9 @@ arcanist sessions events "$SESSION_ID" --follow --json
25
26
 
26
27
  ## Authentication
27
28
 
28
- Mint a token in **Settings > CLI**, then pipe it to the CLI:
29
+ In a terminal, `arcanist auth login` opens the Arcanist app in your browser. Approve once and the CLI saves a new token. Pass `--scope write` for a write-scoped token (default `read`).
30
+
31
+ For automation, mint a token in **Settings > CLI** and pipe it to the CLI:
29
32
 
30
33
  ```bash
31
34
  printf "arc_..." | arcanist auth login --token-stdin
@@ -122,7 +125,7 @@ arcanist help sessions events --json
122
125
 
123
126
  Each node is `{path, description, aliases, arguments, options, notes?, subcommands}`. The node you ask for also has `globalOptions`, the flags it inherits from its parent commands. `arguments` entries are `{name, description, required, variadic}`, `options` entries are `{flags, description, required, defaultValue?}`, and `notes` holds the examples and JSON output shape that `--help` prints below the options.
124
127
 
125
- Commands that need a person at a terminal (`environments login` without `--clear`, `claude login` without `--token-stdin`) fail at once with exit code `1` when stdin or stderr is not a terminal.
128
+ Commands that need a person at a terminal (`auth login` without a token, `environments login` without `--clear`, `claude login` without `--token-stdin`) fail at once with exit code `1` when stdin or stderr is not a terminal.
126
129
 
127
130
  ## Commands
128
131
 
@@ -157,6 +160,27 @@ arcanist environments retry owner/repo --wait --json
157
160
  arcanist environments retry owner/repo --wait --poll-interval 5000 --json
158
161
  ```
159
162
 
163
+ ### `arcanist environments export`
164
+
165
+ Write an environment's configuration as one JSON file: name, description, provisioning kind and app runtime config, helper files, cache settings (setup, maintenance and smoke scripts, dependencies, CPU and memory) and trusted domains. Secrets, the saved browser login and the review doc are not exported. Read-scoped tokens can export. Pass an environment id or `owner/repo` outside a checkout.
166
+
167
+ ```bash
168
+ arcanist environments export owner/repo -o environment.json
169
+ ARCANIST_API_URL=https://app.tryarcanist.com arcanist environments export owner/repo > prod.json
170
+ ```
171
+
172
+ ### `arcanist environments import`
173
+
174
+ Apply an exported file to the same repository's environment on the current deployment, so one deployment can mirror another (for example QA from production). A write-scoped token is required. The target's primary repository must match the file. `--dry-run` lists the fields that differ without changing anything. When a build input changes, the server schedules a rebuild.
175
+
176
+ `--create` creates the environment from the file when the deployment has no team environment for the file's primary repository, and the server schedules its first build. It applies only without an `[environment]` argument. The Arcanist GitHub App must be installed for the repository there. A created environment has no secrets, browser login or review doc.
177
+
178
+ ```bash
179
+ ARCANIST_API_URL=https://staging.example.com arcanist environments import prod.json --dry-run
180
+ ARCANIST_API_URL=https://staging.example.com arcanist environments import prod.json --json
181
+ ARCANIST_API_URL=https://staging.example.com arcanist environments import local.json --create
182
+ ```
183
+
160
184
  ### `arcanist environments login`
161
185
 
162
186
  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.
@@ -198,6 +222,14 @@ ARCANIST_TOKEN=arc_... arcanist auth whoami --json
198
222
 
199
223
  JSON mode prints the raw `/api/auth/whoami` API response. Fields currently include `userId`, `email`, `tokenId`, `tokenScope`, and `authMode`.
200
224
 
225
+ ### `arcanist auth browser-session`
226
+
227
+ QA only. Trades a write-scope CLI token for a 24-hour browser session for the same user and prints it as a Playwright storage state (`{"cookies":[...],"origins":[]}`) on stdout. Only GitHub logins listed in the QA worker's `QA_BROWSER_SESSION_LOGINS` may do this; production returns 404. The output holds a live session token, so write it to a private file.
228
+
229
+ ```bash
230
+ ARCANIST_API_URL=https://qa.tryarcanist.com arcanist auth browser-session > storage-state.json
231
+ ```
232
+
201
233
  ### `arcanist codex login`
202
234
 
203
235
  Local development only; deployed workspaces return 403.
@@ -236,62 +268,6 @@ arcanist codex status --json
236
268
  JSON mode returns `{eligible, credential: {isSet, lastValidationStatus?, lastValidationReasonCode?}}`; `eligible` is always
237
269
  `true` and remains for compatibility with older clients.
238
270
 
239
- ### `arcanist codex logout`
240
-
241
- Removes the saved Codex subscription `auth.json`. OpenAI sessions fall back to the platform key.
242
-
243
- ```bash
244
- arcanist codex logout
245
- ```
246
-
247
- ### `arcanist settings …`
248
-
249
- Reads and changes every customer-facing setting the web app exposes. A read-scope token reads; a write-scope token changes.
250
- Workspace-wide changes (team defaults, exclusions, members, invite, secrets, integrations) also need the admin role.
251
- `approvals show` and `approvals set` both need a write-scope token and the admin role. `repo-reviews set`,
252
- `review-instructions set`, and `learned-doc clear` need write permission on the repository on GitHub.
253
- Every subcommand supports `--json`, which prints the API payload. Secret values are never printed.
254
-
255
- ```bash
256
- arcanist settings show # your review display preferences
257
- arcanist settings set --inline-nits on
258
- arcanist settings team-reviews show
259
- arcanist settings team-reviews set --auto-review on --drafts off
260
- arcanist settings repo-reviews list
261
- arcanist settings repo-reviews set acme/widgets --check blocking
262
- arcanist settings my-reviews set acme/widgets --auto-review inherit
263
- arcanist settings branch-exclusions add acme/widgets 'release/*'
264
- arcanist settings bot-exclusions add dependabot[bot]
265
- arcanist settings approvals show acme/widgets
266
- arcanist settings approvals set --policy-file policy.json
267
- arcanist settings review-instructions set acme/widgets --file REVIEW.md
268
- arcanist settings learned-doc clear acme/widgets
269
- arcanist settings members set-role 42 admin
270
- arcanist settings invite rotate
271
- arcanist settings secrets set acme/widgets NPM_TOKEN --value-file token.txt --sensitive on
272
- arcanist settings secrets import acme/widgets --file secrets.env
273
- arcanist settings integrations list
274
- arcanist settings setup answer acme/widgets <question-id> "use pnpm"
275
- ```
276
-
277
- Run `arcanist settings <group> --help` for the flags of each group.
278
-
279
- ### `arcanist resource-pools …` and `arcanist environments resources …`
280
-
281
- Manages shared resource pools (pooled credentials that sandboxes lease) and which environments draw from them.
282
-
283
- ```bash
284
- arcanist resource-pools create accounts
285
- arcanist resource-pools list
286
- arcanist resource-pools slots add accounts --name primary --credentials-file creds.env
287
- arcanist resource-pools slots set accounts <slot-id> --name primary --credentials-file creds.env
288
- arcanist resource-pools slots rm accounts <slot-id>
289
- arcanist resource-pools rm accounts
290
- arcanist environments resources list <environment-id>
291
- arcanist environments resources attach <environment-id> --name db --pool accounts
292
- arcanist environments resources detach <environment-id> --name db
293
- ```
294
-
295
271
  ### `arcanist sessions get <session-id>`
296
272
 
297
273
  ```bash
@@ -416,7 +392,7 @@ The upload limit is 3 MB. Each delivered review counts toward your plan's review
416
392
 
417
393
  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)`.
418
394
 
419
- 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. A finding with an agent prompt shows it under `Agent prompt:`, ready to paste into a coding agent in this checkout. Then `Code quality (N)` lists maintainability notes (never blocking), `Nitpicks (N)` lists nitpicks, and `✅ Ruled out (N)` lists what the review tried to break and why it held. JSON mode returns `{status, requestId, sessionId, verdict, summary, findings, codeQuality, alsoChecked}`, where each finding is `{file, line, blocksMerge, title, body}`, plus `nit: true` on a nitpick and `agentPrompt` when it has one; each code quality note is `{file, line, title, detail}` and each Ruled out item is `{title, conclusion}`. `codeQuality` and `alsoChecked` are left out when empty. `environmentDegradedReason` is added when the review ran without a prepared environment.
395
+ 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. A finding with an agent prompt shows it under `Agent prompt:`, ready to paste into a coding agent in this checkout. Then `✅ Ruled out (N)` lists what the review tried to break and why it held. JSON mode returns `{status, requestId, sessionId, verdict, summary, findings, alsoChecked}`, where each finding is `{file, line, blocksMerge, title, body}`, plus `agentPrompt` when it has one; each Ruled out item is `{title, conclusion}`. `alsoChecked` is left out when empty. `environmentDegradedReason` is added only for repositories an operator runs without their Environment.
420
396
 
421
397
  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).
422
398
 
@@ -437,3 +413,27 @@ For cron, prefer `ARCANIST_TOKEN` or a logged-in `~/.arcanist/config.json` over
437
413
  - **401 on a previously working token**: the token may have expired or been revoked in Settings. Regenerate and log in again.
438
414
  - **`You do not have access to this repository on GitHub`**: the token's user lacks repo access; fix the GitHub connection or use an accessible repo.
439
415
  - **`command not found`**: run `npm install -g @tryarcanist/cli`.
416
+
417
+ ### Read existing review diagnostics
418
+
419
+ ```bash
420
+ arcanist reviews get <pr-request-id> --json
421
+ arcanist reviews stages <session-id> --json
422
+ arcanist reviews stages <session-id> judge --json
423
+ arcanist sessions view <session-id> --json
424
+ ```
425
+
426
+ These commands read existing data. They start no review or model run and do not poll.
427
+ Successful reads exit 0, including active reviews and results with blocking findings.
428
+ API errors retain the normal exit codes. Quiet text mode suppresses output. JSON mode preserves the complete response.
429
+
430
+ `reviews get` accepts a **PR request ID** and returns `{review, requestStatus}`.
431
+ The lifecycle snapshot preserves `unavailableRequestIds` and retry/recovery state.
432
+ For a **local request ID**, use `arcanist review --request <id> --no-wait --json` with its existing review exit codes.
433
+
434
+ Stage reads require Arcanist membership. The index lists stage names, byte sizes, and upload timestamps.
435
+ A selected record includes full structured `input`, `output`, and `threads`. The CLI fetches no other records.
436
+
437
+ `sessions view` returns the enriched session envelope for the token workspace.
438
+ Its prompts contain the first page only (`promptLimit=1`). Use `sessions transcript` for full activity and `sessions artifacts` for files.
439
+ `sessions get` keeps its raw session response.