@tryarcanist/cli 0.1.268 → 0.1.270
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 +7 -79
- package/dist/index.js +3266 -3765
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Arcanist CLI
|
|
2
2
|
|
|
3
|
-
Command-line interface for [Arcanist](https://www.tryarcanist.com):
|
|
3
|
+
Command-line interface for [Arcanist](https://www.tryarcanist.com): run Anubis QA verifications, follow session output, and manage access tokens from your terminal or automation.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -14,12 +14,12 @@ Requires Node.js 22 or newer.
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
arcanist auth login # paste a token from Settings > CLI
|
|
17
|
-
arcanist
|
|
17
|
+
arcanist anubis https://github.com/your-org/your-repo/pull/123 --wait --json
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
export ARCANIST_TOKEN=arc_... # write-scoped for
|
|
22
|
-
SESSION_ID=$(arcanist
|
|
21
|
+
export ARCANIST_TOKEN=arc_... # write-scoped for anubis/stop
|
|
22
|
+
SESSION_ID=$(arcanist anubis your-org/your-repo/pull/123 --json | jq -r .sessionId)
|
|
23
23
|
arcanist sessions events "$SESSION_ID" --follow --json
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -102,7 +102,7 @@ With `--json`, successful command output is machine-readable and newline-termina
|
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
`error.data` is omitted when there is no structured recovery data.
|
|
105
|
-
Stable fields are `serverCode` for server-provided error codes and `sessionId
|
|
105
|
+
Stable fields are `serverCode` for server-provided error codes and `sessionId` when the server started a session before the request failed.
|
|
106
106
|
|
|
107
107
|
Exit codes:
|
|
108
108
|
|
|
@@ -116,7 +116,7 @@ Exit codes:
|
|
|
116
116
|
130 interrupted
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
Mutation commands send an `Idempotency-Key` header. The CLI does not auto-retry mutation endpoints; retry explicitly with the same `--idempotency-key` when a request may have already reached the server. `--idempotency-key` is available on `
|
|
119
|
+
Mutation commands send an `Idempotency-Key` header. The CLI does not auto-retry mutation endpoints; retry explicitly with the same `--idempotency-key` when a request may have already reached the server. `--idempotency-key` is available on `tokens create` and `sandbox build`. Both use auto-random keys by default, so only an explicit key makes cross-invocation retries safe.
|
|
120
120
|
|
|
121
121
|
## Commands
|
|
122
122
|
|
|
@@ -177,60 +177,6 @@ Deactivates the selector and removes the stored Codex subscription auth for your
|
|
|
177
177
|
arcanist codex logout
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
### `arcanist sessions create <repo-url> [prompt]`
|
|
181
|
-
|
|
182
|
-
Creates a new session and sends the initial prompt.
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
arcanist sessions create https://github.com/your-org/your-repo "fix the login bug"
|
|
186
|
-
arcanist sessions create your-org/your-repo "continue this work" --start-branch wip/resume-me
|
|
187
|
-
printf "add tests" | arcanist sessions create your-org/your-repo --prompt-stdin --json
|
|
188
|
-
printf "add tests" | arcanist sessions create your-org/your-repo --prompt-stdin --wait
|
|
189
|
-
arcanist sessions create your-org/your-repo - --model gpt-5.5
|
|
190
|
-
arcanist sessions create your-org/your-repo "refactor auth" --reasoning-effort xhigh
|
|
191
|
-
arcanist sessions create your-org/your-repo "use the saved login" --browser-identity identity-id
|
|
192
|
-
arcanist sessions create your-org/your-repo "start signed out" --browser-identity none
|
|
193
|
-
arcanist sessions create your-org/your-repo "fix release branch" --base-branch release/2026-06
|
|
194
|
-
arcanist sessions create your-org/your-repo "review the trace" --uploaded-file trace.txt
|
|
195
|
-
arcanist sessions create your-org/your-repo "retry-safe create" --idempotency-key 1f0e6f1a-...
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
`--model` pins the model for the session; the CLI rejects an unknown model before any network call. Run `arcanist models list` for the selectable models. When `--model` is omitted the default is used. Claude models run on the Codex runtime and require the Anthropic provider credential configured in Settings.
|
|
199
|
-
|
|
200
|
-
`--wait` blocks until the created prompt finishes, prints the resulting PR/branch line in human-readable mode when it is already available, and exits non-zero if the prompt finishes with `status: failed`, making it suitable for cron or other schedulers that alert on command failure. JSON mode waits quietly and prints the create payload after the prompt completes successfully. `--poll-interval <ms>` tunes the completion check frequency.
|
|
201
|
-
|
|
202
|
-
Use `--browser-identity <id|none>` to attach a business browser identity to the session, or pass `none` to explicitly start without one. Access is authorized by the control plane when the session is created.
|
|
203
|
-
|
|
204
|
-
Use `--base-branch <branch>` to target a non-default base branch. The CLI only validates that the branch value is non-empty; branch existence is checked later by the session runtime.
|
|
205
|
-
|
|
206
|
-
Use `--start-branch <branch>` to resume an existing branch with its history instead of forking a fresh branch off base; the control plane verifies the branch exists on the remote and fails closed if it does not.
|
|
207
|
-
|
|
208
|
-
Repeatable `--uploaded-file <path>` flags attach local UTF-8 text files to the prompt. Uploaded file names come from the local basename; directory components are not sent.
|
|
209
|
-
|
|
210
|
-
Sessions always start from a fresh sandbox (the warm sandbox pool was removed).
|
|
211
|
-
|
|
212
|
-
`--idempotency-key <uuid>` is for manually retrying a create request that may have reached the server.
|
|
213
|
-
The CLI derives separate session and prompt idempotency keys from the provided value.
|
|
214
|
-
|
|
215
|
-
JSON mode returns `{sessionId, sessionUrl?, repoUrl, model?, reasoningEffort?, baseBranch?, startBranch?, promptId?}`. With `--wait`, JSON mode also includes best-effort result fields when available: `prUrl?`, `publishedBranch?`, and `lastBranch?`.
|
|
216
|
-
|
|
217
|
-
### `arcanist sessions send <session-id> [prompt]`
|
|
218
|
-
|
|
219
|
-
Sends a follow-up message to an existing session.
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
arcanist sessions send abc123 "also update the tests"
|
|
223
|
-
arcanist sessions send abc123 "use this failure log" --uploaded-file failure.log
|
|
224
|
-
printf "summarize current status" | arcanist sessions send abc123 --prompt-stdin --json
|
|
225
|
-
arcanist sessions send abc123 "retry-safe send" --idempotency-key 1f0e6f1a-...
|
|
226
|
-
arcanist sessions send abc123 "also update the tests" --wait --poll-interval 1000 --json
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Repeatable `--uploaded-file <path>` flags attach local UTF-8 text files to the follow-up prompt. `--idempotency-key <uuid>` is for manually retrying a send that may have reached the server. `--wait` blocks until the sent prompt finishes; use `--poll-interval <ms>` to tune completion polling.
|
|
230
|
-
|
|
231
|
-
JSON mode returns `{sessionId, promptId?}`.
|
|
232
|
-
With `--wait`, JSON mode also includes best-effort result fields when available: `prUrl?`, `publishedBranch?`, `lastBranch?`.
|
|
233
|
-
|
|
234
180
|
### `arcanist sessions stop <session-id>`
|
|
235
181
|
|
|
236
182
|
Stops the active run for a session. Idempotent: if no sandbox is active, the server returns `already_stopped`.
|
|
@@ -416,33 +362,15 @@ Active runs are deduplicated server-side, so the idempotency-key option does not
|
|
|
416
362
|
|
|
417
363
|
## Automation recipes
|
|
418
364
|
|
|
419
|
-
Run a prompt on a schedule and alert only when the prompt itself fails — `sessions create --wait` makes the exit code reflect the prompt outcome:
|
|
420
|
-
|
|
421
|
-
```cron
|
|
422
|
-
*/15 * * * * printf 'summarize new error-tracker regressions' | \
|
|
423
|
-
ARCANIST_TOKEN=arc_... \
|
|
424
|
-
arcanist sessions create your-org/your-repo --prompt-stdin --wait \
|
|
425
|
-
|| notify-send "Arcanist scheduled run failed"
|
|
426
|
-
```
|
|
427
|
-
|
|
428
365
|
Chain commands with `--json` and `jq`:
|
|
429
366
|
|
|
430
367
|
```bash
|
|
431
|
-
SESSION_ID=$(arcanist
|
|
368
|
+
SESSION_ID=$(arcanist anubis your-org/your-repo/pull/123 --json | jq -r .sessionId)
|
|
432
369
|
arcanist sessions events "$SESSION_ID" --follow --json | jq -r 'select(.type == "assistant_message")'
|
|
433
370
|
```
|
|
434
371
|
|
|
435
372
|
For cron, prefer `ARCANIST_TOKEN` or a logged-in `~/.arcanist/config.json` over passing `--token` on the command line.
|
|
436
373
|
|
|
437
|
-
To capture the PR URL after a successful run, read the best-effort result fields from `create --wait --json`:
|
|
438
|
-
|
|
439
|
-
```bash
|
|
440
|
-
RESULT=$(arcanist sessions create your-org/your-repo "fix the flaky test" --wait --json)
|
|
441
|
-
PR_URL=$(jq -r '.prUrl // empty' <<<"$RESULT")
|
|
442
|
-
SESSION_ID=$(jq -r '.sessionId' <<<"$RESULT")
|
|
443
|
-
[ -n "$PR_URL" ] || { echo "PR URL not ready for $SESSION_ID" >&2; exit 1; }
|
|
444
|
-
```
|
|
445
|
-
|
|
446
374
|
## Troubleshooting
|
|
447
375
|
|
|
448
376
|
- **401 on login verification**: token may be invalid or expired. Regenerate in **Settings > CLI**.
|