@coderook/cli 0.36.0 → 0.38.1

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.
@@ -22,6 +22,7 @@ const node_crypto_1 = require("node:crypto");
22
22
  const node_fs_1 = require("node:fs");
23
23
  const node_path_1 = __importDefault(require("node:path"));
24
24
  const node_process_1 = __importDefault(require("node:process"));
25
+ const workspace_command_js_1 = require("./workspace_command.js");
25
26
  const api_js_1 = require("./api.js");
26
27
  const registry_js_1 = require("./registry.js");
27
28
  const help_js_1 = require("./help.js");
@@ -32,7 +33,12 @@ const build_command_js_1 = require("./build_command.js");
32
33
  const node_check_js_1 = require("./node_check.js");
33
34
  const pages_command_js_1 = require("./pages_command.js");
34
35
  const mods_command_js_1 = require("./mods_command.js");
35
- const github_bridge_js_1 = require("./github_bridge.js");
36
+ const private_command_js_1 = require("./private_command.js");
37
+ const actions_command_js_1 = require("./actions_command.js");
38
+ const issue_command_js_1 = require("./issue_command.js");
39
+ const verify_command_js_1 = require("./verify_command.js");
40
+ const community_command_js_1 = require("./community_command.js");
41
+ const pr_command_js_1 = require("./pr_command.js");
36
42
  const project_commands_js_1 = require("./project_commands.js");
37
43
  const track_commands_js_1 = require("./track_commands.js");
38
44
  const tracks_js_1 = require("../../cbx/src/core/tracks.js");
@@ -681,7 +687,7 @@ async function commandImport(parsed) {
681
687
  flags: submitFlags,
682
688
  });
