@tryarcanist/cli 0.1.200 → 0.1.202
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 -0
- package/dist/index.js +32 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ Requires Node.js 22 or newer.
|
|
|
15
15
|
```bash
|
|
16
16
|
arcanist auth login # paste a token from Settings > CLI Tokens
|
|
17
17
|
arcanist sessions create https://github.com/your-org/your-repo "fix the login bug"
|
|
18
|
+
arcanist sessions create https://github.com/your-org/your-repo "fix ARC-1635" --linear-issue https://linear.app/team/issue/ARC-1635/fix-login
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
```bash
|
|
@@ -208,6 +209,9 @@ Use `--start-branch <branch>` to resume an existing branch with its history inst
|
|
|
208
209
|
|
|
209
210
|
Use `--continue-pr <url>` to continue an open same-repo pull request. The control plane checks out the PR head branch before the prompt runs. `--continue-mode update-pr` updates the referenced PR; `--continue-mode new-pr` starts from that PR head but leaves publish free to open a fresh PR. `auto` is the default and currently resolves to same-PR update for supported open same-repo PRs.
|
|
210
211
|
|
|
212
|
+
Use `--linear-issue <id|url>` to attach a Linear issue reference to the created session.
|
|
213
|
+
The CLI echoes the request value as `linearIssue` in JSON output; pickup writeback occurs after the first prompt is durably enqueued.
|
|
214
|
+
|
|
211
215
|
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.
|
|
212
216
|
|
|
213
217
|
`--cold` is a deprecated no-op retained for backward compatibility. Sessions always start from a fresh sandbox (the warm sandbox pool was removed), so the flag has no effect.
|
|
@@ -419,12 +423,15 @@ Creates a scheduled automation for a GitHub repo. Create/delete require a write-
|
|
|
419
423
|
```bash
|
|
420
424
|
arcanist automations create your-org/your-repo "summarize new regressions" --cron "*/15 * * * *"
|
|
421
425
|
arcanist automations create your-org/your-repo "audit N+1s" --cron "0 13 * * 5" --model gpt-5.5
|
|
426
|
+
arcanist automations create your-org/your-repo "/audit-prod-docs https://docs.tryarcanist.com/" --cron "0 8 * * *" --slack-team-id T0123ABC --slack-channel-id C0456DEF
|
|
422
427
|
printf "summarize new regressions" | arcanist automations create your-org/your-repo --prompt-stdin --cron "*/15 * * * *" --json
|
|
423
428
|
arcanist automations create https://github.com/your-org/your-repo - --cron "0 14 * * 1-5" --name "Weekday summary"
|
|
424
429
|
```
|
|
425
430
|
|
|
426
431
|
Use `--model <model>` to pin the model for sessions started by the automation. Backend is derived from the model; non-codex backends such as Claude or opencode are limited to Arcanist team businesses. When `--model` is omitted the codex backend default is used.
|
|
427
432
|
|
|
433
|
+
Use `--slack-team-id <team-id>` together with `--slack-channel-id <channel-id>` to deliver each completed automation digest into a Slack channel. Both flags are required together; the target workspace must already be connected to Arcanist and the bot must already be in the channel.
|
|
434
|
+
|
|
428
435
|
JSON mode prints the created rule. Human-readable mode prints the rule ID, repo, normalized cron, and next fire time.
|
|
429
436
|
|
|
430
437
|
### `arcanist automations list`
|
package/dist/index.js
CHANGED
|
@@ -1171,6 +1171,10 @@ var AUTOMATION_ERROR_HINTS = {
|
|
|
1171
1171
|
repo_not_available: "Check that the token owner has GitHub access and Arcanist is installed for that repo.",
|
|
1172
1172
|
duplicate_rule: "An enabled automation already exists for this repo, cron, and prompt.",
|
|
1173
1173
|
invalid_skill: "Use a leading slash skill that exists in the selected repo, for example: /audit-prod-docs",
|
|
1174
|
+
invalid_slack_target: "Pass both --slack-team-id and --slack-channel-id to enable Slack delivery.",
|
|
1175
|
+
slack_workspace_not_connected: "Connect that Slack workspace to Arcanist before creating the automation.",
|
|
1176
|
+
slack_channel_unavailable: "Check the Slack channel ID and confirm the bot can see the channel.",
|
|
1177
|
+
slack_bot_not_in_channel: "Invite the Arcanist bot to the channel, then retry.",
|
|
1174
1178
|
rule_cap_reached: "Delete or disable an existing automation before creating another one. The cap is 20 enabled rules.",
|
|
1175
1179
|
installation_unresolved: "Reconnect or reinstall the GitHub integration for that repository, then retry.",
|
|
1176
1180
|
model_not_available: "That model's backend (Claude/opencode) is limited to Arcanist team businesses; use the codex default or a codex model.",
|
|
@@ -1181,6 +1185,15 @@ var MAX_ALL_PAGES = 1e3;
|
|
|
1181
1185
|
async function createAutomationCommand(repoUrl, promptArg, options, command) {
|
|
1182
1186
|
const repo = parseAutomationRepo(repoUrl);
|
|
1183
1187
|
const prompt = await resolvePromptInput(promptArg, options);
|
|
1188
|
+
const slackTeamId = options.slackTeamId?.trim();
|
|
1189
|
+
const slackChannelId = options.slackChannelId?.trim();
|
|
1190
|
+
const slackDeliveryRequested = options.slackTeamId !== void 0 || options.slackChannelId !== void 0;
|
|
1191
|
+
if (slackDeliveryRequested && (!slackTeamId || !slackChannelId)) {
|
|
1192
|
+
throw new CliError(
|
|
1193
|
+
"user",
|
|
1194
|
+
"Slack delivery requires both --slack-team-id and --slack-channel-id with non-empty values."
|
|
1195
|
+
);
|
|
1196
|
+
}
|
|
1184
1197
|
const runtime = getRuntimeOptions(command, options);
|
|
1185
1198
|
const config = requireConfig(runtime);
|
|
1186
1199
|
let normalizedModel;
|
|
@@ -1200,6 +1213,10 @@ async function createAutomationCommand(repoUrl, promptArg, options, command) {
|
|
|
1200
1213
|
};
|
|
1201
1214
|
if (options.name !== void 0) body.name = options.name;
|
|
1202
1215
|
if (options.model !== void 0) body.modelId = normalizedModel;
|
|
1216
|
+
if (slackDeliveryRequested) {
|
|
1217
|
+
body.slackTeamId = slackTeamId;
|
|
1218
|
+
body.slackChannelId = slackChannelId;
|
|
1219
|
+
}
|
|
1203
1220
|
const payload = await automationApiFetch(config, "/api/automation/schedules", {
|
|
1204
1221
|
method: "POST",
|
|
1205
1222
|
body: JSON.stringify(body)
|
|
@@ -1314,6 +1331,9 @@ function printAutomationRule(rule) {
|
|
|
1314
1331
|
console.log(`Repo: ${rule.repoOwner}/${rule.repoName}`);
|
|
1315
1332
|
console.log(`Cron: ${rule.normalizedCron}`);
|
|
1316
1333
|
if (rule.modelId) console.log(`Model: ${rule.modelId}`);
|
|
1334
|
+
if (rule.slackTeamId && rule.slackChannelId) {
|
|
1335
|
+
console.log(`Slack delivery: ${rule.slackTeamId}/${rule.slackChannelId}`);
|
|
1336
|
+
}
|
|
1317
1337
|
console.log(`Next fire: ${formatTime(rule.nextFireAt)}`);
|
|
1318
1338
|
}
|
|
1319
1339
|
function formatTime(value) {
|
|
@@ -3436,6 +3456,11 @@ async function createCommand(repoUrl, promptArg, options, command) {
|
|
|
3436
3456
|
if (promptPreview) body.prompt = promptPreview;
|
|
3437
3457
|
if (baseBranch) body.baseBranch = baseBranch;
|
|
3438
3458
|
if (startBranch) body.startBranch = startBranch;
|
|
3459
|
+
const linearIssue = options.linearIssue?.trim();
|
|
3460
|
+
if (options.linearIssue !== void 0 && !linearIssue) {
|
|
3461
|
+
throw new CliError("user", "--linear-issue must not be empty.");
|
|
3462
|
+
}
|
|
3463
|
+
if (linearIssue) body.linearIssue = linearIssue;
|
|
3439
3464
|
if (continuePr) body.continuePrUrl = continuePr;
|
|
3440
3465
|
if (continueMode) body.continueMode = continueMode;
|
|
3441
3466
|
if (options.cold) body.cold = true;
|
|
@@ -3507,6 +3532,7 @@ async function createCommand(repoUrl, promptArg, options, command) {
|
|
|
3507
3532
|
if (options.autoVerify) output.autoVerify = true;
|
|
3508
3533
|
if (baseBranch) output.baseBranch = baseBranch;
|
|
3509
3534
|
if (startBranch) output.startBranch = startBranch;
|
|
3535
|
+
if (linearIssue) output.linearIssue = linearIssue;
|
|
3510
3536
|
if (continuePr) output.continuePrUrl = continuePr;
|
|
3511
3537
|
if (continueMode) output.continueMode = continueMode;
|
|
3512
3538
|
if (options.onboarding) output.onboarding = true;
|
|
@@ -5497,7 +5523,7 @@ function addCreateOptions(cmd) {
|
|
|
5497
5523
|
return cmd.argument("<repo-url>", "Repository URL").argument("[prompt]", "Prompt to send, or '-' to read stdin").option("--model <model>", "Model to use").option("--backend <backend>", "Agent runtime backend: codex (default), claude_code, or opencode").option("--reasoning-effort <effort>", "Reasoning effort to use for models that support it").option("--auto-verify", "Opt this session into automatic QA verification after PR creation").option("--base-branch <branch>", "Base branch to create the session against (defaults to the repo default branch)").option(
|
|
5498
5524
|
"--start-branch <branch>",
|
|
5499
5525
|
"Resume an existing branch with its history instead of forking a new one off base"
|
|
5500
|
-
).option("--continue-pr <url>", "Continue from an existing same-repo pull request").option("--continue-mode <mode>", "Continuation mode: auto (default), update-pr, or new-pr").option("--prompt-stdin", "Read prompt from stdin").option(
|
|
5526
|
+
).option("--linear-issue <id|url>", "Associate the session with a Linear issue for pickup writeback").option("--continue-pr <url>", "Continue from an existing same-repo pull request").option("--continue-mode <mode>", "Continuation mode: auto (default), update-pr, or new-pr").option("--prompt-stdin", "Read prompt from stdin").option(
|
|
5501
5527
|
"--uploaded-file <path>",
|
|
5502
5528
|
"Attach a local text file to the prompt as uploadedFiles; repeat for multiple files",
|
|
5503
5529
|
collectUploadedFileOption
|
|
@@ -5739,12 +5765,16 @@ var automations = program.command("automations").description("Automation command
|
|
|
5739
5765
|
automations.command("create").description("Create a scheduled automation").argument("<repo-url>", "Repository URL").argument("[prompt]", "Prompt to run, or '-' to read stdin").requiredOption("--cron <expr>", "Cron expression").option("--name <name>", "Automation display name").option(
|
|
5740
5766
|
"--model <model>",
|
|
5741
5767
|
"Model to pin for this automation's sessions (e.g. gpt-5.5, claude-opus-4-8). Defaults to the codex backend default."
|
|
5742
|
-
).option(
|
|
5768
|
+
).option(
|
|
5769
|
+
"--slack-team-id <team-id>",
|
|
5770
|
+
"Slack workspace/team ID for final digest delivery (requires --slack-channel-id)"
|
|
5771
|
+
).option("--slack-channel-id <channel-id>", "Slack channel ID for final digest delivery (requires --slack-team-id)").option("--prompt-stdin", "Read prompt from stdin").addHelpText(
|
|
5743
5772
|
"after",
|
|
5744
5773
|
`
|
|
5745
5774
|
Examples:
|
|
5746
5775
|
arcanist automations create tryarcanist/arcanist "summarize regressions" --cron "*/15 * * * *"
|
|
5747
5776
|
arcanist automations create tryarcanist/arcanist "audit N+1s" --cron "0 13 * * 5" --model gpt-5.5
|
|
5777
|
+
arcanist automations create tryarcanist/arcanist "/audit-prod-docs https://docs.tryarcanist.com/" --cron "0 8 * * *" --slack-team-id T0123ABC --slack-channel-id C0456DEF
|
|
5748
5778
|
printf "summarize regressions" | arcanist automations create tryarcanist/arcanist --prompt-stdin --cron "*/15 * * * *" --json
|
|
5749
5779
|
`
|
|
5750
5780
|
).action((repoUrl, prompt, options, command) => createAutomationCommand(repoUrl, prompt, options, command));
|