@coderook/cli 0.40.0 → 0.41.0

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.
@@ -2,7 +2,7 @@
2
2
  "name": "coderook",
3
3
  "displayName": "CodeRook",
4
4
  "description": "Save, browse and restore whole-snapshot versions of a project on CodeRook, with cbx or plain git, from Claude Code.",
5
- "version": "0.40.0",
5
+ "version": "0.41.0",
6
6
  "author": {
7
7
  "name": "ACCA Gaming Productions",
8
8
  "url": "https://coderook.com"
@@ -2866,6 +2866,30 @@ const SPECS = [
2866
2866
  ],
2867
2867
  run: settings_commands_js_1.commandAbout,
2868
2868
  },
2869
+ {
2870
+ /* Settings → General → Features: which parts a project has, and who sees each. */
2871
+ name: "features",
2872
+ group: "Project settings",
2873
+ summary: "which parts a project has, and who sees each",
2874
+ usage: "features [project] [--issues <choice>] [--pulls <choice>] [--actions <choice>] [--analytics <choice>] [--collaborators <choice>] [--storage <choice>]",
2875
+ brief: "features [project]",
2876
+ detail: "Shows each part of the project and who sees it, and changes them.\n" +
2877
+ "A choice is off (the tab goes for everybody), members (the project's\n" +
2878
+ "own people) or everyone (visitors to a public project too: they read\n" +
2879
+ "issues, pull requests and runs, and anyone signed in can open issues\n" +
2880
+ "and comment). Storage is never everyone's: it is your account's quota.",
2881
+ options: [
2882
+ { flags: "--issues <choice>", description: "off, members or everyone" },
2883
+ { flags: "--pulls <choice>", description: "pull requests: off, members or everyone" },
2884
+ { flags: "--actions <choice>", description: "runs and their logs: off, members or everyone" },
2885
+ { flags: "--analytics <choice>", description: "off, members or everyone" },
2886
+ { flags: "--collaborators <choice>", description: "who works on it: off, members or everyone" },
2887
+ { flags: "--storage <choice>", description: "off or members" },
2888
+ { flags: "--project <name>", description: "a project other than this folder's" },
2889
+ ],
2890
+ examples: ["cbx features", "cbx features --issues everyone --pulls everyone", "cbx features my-project --analytics off"],
2891
+ run: settings_commands_js_1.commandFeatures,
2892
+ },
2869
2893
  {
2870
2894
  /*
2871
2895
  Beside `cbx tracks` rather than inside it. That lists where somebody can
@@ -43,7 +43,7 @@ exports.LISTING_ORDER = [
43
43
  "tracks", "line-rules", "merges", "merge", "propose", "proposals", "pr",
44
44
  "versions", "mark", "notes", "labels", "promote", "release", "releases", "attach", "held", "review", "undo",
45
45
  "take-down", "verify", "deps",
46
- "about", "visibility", "ai", "private", "upload-rules", "people", "watch", "hooks", "secret", "assistant",
46
+ "about", "features", "visibility", "ai", "private", "upload-rules", "people", "watch", "hooks", "secret", "assistant",
47
47
  "security", "pages", "fork", "hand-over", "delete",
48
48
  "issues", "issue",
49
49
  "actions", "runs", "logs", "cancel", "rerun", "approve", "runner", "build", "machines",
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.onOff = onOff;
7
7
  exports.commandAbout = commandAbout;
8
+ exports.commandFeatures = commandFeatures;
8
9
  exports.commandLineRules = commandLineRules;
9
10
  exports.commandUploadRules = commandUploadRules;
10
11
  exports.commandAssistant = commandAssistant;
@@ -13,6 +14,7 @@ exports.commandHandOver = commandHandOver;
13
14
  * The rest of a project's Settings, from a terminal.
14
15
  *
15
16
  * cbx about [project] [--name …] [--description …] General: name, description, address
17
+ * cbx features [project] [--issues everyone] … General: which parts, and who sees each
16
18
  * cbx line-rules [line] [--protect] [--approvals n] … Lines & reviews, per line
17
19
  * cbx upload-rules [--ignore file] [--encrypt off] … Files & privacy: encrypted upload rules
18
20
  * cbx assistant [manual|automated] [--review on] … Automation: the pull-request assistant
@@ -111,6 +113,68 @@ async function commandAbout(parsed) {
111
113
  }
112
114
  return 0;
113
115
  }
116
+ /* --------------------------------------------------------------- features -- */
117
+ const FEATURE_FLAGS = [
118
+ ["issues", "Issues"],
119
+ ["pulls", "Pull requests"],
120
+ ["actions", "Actions"],
121
+ ["analytics", "Analytics"],
122
+ ["collaborators", "Collaborators"],
123
+ ["storage", "Storage"],
124
+ ];
125
+ /** What a choice means for visitors, said beside it. */
126
+ function describeChoice(choice) {
127
+ return choice === "everyone" ? (0, colour_js_1.green)("everyone") : choice === "members" ? "members" : (0, colour_js_1.dim)("off");
128
+ }
129
+ /**
130
+ * General → Features: which parts a project has, and who sees each. Off takes
131
+ * the tab away for everybody; members keeps it for the project's people;
132
+ * everyone shows it to visitors of a public project too. Storage is never
133
+ * everyone's.
134
+ */
135
+ async function commandFeatures(parsed) {
136
+ const project = await (0, project_commands_js_1.resolveProject)(parsed.positional[0] ?? flagText(parsed, "project"));
137
+ if (!project)
138
+ return 1;
139
+ const change = {};
140
+ for (const [flag, label] of FEATURE_FLAGS) {
141
+ if (!parsed.flags.has(flag))
142
+ continue;
143
+ const given = (flagText(parsed, flag) ?? "").trim().toLowerCase();
144
+ const choice = given === "on" ? "members" : given;
145
+ if (choice !== "off" && choice !== "members" && choice !== "everyone") {
146
+ console.error((0, colour_js_1.red)(`--${flag} is off, members or everyone.`));
147
+ return 1;
148
+ }
149
+ if (flag === "storage" && choice === "everyone") {
150
+ console.error((0, colour_js_1.red)(`${label} is your account's quota, so it is never shown to visitors.`));
151
+ return 1;
152
+ }
153
+ change[flag] = choice;
154
+ }
155
+ const found = Object.keys(change).length
156
+ ? await (0, api_js_1.callApi)(`${repositoryRoute(project.id)}/features`, {
157
+ method: "PUT",
158
+ body: change,
159
+ })
160
+ : await (0, api_js_1.callApi)(`${repositoryRoute(project.id)}/features`);
161
+ if (Object.keys(change).length) {
162
+ console.log((0, colour_js_1.green)(`Saved what ${project.name} shows.`));
163
+ console.log("");
164
+ }
165
+ for (const [flag, label] of FEATURE_FLAGS) {
166
+ console.log(` ${(0, colour_js_1.dim)(label.padEnd(15))} ${describeChoice(found.access?.[flag] ?? "members")}`);
167
+ }
168
+ if (project.visibility !== "public" && Object.values(found.access ?? {}).includes("everyone")) {
169
+ console.log("");
170
+ console.log((0, colour_js_1.dim)(" Visitors see the parts set to everyone once the project is public."));
171
+ }
172
+ if (!Object.keys(change).length) {
173
+ console.log("");
174
+ console.log((0, colour_js_1.dim)(" Change them: cbx features --issues everyone --actions members --analytics off"));
175
+ }
176
+ return 0;
177
+ }
114
178
  function describeLine(line) {
115
179
  const rules = [
116
180
  line.protected ? (0, colour_js_1.green)("protected") : (0, colour_js_1.dim)("not protected"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coderook/cli",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "description": "The command line for CodeRook (coderook.com): version control and project hosting for projects of any size. Every save is a compressed snapshot, private or public, never used to train AI.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://coderook.com",