683
689
  if (code === 0 && plan.temporary) {
684
- console.log(dim(`The working copy stays at ${plan.folder} until you remove it.
690
+ console.log(dim(`The working copy stays at ${plan.folder} until you remove it.
685
691
  ` +
686
692
  `Run ${accent("cbx get " + plan.name)} anywhere to fetch it fresh.`));
687
693
  }
@@ -967,17 +973,17 @@ async function commandSubmit(parsed) {
967
973
  */
968
974
  const shielded = (await (0, worktree_js_1.detectPrivateDirectories)(folder)).filter((finding) => [...sending].some((file) => file === finding.path || file.startsWith(`${finding.path}/`)));
969
975
  if (shielded.length && !hasFlag(parsed, "allow-private")) {
970
- console.log(red(`
976
+ console.log(red(`
971
977
  ${shielded.length} folder${shielded.length === 1 ? "" : "s"} here belong${shielded.length === 1 ? "s" : ""} to a program, not to your project:`));
972
978
  for (const finding of shielded) {
973
979
  console.log(` ${finding.path} ${dim(`— ${finding.because}`)}`);
974
980
  }
975
- console.log(`
981
+ console.log(`
976
982
  Nothing was sent. To leave them behind:`);
977
983
  for (const finding of shielded) {
978
984
  console.log(` ${accent(`echo "${finding.rule}" >> .gitignore`)}`);
979
985
  }
980
- console.error(`
986
+ console.error(`
981
987
  Or pass ${accent("--allow-private")} if they genuinely belong in the project.`);
982
988
  return 1;
983
989
  }
@@ -1026,7 +1032,7 @@ Or pass ${accent("--allow-private")} if they genuinely belong in the project.`);
1026
1032
  `rest were not opened.`));
1027
1033
  }
1028
1034
  if (stillPasted.length) {
1029
- console.log(red(`
1035
+ console.log(red(`
1030
1036
  ${stillPasted.length} file${stillPasted.length === 1 ? " has a credential" : "s have credentials"} inside:`));
1031
1037
  for (const finding of stillPasted.slice(0, 20)) {
1032
1038
  console.log(` ${finding.path}`);
@@ -1041,11 +1047,11 @@ ${stillPasted.length} file${stillPasted.length === 1 ? " has a credential" : "s
1041
1047
  console.log(dim(` …and ${stillPasted.length - 20} more`));
1042
1048
  }
1043
1049
  if (!hasFlag(parsed, "allow-secrets")) {
1044
- console.error(`
1050
+ console.error(`
1045
1051
  Nothing was sent. Move the key into an environment variable, and if` +
1046
1052
  ` it has ever been published, replace it at the service that issued` +
1047
1053
  ` it — a key that has leaked stays leaked.` +
1048
- `
1054
+ `
1049
1055
  Pass ${accent("--allow-secrets")} if these are not real keys.`);
1050
1056
  return 1;
1051
1057
  }
@@ -1252,7 +1258,7 @@ Pass ${accent("--allow-secrets")} if these are not real keys.`);
1252
1258
  continue;
1253
1259
  }
1254
1260
  if (failure?.kind === "interrupted") {
1255
- console.error(red(`
1261
+ console.error(red(`
1256
1262
  The connection failed: ${text}`));
1257
1263
  console.error(`Your work may already have been saved. Run the same command again —` +
1258
1264
  ` it will not create a second version.`);
@@ -1495,7 +1501,7 @@ async function commandGet(parsed) {
1495
1501
  `changed while the interrupted fetch was stopped:`));
1496
1502
  for (const file of changedInTheGap.slice(0, 20))
1497
1503
  console.error(` ${file.path}`);
1498
- console.error(`
1504
+ console.error(`
1499
1505
  Save them with ${accent("cbx submit")}, or finish the fetch and ` +
1500
1506
  `discard them with ${accent("cbx get --replace")}.`);
1501
1507
  return 1;
@@ -1778,8 +1784,8 @@ async function suggestRules(folder, apply) {
1778
1784
  const addition = (0, detect_js_1.rulesFromSuggestions)(recommended);
1779
1785
  const shared = rules.shared.trimEnd();
1780
1786
  await (0, worktree_js_1.writeRules)(folder, {
1781
- shared: shared ? `${shared}
1782
-
1787
+ shared: shared ? `${shared}
1788
+
1783
1789
  ${addition}` : addition,
1784
1790
  local: rules.local,
1785
1791
  });
@@ -1984,7 +1990,7 @@ async function commandMerges(parsed) {
1984
1990
  const counts = merge.conflicts;
1985
1991
  console.log(`${accent(merge.reference)} ${counts ? `${counts.unresolved} of ${counts.total} still to decide` : ""} ${dim(new Date(merge.createdAt).toLocaleString())}`);
1986
1992
  }
1987
- console.log(dim(`
1993
+ console.log(dim(`
1988
1994
  Run cbx merge <reference> to look at one.`));
1989
1995
  return 0;
1990
1996
  }
@@ -2087,7 +2093,7 @@ async function commandMerge(parsed) {
2087
2093
  console.log(dim(` waiting on ${waiting.map((person) => person.displayName).join(", ")}`));
2088
2094
  }
2089
2095
  }
2090
- console.log(`
2096
+ console.log(`
2091
2097
  ${accent(now.mergeTrack.reference)} · ` +
2092
2098
  /*
2093
2099
  The combined version is only counted once it can be built; until then
@@ -2106,7 +2112,7 @@ ${accent(now.mergeTrack.reference)} · ` +
2106
2112
  return 1;
2107
2113
  }
2108
2114
  const applied = await (0, api_js_1.applyMerge)(summary.id);
2109
- console.log(`
2115
+ console.log(`
2110
2116
  Applied as ${accent(`v${applied.version.sequence}`)}.`);
2111
2117
  if (applied.closedIssues?.length) {
2112
2118
  console.log(`Closed ${applied.closedIssues.map((number) => `#${number}`).join(", ")}.`);
@@ -2116,13 +2122,13 @@ Applied as ${accent(`v${applied.version.sequence}`)}.`);
2116
2122
  }
2117
2123
  const stillOpen = now.conflicts.some((conflict) => !conflict.resolvedAt);
2118
2124
  if (!decision && stillOpen) {
2119
- console.log(dim(`
2125
+ console.log(dim(`
2120
2126
  --mine keeps yours, --theirs keeps what was already saved,` +
2121
- ` --both keeps theirs and saves yours beside it, --drop removes the file.
2127
+ ` --both keeps theirs and saves yours beside it, --drop removes the file.
2122
2128
  Add --path <file> for one file, then --apply when ready.`));
2123
2129
  }
2124
2130
  else if (now.provisional.ready) {
2125
- console.log(dim(`
2131
+ console.log(dim(`
2126
2132
  Run cbx merge ${now.mergeTrack.reference} --apply to publish it.`));
2127
2133
  }
2128
2134
  return 0;
@@ -2708,6 +2714,33 @@ const SPECS = [
2708
2714
  ],
2709
2715
  run: project_commands_js_1.commandVersions,
2710
2716
  },
2717
+ {
2718
+ name: "workspace",
2719
+ group: "Your projects",
2720
+ summary: "edit, save and run a private project remotely without a checkout",
2721
+ usage: "workspace <open|list|show|read|files|search|diff|patch|save|run|logs|cancel|deploy|preview|handoff|close|recipe> <project> [workspace] [job]",
2722
+ detail: "Works on CodeRook's durable remote draft, never the current local folder. Use --data-file for structured edits or recipe configuration. Mutations need the reviewed --revision and a unique --key; reuse the same key and request when retrying. Recipes reference existing project workflows. Saving and deploying are separate operations.",
2723
+ options: [
2724
+ { flags: "--data-file <path>", description: "read an operation's JSON from this local file" },
2725
+ { flags: "--name <name>", description: "name a new workspace" },
2726
+ { flags: "--track <track>", description: "base the workspace on this project Track" },
2727
+ { flags: "--base-version <id>", description: "select a saved base version" },
2728
+ { flags: "--revision <number>", description: "the exact reviewed workspace revision" },
2729
+ { flags: "--key <operation-key>", description: "unique idempotency key; preserve it for retries" },
2730
+ { flags: "--path <path>", description: "read this project-relative file" },
2731
+ { flags: "--query <text>", description: "text to find in the remote workspace" },
2732
+ { flags: "--offset <number>", description: "continue a paginated listing, search or diff" },
2733
+ { flags: "--start-line <number>", description: "first text line to read" },
2734
+ { flags: "--lines <number>", description: "maximum text lines to read" },
2735
+ { flags: "--recipe <name>", description: "configured hosted execution recipe" },
2736
+ { flags: "--target <target>", description: "exact configured deployment target" },
2737
+ { flags: "--version <id>", description: "saved workspace version to deploy" },
2738
+ { flags: "-m, --message <text>", description: "describe the version being saved" },
2739
+ { flags: "--note <text>", description: "task context for another computer/assistant" },
2740
+ ],
2741
+ examples: ["cbx workspace open my-project --name \"Laptop work\" --key laptop-open-001", "cbx workspace list my-project"],
2742
+ run: workspace_command_js_1.commandWorkspace,
2743
+ },
2711
2744
  {
2712
2745
  name: "ai",
2713
2746
  group: "Your projects",
@@ -2795,33 +2828,29 @@ const SPECS = [
2795
2828
  run: pages_command_js_1.commandPages,
2796
2829
  },
2797
2830
  {
2798
- name: "github",
2831
+ name: "private",
2799
2832
  group: "Your projects",
2800
- summary: "review and test proposals with GitHub tools (CodeRabbit, Blacksmith, Actions)",
2801
- usage: "github <setup|sync> …",
2802
- detail: "Mirrors a project's open proposals to pull requests in a GitHub repository,\n" +
2803
- "so tools that only connect to GitHub review and build them, and reports\n" +
2804
- "what they conclude back to each proposal as checks. A required check that\n" +
2805
- "fails stops the proposal being applied, like any other check.\n\n" +
2806
- "It runs on GitHub, in a workflow setup writes into the project. CodeRook\n" +
2807
- "never holds a GitHub credential; GitHub holds a CodeRook token that reaches\n" +
2808
- "this project only and can read it and report checks, nothing else.\n\n" +
2809
- " setup <owner>/<repo> [folder] make the token, write the workflow\n" +
2810
- " sync [--repo <owner>/<repo>] mirror and report once (what the workflow runs)\n\n" +
2811
- "Use a GitHub repository nothing else pushes to: the mirror only moves\n" +
2812
- "forward, and a branch changed on GitHub is left alone and reported.",
2833
+ summary: "files and folders only the project's own people may see",
2834
+ usage: "private [list|add|remove|set] [pattern…] [--project <project>]",
2835
+ detail: "Keeps chosen files out of sight in a public project: visitors, the\n" +
2836
+ "public API, git clone, zips, Pages and search leave them out, while\n" +
2837
+ "members see everything. Patterns work like a .gitignore:\n\n" +
2838
+ " design/ a folder of that name, anywhere\n" +
2839
+ " *.psd every file of a type\n" +
2840
+ " docs/internal a path from the top of the project\n" +
2841
+ " src/**/*.key any depth in between\n\n" +
2842
+ "The list is kept on the project, not in a file, so it covers every\n" +
2843
+ "version at once, old ones included, and a save cannot undo it. Only the\n" +
2844
+ "project's owner or an admin can change it.",
2813
2845
  options: [
2814
- { flags: "--repo <owner/repo>", description: "sync: the GitHub repository (default: the one the workflow runs in)" },
2815
- { flags: "--project <slug>", description: "sync: the CodeRook project (default: this folder's)" },
2816
- { flags: "--required <names>", description: "checks that must pass, e.g. \"github/build,review/coderabbitai[bot]\"" },
2817
- { flags: "--force", description: "setup: write the workflow again" },
2846
+ { flags: "--project <project>", description: "a project other than this folder's" },
2818
2847
  ],
2819
2848
  examples: [
2820
- "cbx github setup my-name/my-game-mirror",
2821
- "cbx submit",
2822
- "cbx github sync --repo my-name/my-game-mirror",
2849
+ 'cbx private add "design/" "*.psd"',
2850
+ "cbx private list",
2851
+ 'cbx private remove "*.psd"',
2823
2852
  ],
2824
- run: github_bridge_js_1.commandGithub,
2853
+ run: private_command_js_1.commandPrivate,
2825
2854
  },
2826
2855
  {
2827
2856
  name: "mods",
@@ -2911,6 +2940,34 @@ const SPECS = [
2911
2940
  ],
2912
2941
  run: service_commands_js_1.commandIssues,
2913
2942
  },
2943
+ {
2944
+ name: "issue",
2945
+ group: "Your projects",
2946
+ summary: "read, answer, close, label or assign one issue",
2947
+ usage: "issue view|comment|close|reopen|label|assign <number> … | issue labels | issue rules",
2948
+ detail: "Closing says why: completed (the default), --reason not-planned, or\n" +
2949
+ "--duplicate-of <n>. Labels and assignment need write access; replying\n" +
2950
+ "needs only read access, as on the website.\n\n" +
2951
+ "Inside a run, CODEROOK_TOKEN and CODEROOK_PROJECT are set, so a workflow\n" +
2952
+ "can comment on or label the issue that started it with no setup.",
2953
+ options: [
2954
+ { flags: "-m, --message <text>", description: "what to say (comment, or a note when closing)" },
2955
+ { flags: "--reason <completed|not-planned>", description: "why it is closed" },
2956
+ { flags: "--duplicate-of <n>", description: "close as a duplicate of another issue" },
2957
+ { flags: "--remove", description: "take the labels off instead" },
2958
+ { flags: "--starter", description: "with labels: add the usual set" },
2959
+ { flags: "--project <name>", description: "which project" },
2960
+ ],
2961
+ examples: [
2962
+ "cbx issue view 12",
2963
+ 'cbx issue comment 12 -m "Fixed in v41"',
2964
+ "cbx issue close 12 --duplicate-of 9",
2965
+ "cbx issue label 12 bug,ui",
2966
+ "cbx issue assign 12 sam",
2967
+ "cbx issue labels --starter",
2968
+ ],
2969
+ run: issue_command_js_1.commandIssue,
2970
+ },
2914
2971
  {
2915
2972
  name: "releases",
2916
2973
  aliases: ["tags"],
@@ -2939,7 +2996,9 @@ const SPECS = [
2939
2996
  "The signing secret is generated by the service and shown once, when\n" +
2940
2997
  "the hook is added — no route hands it back afterwards.\n\n" +
2941
2998
  "Events: version.published, merge.opened, merge.applied, merge.cancelled,\n" +
2942
- "check.reported, change_request.opened, change_request.reviewed.\n" +
2999
+ "check.reported, change_request.opened, change_request.reviewed,\n" +
3000
+ "issue.opened, issue.closed, issue.reopened, issue.commented,\n" +
3001
+ "issue.labeled, run.finished, run.failed, release.published.\n" +
2943
3002
  "Naming none of them sends all of them.",
2944
3003
  options: [
2945
3004
  { flags: "--add <url>", description: "notify this address; https only" },
@@ -3189,16 +3248,96 @@ const SPECS = [
3189
3248
  options: [
3190
3249
  { flags: "--version <n>", description: "name this version instead of the newest" },
3191
3250
  { flags: "--notes <text>", description: "what changed, for the release page" },
3251
+ { flags: "--generate-notes", description: "write the notes from what changed since the last release" },
3252
+ { flags: "--draft", description: "save it as a draft: nothing is public until cbx release publish" },
3253
+ { flags: "--prerelease", description: "keep it off the default update feed" },
3254
+ { flags: "--channel <name>", description: "the update channel, like beta or nightly (stable by default)" },
3192
3255
  { flags: "--downloads <public|private>", description: "who can take what is attached, apart from the source" },
3193
3256
  ],
3194
3257
  examples: [
3195
3258
  "cbx release v1.0",
3259
+ "cbx release v2.0 --draft --generate-notes",
3260
+ "cbx release publish --version 41",
3261
+ "cbx release v2.1.0-beta.1 --prerelease --channel beta",
3196
3262
  'cbx release v1.2 --version 41 --notes "Fixes the export dialog"',
3197
3263
  "cbx release 1.4.0 --downloads public",
3198
3264
  "cbx release --downloads private --version 41",
3199
3265
  ],
3200
3266
  run: service_commands_js_1.commandRelease,
3201
3267
  },
3268
+ {
3269
+ name: "fork",
3270
+ group: "Your projects",
3271
+ summary: "your own copy of somebody's project, and offering work back",
3272
+ usage: "fork <owner/project> [--name <slug>] | fork offer [line] --title <text> | fork sync",
3273
+ detail: "A fork is a private project under your account with the original's latest\n" +
3274
+ "public version (its private files left out). Nothing is uploaded again.\n\n" +
3275
+ "Inside a fork, `cbx fork offer <line>` offers that line to the original as\n" +
3276
+ "a pull request (offered again, the same pull request moves to your newest\n" +
3277
+ "save). Its runs there wait for the project's approval and get none of its\n" +
3278
+ "secrets. `cbx fork sync` brings the original's latest into an `upstream`\n" +
3279
+ "line of your fork, to merge when you choose.",
3280
+ options: [
3281
+ { flags: "--name <slug>", description: "what to call your copy" },
3282
+ { flags: "--title <text>", description: "offer: the pull request's title" },
3283
+ { flags: "--body <text>", description: "offer: its description" },
3284
+ { flags: "--project <name>", description: "offer/sync: which fork" },
3285
+ ],
3286
+ examples: ["cbx fork sam/editor", 'cbx fork offer fix-export --title "Fix the export dialog"', "cbx fork sync"],
3287
+ run: community_command_js_1.commandFork,
3288
+ },
3289
+ {
3290
+ name: "security",
3291
+ group: "Your projects",
3292
+ summary: "report a vulnerability privately, or handle reports",
3293
+ usage: "security report <owner/project> --title <text> | security list | view|reply|mark S-<n>",
3294
+ detail: "A report is seen only by the project's owner and admins, and by whoever\n" +
3295
+ "sent it. Please use this rather than a public issue for anything that\n" +
3296
+ "could hurt people using the project.",
3297
+ options: [
3298
+ { flags: "--title <text>", description: "report: what is wrong" },
3299
+ { flags: "--body <text>", description: "report: details and how to reproduce it" },
3300
+ { flags: "--severity <level>", description: "report: low, medium, high or critical" },
3301
+ { flags: "-m, --message <text>", description: "reply: what to say" },
3302
+ { flags: "--project <name>", description: "list/view/reply/mark: which project" },
3303
+ ],
3304
+ examples: [
3305
+ 'cbx security report sam/editor --title "Path traversal in export" --severity high',
3306
+ "cbx security list",
3307
+ 'cbx security reply S-3 -m "Confirmed; fix in 2.0.1"',
3308
+ "cbx security mark S-3 fixed",
3309
+ ],
3310
+ run: community_command_js_1.commandSecurity,
3311
+ },
3312
+ {
3313
+ name: "verify",
3314
+ group: "Your projects",
3315
+ summary: "check a download against its release's signed manifest",
3316
+ usage: "verify <owner/project> <release> <file…>",
3317
+ detail: "Every public release has a manifest listing each file with its size and\n" +
3318
+ "SHA-256, signed with CodeRook's release key. This checks the signature,\n" +
3319
+ "then the files you downloaded. A mismatch means do not run it.",
3320
+ options: [{ flags: "--key <base64>", description: "pin the release key instead of the one cbx knows" }],
3321
+ examples: ["cbx verify sam/editor v2.0.0 ./editor-setup.exe"],
3322
+ run: verify_command_js_1.commandVerify,
3323
+ },
3324
+ {
3325
+ name: "deps",
3326
+ group: "Your projects",
3327
+ summary: "known vulnerabilities in a save's dependencies",
3328
+ usage: "deps [version]",
3329
+ detail: "Reads the lockfiles in the save (package-lock.json, yarn.lock,\n" +
3330
+ "requirements.txt, poetry.lock, Pipfile.lock, Cargo.lock, go.sum,\n" +
3331
+ "composer.lock, Gemfile.lock) and asks OSV about every pinned version.\n" +
3332
+ "Only names and versions are sent, never code. Pull requests carry the\n" +
3333
+ "same answer as the coderook/dependencies check.",
3334
+ options: [
3335
+ { flags: "--fresh", description: "ask OSV again rather than reading the kept report" },
3336
+ { flags: "--project <name>", description: "which project" },
3337
+ ],
3338
+ examples: ["cbx deps", "cbx deps 41 --fresh"],
3339
+ run: verify_command_js_1.commandDeps,
3340
+ },
3202
3341
  {
3203
3342
  name: "actions",
3204
3343
  aliases: ["workflows"],
@@ -3211,7 +3350,10 @@ const SPECS = [
3211
3350
  "ran against, so a passing build becomes a download without anybody\n" +
3212
3351
  "opening the website. --ship turns that on for one action.\n\n" +
3213
3352
  "Attaching is publishing: what an action ships onto a public version\n" +
3214
- "is a download anybody can take, from the moment the run passes.",
3353
+ "is a download anybody can take, from the moment the run passes.\n\n" +
3354
+ "cbx actions check [files…] checks workflow files (.rook/workflows)\n" +
3355
+ "before you save them. cbx actions set <action> changes one made on the\n" +
3356
+ "website: --schedule, --timeout, --approval, --concurrency.",
3215
3357
  options: [
3216
3358
  { flags: "--ship <action>", description: "its builds become downloads on the version" },
3217
3359
  { flags: "--no-ship <action>", description: "keep its files without attaching them" },
@@ -3219,15 +3361,123 @@ const SPECS = [
3219
3361
  { flags: "--on-proposal <action>", description: "run it on proposals; its result becomes a check" },
3220
3362
  { flags: "--by-hand <action>", description: "run it only when somebody starts it" },
3221
3363
  { flags: "--project <name>", description: "which project" },
3364
+ { flags: "--schedule <cron>", description: "with set: run it on a schedule (UTC); off to stop" },
3365
+ { flags: "--timeout <minutes>", description: "with set: stop a run that takes longer; off to stop" },
3366
+ { flags: "--approval <on|off>", description: "with set: each run waits for somebody to approve it" },
3367
+ { flags: "--concurrency <group>", description: "with set: one run of the group at a time; off to stop" },
3368
+ { flags: "--cancel-old", description: "with set: a new run cancels the group's older ones" },
3369
+ { flags: "--keep-old", description: "with set: a new run waits its turn" },
3222
3370
  ],
3223
3371
  examples: [
3224
3372
  "cbx actions",
3373
+ "cbx actions check",
3374
+ 'cbx actions set "Nightly" --schedule "0 3 * * *" --timeout 30',
3375
+ 'cbx actions set Deploy --approval on --concurrency deploy --cancel-old',
3225
3376
  'cbx actions --ship "Windows installer"',
3226
3377
  'cbx actions --no-ship "Windows installer"',
3227
3378
  'cbx actions --on-proposal Tests',
3228
3379
  ],
3229
3380
  run: service_commands_js_1.commandWorkflows,
3230
3381
  },
3382
+ {
3383
+ name: "pr",
3384
+ group: "Working with a folder",
3385
+ summary: "pull requests: list, read, review, comment, merge",
3386
+ usage: "pr <list|view|files|comment|approve|request-changes|ask|label|title|ready|draft|retarget|close|reopen|merge> [M-3] …",
3387
+ detail: "A pull request is a line offered to another line (cbx propose opens one).\n" +
3388
+ "This is the Pull requests tab of the website, from here:\n\n" +
3389
+ " list [--all|--state merged] [--mine] [--label bug] the project's pull requests\n" +
3390
+ " view M-3 description, reviews, checks, conversation, blockers\n" +
3391
+ " files M-3 what it changes\n" +
3392
+ " comment M-3 -m \"…\" [--line path:12] a comment, or one on a line\n" +
3393
+ " approve M-3 [-m \"…\"] approve it\n" +
3394
+ " request-changes M-3 -m \"…\" ask for changes\n" +
3395
+ " ask M-3 sam,priya ask people to review it\n" +
3396
+ " label M-3 bug,ui set its labels\n" +
3397
+ " title M-3 \"New title\" rename it\n" +
3398
+ " ready M-3 | draft M-3 ready for review, or back to draft\n" +
3399
+ " retarget M-3 release land it on another line\n" +
3400
+ " close M-3 | reopen M-3 close without merging, or reopen\n" +
3401
+ " merge M-3 merge it, once nothing stands in the way\n\n" +
3402
+ "An approval stops counting when new saves land on the line: it was of the\n" +
3403
+ "code somebody looked at. A draft cannot be merged until it is marked ready.",
3404
+ options: [
3405
+ { flags: "-m, --message <text>", description: "comment, review or title text" },
3406
+ { flags: "--line <path:line>", description: "comment: on this line of a changed file" },
3407
+ { flags: "--project <project>", description: "a project other than this folder's" },
3408
+ { flags: "--state <state>", description: "list: open, merged, closed or all" },
3409
+ { flags: "--label <name>", description: "list: only those with this label" },
3410
+ { flags: "--author <username>", description: "list: only those opened by this person" },
3411
+ { flags: "--all", description: "list: every state" },
3412
+ { flags: "--mine", description: "list: only those waiting on your review" },
3413
+ { flags: "--squash", description: "merge / auto-merge: land as one save, without the line's own saves" },
3414
+ { flags: "--off", description: "auto-merge: stop waiting to merge by itself" },
3415
+ ],
3416
+ examples: [
3417
+ "cbx pr list",
3418
+ "cbx pr view M-3",
3419
+ 'cbx pr comment M-3 --line src/app.ts:42 -m "This can be null"',
3420
+ "cbx pr approve M-3",
3421
+ "cbx pr merge M-3",
3422
+ "cbx pr merge M-3 --squash",
3423
+ "cbx pr auto-merge M-3",
3424
+ ],
3425
+ run: pr_command_js_1.commandPr,
3426
+ },
3427
+ {
3428
+ name: "cancel",
3429
+ group: "Actions",
3430
+ summary: "stop a run that is waiting or working",
3431
+ usage: "cancel <number> [project]",
3432
+ detail: "Marks the run cancelled at once. A runner working on it is told at its next\n" +
3433
+ "heartbeat and stops the work, including anything the command started.",
3434
+ examples: ["cbx cancel 12"],
3435
+ run: service_commands_js_1.commandCancel,
3436
+ },
3437
+ {
3438
+ name: "rerun",
3439
+ group: "Actions",
3440
+ summary: "run a finished run again",
3441
+ usage: "rerun <number> [project]",
3442
+ detail: "Queues the same action against the same save. When the run was checking a\n" +
3443
+ "pull request that is still open, its check goes back to waiting.",
3444
+ examples: ["cbx rerun 12"],
3445
+ run: service_commands_js_1.commandRerun,
3446
+ },
3447
+ {
3448
+ name: "approve",
3449
+ group: "Actions",
3450
+ summary: "let a run that waits for approval start",
3451
+ usage: "approve <number> [project]",
3452
+ detail: "An action marked as needing approval (often one that publishes) waits\n" +
3453
+ "after it is set off until somebody who can change the project approves it.",
3454
+ examples: ["cbx approve 12"],
3455
+ run: actions_command_js_1.commandApprove,
3456
+ },
3457
+ {
3458
+ name: "secret",
3459
+ aliases: ["secrets"],
3460
+ group: "Actions",
3461
+ summary: "values runs need that must not be in the files",
3462
+ usage: "secret list | set <NAME> | remove <NAME>",
3463
+ detail: "A secret is handed to each run as an environment variable of the same\n" +
3464
+ "name, but only to runs started by people who can change the project.\n" +
3465
+ "Run logs show *** in its place. Its value is never shown again.\n\n" +
3466
+ "The value is read from what is piped in, from another variable with\n" +
3467
+ "--from-env, or typed at a hidden prompt; never from an argument, which\n" +
3468
+ "would stay in your shell history.",
3469
+ options: [
3470
+ { flags: "--from-env <VAR>", description: "take the value from this environment variable" },
3471
+ { flags: "--project <name>", description: "which project" },
3472
+ ],
3473
+ examples: [
3474
+ "cbx secret list",
3475
+ "cbx secret set DEPLOY_TOKEN",
3476
+ "cbx secret set SIGNING_KEY < key.pem",
3477
+ "cbx secret remove DEPLOY_TOKEN",
3478
+ ],
3479
+ run: actions_command_js_1.commandSecret,
3480
+ },
3231
3481
  {
3232
3482
  name: "runs",
3233
3483
  group: "Actions",
@@ -3254,6 +3504,7 @@ const SPECS = [
3254
3504
  "stderr is shown in red. Exits 1 when the run failed, so this can be\n" +
3255
3505
  "the last line of a script.",
3256
3506
  examples: ["cbx logs 12", "cbx logs #12 my-project"],
3507
+ options: [{ flags: "--follow", description: "keep printing as it runs, until it ends" }],
3257
3508
  run: service_commands_js_1.commandLogs,
3258
3509
  },
3259
3510
  {
@@ -3447,7 +3698,8 @@ const SPECS = [
3447
3698
  name: "mcp",
3448
3699
  group: "Other",
3449
3700
  summary: "serve CodeRook to Claude Code, Codex and other assistants",
3450
- usage: "mcp",
3701
+ usage: "mcp [--workspaces]",
3702
+ options: [{ flags: "--workspaces", description: "opt into the remote connector's write/run/deploy tools and workspace permissions" }],
3451
3703
  detail: "Speaks the Model Context Protocol on stdin and stdout, so an assistant\n" +
3452
3704
  "can look at your projects while it works. Not run by hand — point the\n" +
3453
3705
  "assistant at it and it starts and stops the process itself.\n" +
@@ -3468,7 +3720,7 @@ const SPECS = [
3468
3720
  "A project whose owner has turned off machine reading is refused, in\n" +
3469
3721
  "words rather than as a status code.\n",
3470
3722
  examples: ["claude mcp add coderook -- cbx mcp"],
3471
- run: () => (0, mcp_js_1.commandMcp)(version_js_1.VERSION),
3723
+ run: parsed => parsed.flags.has("workspaces") ? (0, workspace_command_js_1.commandWorkspaceMcp)() : (0, mcp_js_1.commandMcp)(version_js_1.VERSION),
3472
3724
  },
3473
3725
  {
3474
3726
  name: "doctor",
@@ -3511,6 +3763,7 @@ SPECS.push({
3511
3763
  "a command of your own, describe the build in coderook.build.json\n" +
3512
3764
  "(cbx build init writes one), which is saved with the project.",
3513
3765
  options: [
3766
+ { flags: "--docker", description: "allow a Docker container as a last resort (never used otherwise)" },
3514
3767
  { flags: "-t, --target <list>", description: "windows-x64, linux-arm64, macos-arm64 … or win, linux, mac, all" },
3515
3768
  { flags: "--plan", description: "say how each target would be built, build nothing" },
3516
3769
  { flags: "--preset <name>", description: "go, bun, deno, rust, dotnet, electron, pyinstaller, python or custom" },