@tryarcanist/cli 0.1.342 → 0.1.344
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 +34 -15
- package/dist/index.js +109 -56
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ arcanist sessions list --json
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
export ARCANIST_TOKEN=arc_... # write-scoped for
|
|
21
|
+
export ARCANIST_TOKEN=arc_... # write-scoped for prepare, review, and stop
|
|
22
22
|
SESSION_ID=$(arcanist sessions list --json | jq -r '.sessions[0].id')
|
|
23
23
|
arcanist sessions events "$SESSION_ID" --follow --json
|
|
24
24
|
```
|
|
@@ -34,7 +34,7 @@ arcanist auth login
|
|
|
34
34
|
|
|
35
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
36
|
|
|
37
|
-
Use a read-scoped token for inspection and debugging; use a write-scoped token
|
|
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
38
|
|
|
39
39
|
You can also pipe the token via stdin:
|
|
40
40
|
|
|
@@ -95,14 +95,13 @@ With `--json`, successful command output is machine-readable and newline-termina
|
|
|
95
95
|
"error": {
|
|
96
96
|
"code": "auth",
|
|
97
97
|
"message": "Not logged in.",
|
|
98
|
-
"hint": "Run `arcanist auth login` or set `ARCANIST_TOKEN`."
|
|
99
|
-
"data": { "serverCode": "token_revoked" }
|
|
98
|
+
"hint": "Run `arcanist auth login` or set `ARCANIST_TOKEN`."
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
```
|
|
103
102
|
|
|
104
103
|
`error.data` is omitted when there is no structured recovery data.
|
|
105
|
-
Stable fields are `serverCode` for server-provided error codes and `
|
|
104
|
+
Stable fields are `serverCode` for server-provided error codes, `repository`, and `environmentsUrl`.
|
|
106
105
|
|
|
107
106
|
Exit codes:
|
|
108
107
|
|
|
@@ -116,21 +115,40 @@ Exit codes:
|
|
|
116
115
|
130 interrupted
|
|
117
116
|
```
|
|
118
117
|
|
|
119
|
-
|
|
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.
|
|
120
119
|
|
|
121
120
|
## Commands
|
|
122
121
|
|
|
123
|
-
### `arcanist environments prepare
|
|
122
|
+
### `arcanist environments prepare`
|
|
124
123
|
|
|
125
|
-
Prepare the current repository for Zeus
|
|
124
|
+
Prepare the current repository for Zeus. Pass `owner/repo` outside a checkout. A write-scoped token is required.
|
|
126
125
|
|
|
127
126
|
```bash
|
|
128
127
|
arcanist environments prepare --wait --json
|
|
128
|
+
arcanist environments prepare owner/repo --wait --poll-interval 5000 --json
|
|
129
|
+
```
|
|
130
|
+
|
|
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.
|
|
132
|
+
|
|
133
|
+
### `arcanist environments status`
|
|
134
|
+
|
|
135
|
+
Inspect machine-readable setup state. Read-scoped tokens can inspect status. Pass `owner/repo` outside a checkout.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
129
138
|
arcanist environments status owner/repo --json
|
|
130
|
-
arcanist environments
|
|
139
|
+
arcanist environments status owner/repo --wait --poll-interval 5000 --json
|
|
131
140
|
```
|
|
132
141
|
|
|
133
|
-
Agents should follow `repository.nextAction` and
|
|
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.
|
|
143
|
+
|
|
144
|
+
### `arcanist environments retry`
|
|
145
|
+
|
|
146
|
+
Retry a failed repository environment setup. A write-scoped token is required. Pass `owner/repo` outside a checkout.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
arcanist environments retry owner/repo --wait --json
|
|
150
|
+
arcanist environments retry owner/repo --wait --poll-interval 5000 --json
|
|
151
|
+
```
|
|
134
152
|
|
|
135
153
|
### `arcanist setup`
|
|
136
154
|
|
|
@@ -140,9 +158,10 @@ Connect Arcanist and prepare one or more repository environments. The command st
|
|
|
140
158
|
arcanist setup
|
|
141
159
|
arcanist setup acme/web
|
|
142
160
|
arcanist setup acme/web acme/api --json
|
|
161
|
+
arcanist setup acme/web acme/api --workspace
|
|
143
162
|
```
|
|
144
163
|
|
|
145
|
-
With no repository arguments, the command returns the eligible repositories and `selection_required`. Rerun with the repositories to prepare. 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.
|
|
164
|
+
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.
|
|
146
165
|
|
|
147
166
|
### `arcanist auth login`
|
|
148
167
|
|
|
@@ -152,7 +171,7 @@ printf "arc_..." | arcanist auth login --token-stdin
|
|
|
152
171
|
arcanist auth login --api-url https://api.tryarcanist.com
|
|
153
172
|
```
|
|
154
173
|
|
|
155
|
-
The default flow prints a browser authorization URL and waits for approval. `--json` writes the action immediately as JSONL on stderr and writes one final result to stdout.
|
|
174
|
+
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.
|
|
156
175
|
|
|
157
176
|
### `arcanist auth whoami`
|
|
158
177
|
|
|
@@ -253,11 +272,11 @@ arcanist sessions events abc123 --follow --json
|
|
|
253
272
|
|
|
254
273
|
JSON mode without `--follow` returns one JSON object from `/events/history`: `{events: [...], ...}`. Canonical events carry `phase`.
|
|
255
274
|
|
|
256
|
-
Follow mode emits NDJSON, one `{sequence, type, data}` object per line, until the session
|
|
275
|
+
Follow mode emits NDJSON, one `{sequence, type, data}` object per line, until the session reaches a terminal phase: `completed`, `superseded`, `needs_you`, `blocked`, `failed`, `stopped`, or `archived`. JSON follow still suppresses lifecycle `status` frames. Actionable follow-mode signals:
|
|
257
276
|
|
|
258
277
|
- PR opened or updated: `pr_created` / `pr_updated`; URL at `data.prUrl`.
|
|
259
278
|
- Waiting for human input: `question`; question text at `data.question`.
|
|
260
|
-
-
|
|
279
|
+
- Prompt or idle signals: `prompt_completed`, `prompt_failed`, and `session_idle`. Key on these event names rather than `waiting_for_input`. `session_idle` does not exit the process.
|
|
261
280
|
|
|
262
281
|
### `arcanist sessions transcript <session-id>`
|
|
263
282
|
|
|
@@ -371,7 +390,7 @@ Chain commands with `--json` and `jq`:
|
|
|
371
390
|
|
|
372
391
|
```bash
|
|
373
392
|
SESSION_ID=$(arcanist sessions list --json | jq -r '.sessions[0].id')
|
|
374
|
-
arcanist sessions events "$SESSION_ID" --follow --json | jq -r 'select(.type == "
|
|
393
|
+
arcanist sessions events "$SESSION_ID" --follow --json | jq -r 'select(.type == "text")'
|
|
375
394
|
```
|
|
376
395
|
|
|
377
396
|
For cron, prefer `ARCANIST_TOKEN` or a logged-in `~/.arcanist/config.json` over passing `--token` on the command line.
|
package/dist/index.js
CHANGED
|
@@ -7367,11 +7367,50 @@ var require_dist = __commonJS({
|
|
|
7367
7367
|
// src/index.ts
|
|
7368
7368
|
import { Command } from "commander";
|
|
7369
7369
|
|
|
7370
|
+
// ../../shared/session/phase.ts
|
|
7371
|
+
var PHASES = [
|
|
7372
|
+
"idle",
|
|
7373
|
+
"running",
|
|
7374
|
+
"review_starting",
|
|
7375
|
+
"waiting_for_input",
|
|
7376
|
+
"finalizing",
|
|
7377
|
+
"review_listening",
|
|
7378
|
+
"completed",
|
|
7379
|
+
"superseded",
|
|
7380
|
+
"needs_you",
|
|
7381
|
+
"blocked",
|
|
7382
|
+
"failed",
|
|
7383
|
+
"stopped",
|
|
7384
|
+
"archived"
|
|
7385
|
+
];
|
|
7386
|
+
var TERMINAL_PHASES_ARRAY = [
|
|
7387
|
+
"completed",
|
|
7388
|
+
"superseded",
|
|
7389
|
+
"needs_you",
|
|
7390
|
+
"blocked",
|
|
7391
|
+
"failed",
|
|
7392
|
+
"stopped",
|
|
7393
|
+
"archived"
|
|
7394
|
+
];
|
|
7395
|
+
var TERMINAL_PHASES = new Set(TERMINAL_PHASES_ARRAY);
|
|
7396
|
+
var TERMINAL_FOR_FALLBACK_POLLING_PHASES = new Set(
|
|
7397
|
+
TERMINAL_PHASES_ARRAY.filter((phase) => phase !== "completed")
|
|
7398
|
+
);
|
|
7399
|
+
var CHILD_SLOT_RELEASE_PHASES = new Set(
|
|
7400
|
+
TERMINAL_PHASES_ARRAY.filter((phase) => phase !== "stopped")
|
|
7401
|
+
);
|
|
7402
|
+
var ARCHIVABLE_STALE_TERMINAL_PHASES_ARRAY = TERMINAL_PHASES_ARRAY.filter(
|
|
7403
|
+
(phase) => phase !== "archived" && phase !== "needs_you" && phase !== "blocked" && phase !== "stopped"
|
|
7404
|
+
);
|
|
7405
|
+
function isTerminalPhase(phase, _sessionKind) {
|
|
7406
|
+
return TERMINAL_PHASES.has(phase);
|
|
7407
|
+
}
|
|
7408
|
+
|
|
7370
7409
|
// package.json
|
|
7371
7410
|
var package_default = {
|
|
7372
7411
|
name: "@tryarcanist/cli",
|
|
7373
|
-
version: "0.1.
|
|
7374
|
-
description: "
|
|
7412
|
+
version: "0.1.344",
|
|
7413
|
+
description: "Command-line interface for Arcanist: inspect sessions, prepare Zeus environments, and trigger reviews",
|
|
7375
7414
|
type: "module",
|
|
7376
7415
|
bin: {
|
|
7377
7416
|
arcanist: "dist/index.js"
|
|
@@ -23070,45 +23109,6 @@ function assertSameAttempt(triggeredSessionId, settledSessionId, label) {
|
|
|
23070
23109
|
}
|
|
23071
23110
|
}
|
|
23072
23111
|
|
|
23073
|
-
// ../../shared/session/phase.ts
|
|
23074
|
-
var PHASES = [
|
|
23075
|
-
"idle",
|
|
23076
|
-
"running",
|
|
23077
|
-
"review_starting",
|
|
23078
|
-
"waiting_for_input",
|
|
23079
|
-
"finalizing",
|
|
23080
|
-
"review_listening",
|
|
23081
|
-
"completed",
|
|
23082
|
-
"superseded",
|
|
23083
|
-
"needs_you",
|
|
23084
|
-
"blocked",
|
|
23085
|
-
"failed",
|
|
23086
|
-
"stopped",
|
|
23087
|
-
"archived"
|
|
23088
|
-
];
|
|
23089
|
-
var TERMINAL_PHASES_ARRAY = [
|
|
23090
|
-
"completed",
|
|
23091
|
-
"superseded",
|
|
23092
|
-
"needs_you",
|
|
23093
|
-
"blocked",
|
|
23094
|
-
"failed",
|
|
23095
|
-
"stopped",
|
|
23096
|
-
"archived"
|
|
23097
|
-
];
|
|
23098
|
-
var TERMINAL_PHASES = new Set(TERMINAL_PHASES_ARRAY);
|
|
23099
|
-
var TERMINAL_FOR_FALLBACK_POLLING_PHASES = new Set(
|
|
23100
|
-
TERMINAL_PHASES_ARRAY.filter((phase) => phase !== "completed")
|
|
23101
|
-
);
|
|
23102
|
-
var CHILD_SLOT_RELEASE_PHASES = new Set(
|
|
23103
|
-
TERMINAL_PHASES_ARRAY.filter((phase) => phase !== "stopped")
|
|
23104
|
-
);
|
|
23105
|
-
var ARCHIVABLE_STALE_TERMINAL_PHASES_ARRAY = TERMINAL_PHASES_ARRAY.filter(
|
|
23106
|
-
(phase) => phase !== "archived" && phase !== "needs_you" && phase !== "blocked" && phase !== "stopped"
|
|
23107
|
-
);
|
|
23108
|
-
function isTerminalPhase(phase, _sessionKind) {
|
|
23109
|
-
return TERMINAL_PHASES.has(phase);
|
|
23110
|
-
}
|
|
23111
|
-
|
|
23112
23112
|
// src/constants/watch.ts
|
|
23113
23113
|
var MIN_WATCH_POLL_INTERVAL_MS = 250;
|
|
23114
23114
|
var DEFAULT_WATCH_POLL_INTERVAL_MS = 1e3;
|
|
@@ -23149,11 +23149,33 @@ async function fetchSetupState(config2, fullName) {
|
|
|
23149
23149
|
status: "not_started",
|
|
23150
23150
|
stage: null
|
|
23151
23151
|
};
|
|
23152
|
-
|
|
23152
|
+
const action = nextAction(state);
|
|
23153
|
+
return { ...state, nextAction: action, command: commandForNextAction(action, state.fullName) };
|
|
23153
23154
|
}
|
|
23154
23155
|
function isActive(state) {
|
|
23155
23156
|
return state.nextAction === "wait";
|
|
23156
23157
|
}
|
|
23158
|
+
function commandForNextAction(action, fullName) {
|
|
23159
|
+
switch (action) {
|
|
23160
|
+
case "prepare":
|
|
23161
|
+
return `arcanist environments prepare ${fullName}`;
|
|
23162
|
+
case "wait":
|
|
23163
|
+
return `arcanist environments status ${fullName} --wait`;
|
|
23164
|
+
case "retry":
|
|
23165
|
+
return `arcanist environments retry ${fullName}`;
|
|
23166
|
+
case "review":
|
|
23167
|
+
return null;
|
|
23168
|
+
case "add_credentials":
|
|
23169
|
+
case "answer_question":
|
|
23170
|
+
case "authorize_github":
|
|
23171
|
+
case "wait_for_arcanist":
|
|
23172
|
+
return null;
|
|
23173
|
+
default: {
|
|
23174
|
+
const _exhaustive = action;
|
|
23175
|
+
return _exhaustive;
|
|
23176
|
+
}
|
|
23177
|
+
}
|
|
23178
|
+
}
|
|
23157
23179
|
function nextAction(state) {
|
|
23158
23180
|
if (state.status === "not_started") return "prepare";
|
|
23159
23181
|
if (state.status === "ready") return "review";
|
|
@@ -23219,11 +23241,13 @@ async function environmentPrepareCommand(repoArg, options = {}, command) {
|
|
|
23219
23241
|
emit(command, options, { repository: state2 }, ({ repository }) => printState(repository));
|
|
23220
23242
|
return;
|
|
23221
23243
|
}
|
|
23244
|
+
const action = result.status === "already_ready" ? "review" : "wait";
|
|
23222
23245
|
const state = {
|
|
23223
23246
|
fullName: result.fullName,
|
|
23224
23247
|
status: result.status === "already_ready" ? "ready" : "pending",
|
|
23225
23248
|
stage: null,
|
|
23226
|
-
nextAction:
|
|
23249
|
+
nextAction: action,
|
|
23250
|
+
command: commandForNextAction(action, result.fullName)
|
|
23227
23251
|
};
|
|
23228
23252
|
emit(command, options, { repository: state }, ({ repository }) => printState(repository));
|
|
23229
23253
|
}
|
|
@@ -23259,11 +23283,12 @@ var DEVICE_AUTH_TOKEN_PATH = "/api/auth/cli/device/token";
|
|
|
23259
23283
|
async function loginCommand(options, command) {
|
|
23260
23284
|
const runtime = getRuntimeOptions(command, options);
|
|
23261
23285
|
const apiUrl = resolveLoginApiUrl(runtime.apiUrl);
|
|
23286
|
+
const envOrFlag = resolveEnvOrFlagConfig(runtime, false);
|
|
23262
23287
|
let token = null;
|
|
23263
23288
|
if (options.tokenStdin) {
|
|
23264
23289
|
token = await readStdinTrimmed();
|
|
23265
|
-
} else if (
|
|
23266
|
-
token =
|
|
23290
|
+
} else if (envOrFlag?.token) {
|
|
23291
|
+
token = envOrFlag.token;
|
|
23267
23292
|
} else {
|
|
23268
23293
|
token = await loginWithDeviceAuthorization(apiUrl, runtime);
|
|
23269
23294
|
}
|
|
@@ -27021,7 +27046,13 @@ async function setupCommand(repoArgs = [], options = {}, command) {
|
|
|
27021
27046
|
}
|
|
27022
27047
|
const runtime = getRuntimeOptions(command, options);
|
|
27023
27048
|
let config2 = loadConfig(runtime);
|
|
27024
|
-
if (!config2)
|
|
27049
|
+
if (!config2) {
|
|
27050
|
+
const envOrFlag = resolveEnvOrFlagConfig(runtime, false);
|
|
27051
|
+
if ((process.stdin.isTTY !== true || process.stdout.isTTY !== true) && !envOrFlag?.token) {
|
|
27052
|
+
throw new CliError("auth", "Not logged in.", { hint: "Run `arcanist auth login` or set `ARCANIST_TOKEN`." });
|
|
27053
|
+
}
|
|
27054
|
+
config2 = await loginCommand({ ...runtime, emitResult: false }, command);
|
|
27055
|
+
}
|
|
27025
27056
|
const requested = repoArgs.map((value) => {
|
|
27026
27057
|
const repo = parseRepoArg(value);
|
|
27027
27058
|
return `${repo.owner}/${repo.repo}`;
|
|
@@ -27163,7 +27194,7 @@ function emitSetupAction(runtime, action) {
|
|
|
27163
27194
|
`);
|
|
27164
27195
|
}
|
|
27165
27196
|
function trackingCommands(repositories) {
|
|
27166
|
-
return repositories.map((repository) => `Track later:
|
|
27197
|
+
return repositories.map((repository) => `Track later: ${commandForNextAction("wait", repository)}`);
|
|
27167
27198
|
}
|
|
27168
27199
|
|
|
27169
27200
|
// src/commands/stop.ts
|
|
@@ -27391,7 +27422,7 @@ var { version: version3 } = package_default;
|
|
|
27391
27422
|
var program = new Command().name("arcanist").description("Arcanist CLI").version(version3).option("--json", "Output machine-readable JSON").option("--quiet", "Suppress non-essential stderr output").option("--api-url <url>", "Override API URL. Prefer ARCANIST_API_URL for persistent use").option(
|
|
27392
27423
|
"--token <token>",
|
|
27393
27424
|
"Override API token. Prefer ARCANIST_TOKEN because flags can be visible in shell history and process lists"
|
|
27394
|
-
).option("--no-color", "Disable color output").exitOverride().addHelpText(
|
|
27425
|
+
).option("--no-color", "Disable color output").configureHelp({ showGlobalOptions: true }).addHelpCommand(false).exitOverride().addHelpText(
|
|
27395
27426
|
"after",
|
|
27396
27427
|
`
|
|
27397
27428
|
Examples:
|
|
@@ -27410,7 +27441,7 @@ program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
|
27410
27441
|
applyColorEnvironment(getRuntimeOptions(actionCommand));
|
|
27411
27442
|
});
|
|
27412
27443
|
var auth = program.command("auth").description("Authentication commands");
|
|
27413
|
-
auth.command("login").description("Authenticate through your browser").option("--token-stdin", "Read token from stdin instead of interactive prompt").
|
|
27444
|
+
auth.command("login").description("Authenticate through your browser").option("--token-stdin", "Read token from stdin instead of interactive prompt").addHelpText(
|
|
27414
27445
|
"after",
|
|
27415
27446
|
`
|
|
27416
27447
|
Examples:
|
|
@@ -27520,7 +27551,7 @@ JSON:
|
|
|
27520
27551
|
JSON mode returns {sessions, nextCursor}. --all follows cursors until nextCursor is null.
|
|
27521
27552
|
`
|
|
27522
27553
|
).action((options, command) => listSessionsCommand(options, command));
|
|
27523
|
-
sessions.command("events").description("Read or follow session replay events").argument("<session-id>", "Session ID").option("--after-sequence <n>", "Return events after this sequence").option("--after <n>", "Alias for --after-sequence").option("--before-sequence <n>", "Return events before this sequence").option("--before <n>", "Alias for --before-sequence").option("--prompt-id <id>", "Filter events by prompt ID").option("--limit <n>", "Maximum events to return").option("--follow", "Follow events until
|
|
27554
|
+
sessions.command("events").description("Read or follow session replay events").argument("<session-id>", "Session ID").option("--after-sequence <n>", "Return events after this sequence").option("--after <n>", "Alias for --after-sequence").option("--before-sequence <n>", "Return events before this sequence").option("--before <n>", "Alias for --before-sequence").option("--prompt-id <id>", "Filter events by prompt ID").option("--limit <n>", "Maximum events to return").option("--follow", "Follow events until a terminal phase").option("--poll-interval <ms>", "Polling interval in milliseconds", String(DEFAULT_WATCH_POLL_INTERVAL_MS)).addHelpText(
|
|
27524
27555
|
"after",
|
|
27525
27556
|
`
|
|
27526
27557
|
Examples:
|
|
@@ -27531,8 +27562,8 @@ Examples:
|
|
|
27531
27562
|
|
|
27532
27563
|
JSON:
|
|
27533
27564
|
JSON mode without --follow returns one JSON object from /events/history: {events: [...], ...}; canonical events carry phase.
|
|
27534
|
-
--follow --json emits NDJSON, one {sequence, type, data} object per line.
|
|
27535
|
-
|
|
27565
|
+
--follow --json emits NDJSON, one {sequence, type, data} object per line, until a terminal phase: ${formatTerminalPhaseHelpList(TERMINAL_PHASES_ARRAY)}.
|
|
27566
|
+
Actionable follow types are NDJSON signals, not process-exit conditions: pr_created/pr_updated use data.prUrl; question uses data.question; prompt_completed, prompt_failed, and session_idle do not exit the process.
|
|
27536
27567
|
`
|
|
27537
27568
|
).action((sessionId, options, command) => sessionEventsCommand(sessionId, options, command));
|
|
27538
27569
|
sessions.command("transcript").description("Render a session transcript").argument("<session-id>", "Session ID").option("--last <n>", "Render only the last n transcript entries").addHelpText(
|
|
@@ -27603,7 +27634,8 @@ environments.command("status").description("Show repository environment setup st
|
|
|
27603
27634
|
"after",
|
|
27604
27635
|
`
|
|
27605
27636
|
JSON:
|
|
27606
|
-
Returns {repository: {fullName, status, stage, nextAction, buildStatus?, failureReason?, secretRequest?, question?}}.
|
|
27637
|
+
Returns {repository: {fullName, status, stage, nextAction, command, buildStatus?, failureReason?, secretRequest?, question?}}.
|
|
27638
|
+
command is the CLI argv to run, or null when the next step is the web UI or Arcanist.
|
|
27607
27639
|
The stable status values are not_started, pending, running, escalated, succeeded, failed, and ready.
|
|
27608
27640
|
`
|
|
27609
27641
|
).action((repo, options, command) => environmentStatusCommand(repo, options, command));
|
|
@@ -27685,6 +27717,9 @@ Examples:
|
|
|
27685
27717
|
`
|
|
27686
27718
|
).action((repo, name, options, command) => setTestCredentialCommand(repo, name, options, command));
|
|
27687
27719
|
testCreds.command("delete").description("Delete a test credential").argument("<repo>", "Repository in 'owner/name' form").argument("<name>", "Credential name").requiredOption("--business <id>", "Business ID that owns the repo").option("--yes", "Confirm deletion without prompting").action((repo, name, options, command) => deleteTestCredentialCommand(repo, name, options, command));
|
|
27720
|
+
program.command("help").description("display help for command").argument("[path...]", "Command path to explain").action((path) => {
|
|
27721
|
+
commandForHelpPath(program, path).help({ error: false });
|
|
27722
|
+
});
|
|
27688
27723
|
async function main() {
|
|
27689
27724
|
try {
|
|
27690
27725
|
await program.parseAsync(process.argv);
|
|
@@ -27708,9 +27743,27 @@ async function main() {
|
|
|
27708
27743
|
}
|
|
27709
27744
|
}
|
|
27710
27745
|
function isCommanderHelpOrVersion(err) {
|
|
27711
|
-
if (!err || typeof err !== "object") return false;
|
|
27712
|
-
const code = err
|
|
27713
|
-
|
|
27746
|
+
if (!err || typeof err !== "object" || !("code" in err)) return false;
|
|
27747
|
+
const { code } = err;
|
|
27748
|
+
if (code === "commander.helpDisplayed" || code === "commander.version") return true;
|
|
27749
|
+
return code === "commander.help" && "exitCode" in err && err.exitCode === 0;
|
|
27750
|
+
}
|
|
27751
|
+
function formatTerminalPhaseHelpList(phases) {
|
|
27752
|
+
const last = phases.at(-1);
|
|
27753
|
+
if (last === void 0) return "";
|
|
27754
|
+
if (phases.length === 1) return last;
|
|
27755
|
+
return `${phases.slice(0, -1).join(", ")}, or ${last}`;
|
|
27756
|
+
}
|
|
27757
|
+
function commandForHelpPath(root, path) {
|
|
27758
|
+
let current = root;
|
|
27759
|
+
for (const name of path) {
|
|
27760
|
+
const next = current.commands.find((candidate) => candidate.name() === name || candidate.aliases().includes(name));
|
|
27761
|
+
if (!next) {
|
|
27762
|
+
throw new CliError("user", `Unknown help topic: ${path.join(" ")}`);
|
|
27763
|
+
}
|
|
27764
|
+
current = next;
|
|
27765
|
+
}
|
|
27766
|
+
return current;
|
|
27714
27767
|
}
|
|
27715
27768
|
function restoreTerminal() {
|
|
27716
27769
|
if (process.stdin.isTTY) process.stdin.setRawMode(false);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryarcanist/cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.344",
|
|
4
|
+
"description": "Command-line interface for Arcanist: inspect sessions, prepare Zeus environments, and trigger reviews",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"arcanist": "dist/index.js"
|