coding-friend-cli 1.36.1 → 1.36.3

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.
@@ -80,7 +80,9 @@ var ConfigSchema = z.strictObject({
80
80
  review: ReviewConfigSchema.optional(),
81
81
  autoApprove: z.boolean().optional(),
82
82
  autoApproveIgnore: z.array(z.string()).optional(),
83
- autoApproveAllowExtra: z.array(z.string()).optional()
83
+ autoApproveAllowExtra: z.array(z.string()).optional(),
84
+ disableGUIPlan: z.boolean().optional(),
85
+ guiPlanFormat: z.enum(["html", "md"]).optional()
84
86
  });
85
87
  var KNOWN_KEYS = [
86
88
  "language",
@@ -92,7 +94,9 @@ var KNOWN_KEYS = [
92
94
  "review",
93
95
  "autoApprove",
94
96
  "autoApproveIgnore",
95
- "autoApproveAllowExtra"
97
+ "autoApproveAllowExtra",
98
+ "disableGUIPlan",
99
+ "guiPlanFormat"
96
100
  ];
97
101
  function suggestKey(unknown) {
98
102
  let best = null;
@@ -249,7 +249,7 @@ async function updateCommand(opts) {
249
249
  }
250
250
  }
251
251
  if (doCli) {
252
- const { refreshMemoryAfterUpdate } = await import("./memory-5U6GGTVI.js");
252
+ const { refreshMemoryAfterUpdate } = await import("./memory-XINRMEWB.js");
253
253
  await refreshMemoryAfterUpdate();
254
254
  }
255
255
  if (doStatusline) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeMemoryMcpEntry
3
- } from "./chunk-2MOPHSMC.js";
3
+ } from "./chunk-VV2U7NDN.js";
4
4
  import {
5
5
  readJson
6
6
  } from "./chunk-5UVDWG5L.js";
@@ -2,16 +2,16 @@ import {
2
2
  checkMemoryMcpHealth,
3
3
  printHealthSection,
4
4
  warnStaleMcpJson
5
- } from "./chunk-HILXDUVZ.js";
5
+ } from "./chunk-MAGBNYZK.js";
6
6
  import {
7
7
  getMemoryMcpStatus,
8
8
  memoryConfigMenu,
9
9
  writeMemoryMcpEntry
10
- } from "./chunk-2MOPHSMC.js";
10
+ } from "./chunk-VV2U7NDN.js";
11
11
  import {
12
12
  loadConfig,
13
13
  resolveMemoryDir
14
- } from "./chunk-YOXXIXMQ.js";
14
+ } from "./chunk-CDTQL4FI.js";
15
15
  import {
16
16
  getLibPath
17
17
  } from "./chunk-RZRT7NGT.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveMemoryDir
3
- } from "./chunk-YOXXIXMQ.js";
3
+ } from "./chunk-CDTQL4FI.js";
4
4
  import {
5
5
  getLibPath
6
6
  } from "./chunk-RZRT7NGT.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loadConfig,
3
3
  resolveMemoryDir
4
- } from "./chunk-YOXXIXMQ.js";
4
+ } from "./chunk-CDTQL4FI.js";
5
5
  import "./chunk-57EGAXYI.js";
6
6
  import "./chunk-5UVDWG5L.js";
7
7
  import {
@@ -11,10 +11,10 @@ import {
11
11
  } from "./chunk-YIXAQ4R2.js";
12
12
  import {
13
13
  memoryConfigMenu
14
- } from "./chunk-2MOPHSMC.js";
14
+ } from "./chunk-VV2U7NDN.js";
15
15
  import {
16
16
  resolveLearnDir
17
- } from "./chunk-YOXXIXMQ.js";
17
+ } from "./chunk-CDTQL4FI.js";
18
18
  import "./chunk-RZRT7NGT.js";
19
19
  import {
20
20
  findStatuslineHookPath,
@@ -145,7 +145,7 @@ async function editLearnOutputDir(globalCfg) {
145
145
  const locationChoices = [];
146
146
  if (hasDistinctCurrent) {
147
147
  locationChoices.push({
148
- name: `Keep current (${oldOutputDir})`,
148
+ name: `Keep global (${oldOutputDir})`,
149
149
  value: "current"
150
150
  });
151
151
  }
@@ -256,14 +256,15 @@ async function editLearnLanguage(globalCfg) {
256
256
  }
257
257
  async function editLearnCategories(globalCfg) {
258
258
  const existingCats = globalCfg?.learn?.categories;
259
- const defaultNames = DEFAULT_CONFIG.learn.categories.map((c) => c.name).join(", ");
259
+ const defaultCats = DEFAULT_CONFIG.learn.categories;
260
+ const defaultNames = defaultCats.map((c) => c.name).join(", ");
260
261
  const catChoices = [
261
262
  { name: `Use defaults (${defaultNames})`, value: "defaults" }
262
263
  ];
263
- if (existingCats && existingCats.length > 0) {
264
+ if (existingCats && existingCats.length > 0 && JSON.stringify(existingCats) !== JSON.stringify(defaultCats)) {
264
265
  const existingNames = existingCats.map((c) => c.name).join(", ");
265
266
  catChoices.push({
266
- name: `Keep current (${existingNames})`,
267
+ name: `Keep global (${existingNames})`,
267
268
  value: "existing"
268
269
  });
269
270
  }
@@ -278,7 +279,7 @@ async function editLearnCategories(globalCfg) {
278
279
  } else if (catChoice === "custom") {
279
280
  console.log();
280
281
  if (existingCats && existingCats.length > 0) {
281
- console.log("Current categories:");
282
+ console.log("Global categories:");
282
283
  for (const c of existingCats) {
283
284
  log.dim(` ${c.name}: ${c.description}`);
284
285
  }
@@ -375,6 +376,7 @@ async function learnSubMenu() {
375
376
  const langVal = globalCfg?.learn?.language;
376
377
  const autoCommitVal = globalCfg?.learn?.autoCommit;
377
378
  const readmeVal = globalCfg?.learn?.readmeIndex;
379
+ const catsVal = (globalCfg?.learn?.categories ?? DEFAULT_CONFIG.learn.categories).map((c) => c.name).join(", ");
378
380
  const isDisabled = globalCfg?.learn?.disabled ?? false;
379
381
  const disabledLabel = isDisabled ? chalk.yellow(" [disabled]") : "";
380
382
  const choice = await select({
@@ -390,7 +392,7 @@ async function learnSubMenu() {
390
392
  value: "language"
391
393
  },
392
394
  {
393
- name: "Categories",
395
+ name: `Categories (${catsVal})`,
394
396
  value: "categories"
395
397
  },
396
398
  {
@@ -432,6 +434,85 @@ async function learnSubMenu() {
432
434
  }
433
435
  }
434
436
  }
437
+ async function editDisableGUIPlan(globalCfg, localCfg) {
438
+ const currentValue = getMergedValue("disableGUIPlan", globalCfg, localCfg);
439
+ if (currentValue !== void 0) {
440
+ log.dim(`Current: ${currentValue}`);
441
+ }
442
+ const value = await confirm({
443
+ message: "Disable the human overview doc that /cf-plan generates alongside the agent plan?",
444
+ default: currentValue ?? false
445
+ });
446
+ const scope = await askScope();
447
+ if (scope === "back") return;
448
+ writeToScope(scope, { disableGUIPlan: value });
449
+ }
450
+ async function editGuiPlanFormat(globalCfg, localCfg) {
451
+ const currentValue = getMergedValue(
452
+ "guiPlanFormat",
453
+ globalCfg,
454
+ localCfg
455
+ );
456
+ if (currentValue !== void 0) {
457
+ log.dim(`Current: ${currentValue}`);
458
+ }
459
+ const choice = await select({
460
+ message: "Format for the /cf-plan human overview doc?",
461
+ choices: injectBackChoice(
462
+ [
463
+ { name: "HTML", value: "html" },
464
+ { name: "Markdown", value: "md" }
465
+ ],
466
+ "Back"
467
+ ),
468
+ default: currentValue ?? "html"
469
+ });
470
+ if (choice === BACK) return;
471
+ const scope = await askScope();
472
+ if (scope === "back") return;
473
+ writeToScope(scope, { guiPlanFormat: choice });
474
+ }
475
+ async function planDocsSubMenu() {
476
+ while (true) {
477
+ const globalCfg = readJson(globalConfigPath());
478
+ const localCfg = readJson(localConfigPath());
479
+ const disableVal = getMergedValue(
480
+ "disableGUIPlan",
481
+ globalCfg,
482
+ localCfg
483
+ );
484
+ const formatVal = getMergedValue(
485
+ "guiPlanFormat",
486
+ globalCfg,
487
+ localCfg
488
+ );
489
+ const choice = await select({
490
+ message: "Plan docs settings:",
491
+ choices: injectBackChoice(
492
+ [
493
+ {
494
+ name: `Disable overview doc (${disableVal ?? false})`,
495
+ value: "disableGUIPlan"
496
+ },
497
+ {
498
+ name: `Format (${formatVal ?? "html"})`,
499
+ value: "guiPlanFormat"
500
+ }
501
+ ],
502
+ "Back"
503
+ )
504
+ });
505
+ if (choice === BACK) return;
506
+ switch (choice) {
507
+ case "disableGUIPlan":
508
+ await editDisableGUIPlan(globalCfg, localCfg);
509
+ break;
510
+ case "guiPlanFormat":
511
+ await editGuiPlanFormat(globalCfg, localCfg);
512
+ break;
513
+ }
514
+ }
515
+ }
435
516
  async function editTdd(globalCfg, localCfg) {
436
517
  const currentValue = getMergedValue("tdd", globalCfg, localCfg);
437
518
  if (currentValue !== void 0) {
@@ -705,6 +786,7 @@ async function configCommand() {
705
786
  );
706
787
  const reviewScope = getScopeLabel("review", globalCfg, localCfg);
707
788
  const withCodexVal = getMergedValue("review", globalCfg, localCfg)?.withCodex;
789
+ const planDocsScope = getScopeLabel("disableGUIPlan", globalCfg, localCfg);
708
790
  const statuslineStatus = isStatuslineConfigured() ? chalk.green("configured") : chalk.yellow("not configured");
709
791
  const completionStatus = hasShellCompletion() ? chalk.green("installed") : chalk.yellow("not installed");
710
792
  const projectRules = getExistingRules(claudeLocalSettingsPath());
@@ -755,6 +837,11 @@ async function configCommand() {
755
837
  value: "review",
756
838
  description: " Run a Codex second-opinion review alongside Claude's on every /cf-review"
757
839
  },
840
+ {
841
+ name: `Plan docs ${formatScopeLabel(planDocsScope)}`,
842
+ value: "planDocs",
843
+ description: " Human overview doc generated by /cf-plan \u2014 enable/disable + format (html/md)"
844
+ },
758
845
  {
759
846
  name: `Statusline (${statuslineStatus})`,
760
847
  value: "statusline",
@@ -804,6 +891,9 @@ async function configCommand() {
804
891
  case "review":
805
892
  await editReviewWithCodex(globalCfg, localCfg);
806
893
  break;
894
+ case "planDocs":
895
+ await planDocsSubMenu();
896
+ break;
807
897
  case "statusline":
808
898
  await editStatusline();
809
899
  break;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveLearnDir
3
- } from "./chunk-YOXXIXMQ.js";
3
+ } from "./chunk-CDTQL4FI.js";
4
4
  import {
5
5
  getLibPath
6
6
  } from "./chunk-RZRT7NGT.js";
package/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ installedPluginsPath
4
+ } from "./chunk-X2H7JJMR.js";
2
5
 
3
6
  // src/index.ts
4
7
  import { Command } from "commander";
@@ -9,12 +12,38 @@ var __dirname = dirname(fileURLToPath(import.meta.url));
9
12
  var pkg = JSON.parse(
10
13
  readFileSync(join(__dirname, "..", "package.json"), "utf-8")
11
14
  );
15
+ function getInstalledPluginVersion() {
16
+ try {
17
+ const data = JSON.parse(readFileSync(installedPluginsPath(), "utf-8"));
18
+ const plugins = data.plugins ?? data;
19
+ for (const [key, value] of Object.entries(plugins)) {
20
+ if (!key.includes("coding-friend")) continue;
21
+ if (Array.isArray(value) && value.length > 0) {
22
+ const entry = value[0];
23
+ if (typeof entry.version === "string") return entry.version;
24
+ }
25
+ if (typeof value === "object" && value !== null && "version" in value) {
26
+ return value.version;
27
+ }
28
+ }
29
+ } catch {
30
+ }
31
+ return null;
32
+ }
33
+ function buildVersionString() {
34
+ const pluginVersion = getInstalledPluginVersion();
35
+ return [
36
+ `CLI ${pkg.version}`,
37
+ `plugin ${pluginVersion ?? "(not installed)"}`
38
+ ].join("\n");
39
+ }
40
+ var wantsVersion = process.argv.includes("-v") || process.argv.includes("--version");
12
41
  var program = new Command();
13
42
  program.name("cf").description(
14
43
  "coding-friend CLI \u2014 host learning docs, setup MCP, init projects"
15
- ).version(pkg.version, "-v, --version");
44
+ ).version(wantsVersion ? buildVersionString() : pkg.version, "-v, --version");
16
45
  program.command("install").description("Install the Coding Friend plugin into Claude Code").option("--user", "Install at user scope (all projects)").option("--global", "Install at user scope (all projects)").option("--project", "Install at project scope (shared via git)").option("--local", "Install at local scope (this machine only)").action(async (opts) => {
17
- const { installCommand } = await import("./install-H5VELYYZ.js");
46
+ const { installCommand } = await import("./install-VFMO45SP.js");
18
47
  await installCommand(opts);
19
48
  });
20
49
  program.command("uninstall").description("Uninstall the Coding Friend plugin from Claude Code").option("--user", "Uninstall from user scope (all projects)").option("--global", "Uninstall from user scope (all projects)").option("--project", "Uninstall from project scope").option("--local", "Uninstall from local scope").action(async (opts) => {
@@ -30,11 +59,11 @@ program.command("enable").description("Re-enable the Coding Friend plugin").opti
30
59
  await enableCommand(opts);
31
60
  });
32
61
  program.command("init").description("Initialize coding-friend in current project").action(async () => {
33
- const { initCommand } = await import("./init-ZEGE7T5H.js");
62
+ const { initCommand } = await import("./init-M5JJP5YO.js");
34
63
  await initCommand();
35
64
  });
36
65
  program.command("config").description("Manage Coding Friend configuration").action(async () => {
37
- const { configCommand } = await import("./config-NG46PYON.js");
66
+ const { configCommand } = await import("./config-B2P7TXL4.js");
38
67
  await configCommand();
39
68
  });
40
69
  var learn = program.command("learn").description("Manage learning docs \u2014 host as a website or push to git");
@@ -46,19 +75,19 @@ Learn subcommands:
46
75
  learn push [path] Commit and push learning docs (only if learn dir is the git root)`
47
76
  );
48
77
  learn.command("host").description("Build and serve learning docs as a static website").argument("[path]", "path to docs folder").option("-p, --port <port>", "port number", "3333").action(async (path, opts) => {
49
- const { hostCommand } = await import("./host-SN27RONR.js");
78
+ const { hostCommand } = await import("./host-PEKK7OOC.js");
50
79
  await hostCommand(path, opts);
51
80
  });
52
81
  learn.command("push").description("Commit and push learning docs to origin").argument("[path]", "path to docs folder").action(async (path) => {
53
- const { learnPushCommand } = await import("./learn-27FL56ZT.js");
82
+ const { learnPushCommand } = await import("./learn-QQ7XEHDY.js");
54
83
  await learnPushCommand(path);
55
84
  });
56
85
  program.command("host", { hidden: true }).argument("[path]", "path to docs folder").option("-p, --port <port>", "port number", "3333").action(async (path, opts) => {
57
- const { hostCommand } = await import("./host-SN27RONR.js");
86
+ const { hostCommand } = await import("./host-PEKK7OOC.js");
58
87
  await hostCommand(path, opts);
59
88
  });
60
89
  program.command("mcp").description("Setup MCP server for learning docs").action(async () => {
61
- const { mcpCommand } = await import("./mcp-4ODYPJ4N.js");
90
+ const { mcpCommand } = await import("./mcp-372LGOZJ.js");
62
91
  await mcpCommand();
63
92
  });
64
93
  program.command("mcp-serve").description("Start the cf-memory MCP server (used internally by npx)").argument("<memoryDir>", "path to memory directory").action(async (memoryDir) => {
@@ -81,15 +110,15 @@ program.command("statusline").description("Setup coding-friend statusline in Cla
81
110
  await statuslineCommand();
82
111
  });
83
112
  program.command("update").description("Update coding-friend plugin, CLI, and statusline").option("--cli", "Update only the CLI (npm package)").option("--plugin", "Update only the Claude Code plugin").option("--statusline", "Update only the statusline").option("--user", "Update plugin at user scope (all projects)").option("--global", "Update plugin at user scope (all projects)").option("--project", "Update plugin at project scope").option("--local", "Update plugin at local scope").action(async (opts) => {
84
- const { updateCommand } = await import("./update-DHY2EIY6.js");
113
+ const { updateCommand } = await import("./update-MY2DRJLV.js");
85
114
  await updateCommand(opts);
86
115
  });
87
116
  program.command("status").description("Show comprehensive Coding Friend status").action(async () => {
88
- const { statusCommand } = await import("./status-EAVPCBVN.js");
117
+ const { statusCommand } = await import("./status-Z4V7IYOB.js");
89
118
  await statusCommand();
90
119
  });
91
120
  program.command("clean").description("Clean files generated by Coding Friend in docs/").action(async () => {
92
- const { cleanCommand } = await import("./clean-HOVZN7PF.js");
121
+ const { cleanCommand } = await import("./clean-MXIMMXDH.js");
93
122
  await cleanCommand();
94
123
  });
95
124
  var session = program.command("session").description("[beta] Save and load Claude Code sessions across machines");
@@ -104,11 +133,11 @@ session.command("save").description("Save current Claude Code session to sync fo
104
133
  "-s, --session-id <id>",
105
134
  "session UUID to save (default: auto-detect newest)"
106
135
  ).option("-l, --label <label>", "label for this session").action(async (opts) => {
107
- const { sessionSaveCommand } = await import("./session-YIQMX4BQ.js");
136
+ const { sessionSaveCommand } = await import("./session-2R7WWNML.js");
108
137
  await sessionSaveCommand(opts);
109
138
  });
110
139
  session.command("load").description("Load a saved session from sync folder").action(async () => {
111
- const { sessionLoadCommand } = await import("./session-YIQMX4BQ.js");
140
+ const { sessionLoadCommand } = await import("./session-2R7WWNML.js");
112
141
  await sessionLoadCommand();
113
142
  });
114
143
  var memory = program.command("memory").description("AI memory system \u2014 store and search project knowledge");
@@ -128,43 +157,43 @@ Memory subcommands:
128
157
  memory mcp Show MCP server setup instructions`
129
158
  );
130
159
  memory.command("status").description("Show memory system status").action(async () => {
131
- const { memoryStatusCommand } = await import("./memory-5U6GGTVI.js");
160
+ const { memoryStatusCommand } = await import("./memory-XINRMEWB.js");
132
161
  await memoryStatusCommand();
133
162
  });
134
163
  memory.command("search").description("Search memories by query").argument("<query>", "search query").action(async (query) => {
135
- const { memorySearchCommand } = await import("./memory-5U6GGTVI.js");
164
+ const { memorySearchCommand } = await import("./memory-XINRMEWB.js");
136
165
  await memorySearchCommand(query);
137
166
  });
138
167
  memory.command("list").description(
139
168
  "List memories in current project, or all projects with --projects"
140
169
  ).option("--projects", "List all project databases with size and metadata").action(async (opts) => {
141
- const { memoryListCommand } = await import("./memory-5U6GGTVI.js");
170
+ const { memoryListCommand } = await import("./memory-XINRMEWB.js");
142
171
  await memoryListCommand(opts);
143
172
  });
144
173
  memory.command("init").description(
145
174
  "Initialize memory system \u2014 interactive wizard (first time) or config menu"
146
175
  ).action(async () => {
147
- const { memoryInitCommand } = await import("./memory-5U6GGTVI.js");
176
+ const { memoryInitCommand } = await import("./memory-XINRMEWB.js");
148
177
  await memoryInitCommand();
149
178
  });
150
179
  memory.command("config").description("Configure memory system settings").action(async () => {
151
- const { memoryConfigCommand } = await import("./memory-5U6GGTVI.js");
180
+ const { memoryConfigCommand } = await import("./memory-XINRMEWB.js");
152
181
  await memoryConfigCommand();
153
182
  });
154
183
  memory.command("start-daemon").description("Start the memory daemon (Tier 2 \u2014 MiniSearch)").action(async () => {
155
- const { memoryStartDaemonCommand } = await import("./memory-5U6GGTVI.js");
184
+ const { memoryStartDaemonCommand } = await import("./memory-XINRMEWB.js");
156
185
  await memoryStartDaemonCommand();
157
186
  });
158
187
  memory.command("stop-daemon").description("Stop the memory daemon").action(async () => {
159
- const { memoryStopDaemonCommand } = await import("./memory-5U6GGTVI.js");
188
+ const { memoryStopDaemonCommand } = await import("./memory-XINRMEWB.js");
160
189
  await memoryStopDaemonCommand();
161
190
  });
162
191
  memory.command("rebuild").description("Rebuild the daemon search index").action(async () => {
163
- const { memoryRebuildCommand } = await import("./memory-5U6GGTVI.js");
192
+ const { memoryRebuildCommand } = await import("./memory-XINRMEWB.js");
164
193
  await memoryRebuildCommand();
165
194
  });
166
195
  memory.command("mcp").description("Show MCP server setup instructions").action(async () => {
167
- const { memoryMcpCommand } = await import("./memory-5U6GGTVI.js");
196
+ const { memoryMcpCommand } = await import("./memory-XINRMEWB.js");
168
197
  await memoryMcpCommand();
169
198
  });
170
199
  memory.command("rm").description("Remove a project database").option("--project-id <id>", "Project ID to remove").option("--all", "Remove all project databases").option(
@@ -172,7 +201,7 @@ memory.command("rm").description("Remove a project database").option("--project-
172
201
  "Remove orphaned projects (source dir missing or 0 memories)"
173
202
  ).action(
174
203
  async (opts) => {
175
- const { memoryRmCommand } = await import("./memory-5U6GGTVI.js");
204
+ const { memoryRmCommand } = await import("./memory-XINRMEWB.js");
176
205
  await memoryRmCommand(opts);
177
206
  }
178
207
  );
@@ -15,12 +15,12 @@ import {
15
15
  ensureMemoryBuilt,
16
16
  isMemoryInitialized,
17
17
  memoryInitWizard
18
- } from "./chunk-HF7Y63JR.js";
19
- import "./chunk-HILXDUVZ.js";
18
+ } from "./chunk-TPGAW67X.js";
19
+ import "./chunk-MAGBNYZK.js";
20
20
  import {
21
21
  memoryConfigMenu
22
- } from "./chunk-2MOPHSMC.js";
23
- import "./chunk-YOXXIXMQ.js";
22
+ } from "./chunk-VV2U7NDN.js";
23
+ import "./chunk-CDTQL4FI.js";
24
24
  import {
25
25
  getLibPath
26
26
  } from "./chunk-RZRT7NGT.js";
@@ -408,7 +408,7 @@ async function stepLearnConfig(globalCfg) {
408
408
  const locationChoices = [];
409
409
  if (hasDistinctCurrent) {
410
410
  locationChoices.push({
411
- name: `Keep current (${currentOutputDir})`,
411
+ name: `Keep global (${currentOutputDir})`,
412
412
  value: "current"
413
413
  });
414
414
  }
@@ -449,14 +449,15 @@ async function stepLearnConfig(globalCfg) {
449
449
  }
450
450
  }
451
451
  const existingCats = globalLearn?.categories;
452
- const defaultNames = DEFAULT_CONFIG.learn.categories.map((c) => c.name).join(", ");
452
+ const defaultCats = DEFAULT_CONFIG.learn.categories;
453
+ const defaultNames = defaultCats.map((c) => c.name).join(", ");
453
454
  const catChoices = [
454
455
  { name: `Use defaults (${defaultNames})`, value: "defaults" }
455
456
  ];
456
- if (existingCats && existingCats.length > 0) {
457
+ if (existingCats && existingCats.length > 0 && JSON.stringify(existingCats) !== JSON.stringify(defaultCats)) {
457
458
  const existingNames = existingCats.map((c) => c.name).join(", ");
458
459
  catChoices.push({
459
- name: `Keep current (${existingNames})`,
460
+ name: `Keep global (${existingNames})`,
460
461
  value: "existing"
461
462
  });
462
463
  }
@@ -472,7 +473,7 @@ async function stepLearnConfig(globalCfg) {
472
473
  } else if (catChoice === "custom") {
473
474
  console.log();
474
475
  if (existingCats && existingCats.length > 0) {
475
- console.log("Current categories in config.json:");
476
+ console.log("Global categories in config.json:");
476
477
  for (const c of existingCats) {
477
478
  log.dim(` ${c.name}: ${c.description}`);
478
479
  }
@@ -712,6 +713,53 @@ async function stepAutoApprove(globalCfg, localCfg) {
712
713
  log.dim("Docs: https://cf.dinhanhthi.com/docs/reference/auto-approve/");
713
714
  }
714
715
  }
716
+ async function stepPlanDocs(globalCfg, localCfg) {
717
+ const currentDisable = getMergedValue(
718
+ "disableGUIPlan",
719
+ globalCfg,
720
+ localCfg
721
+ );
722
+ const currentFormat = getMergedValue("guiPlanFormat", globalCfg, localCfg);
723
+ const scopeLabel = getScopeLabel("disableGUIPlan", globalCfg, localCfg);
724
+ printStepHeader(
725
+ `Plan docs ${formatScopeLabel(scopeLabel)}`,
726
+ "The human overview doc /cf-plan writes next to the agent plan \u2014 enable/disable and choose format."
727
+ );
728
+ const disableChoice = await confirm({
729
+ message: "Disable the /cf-plan human overview doc?",
730
+ default: currentDisable ?? false
731
+ });
732
+ let formatChoice;
733
+ if (!disableChoice) {
734
+ const fmt = await select({
735
+ message: "Format for the human overview doc?",
736
+ choices: injectBackChoice(
737
+ [
738
+ { name: "HTML", value: "html" },
739
+ { name: "Markdown", value: "md" }
740
+ ],
741
+ "Skip plan docs config"
742
+ ),
743
+ default: currentFormat ?? "html"
744
+ });
745
+ if (fmt === BACK) {
746
+ log.dim("Skipped plan docs config.");
747
+ return;
748
+ }
749
+ formatChoice = fmt;
750
+ }
751
+ const scope = await askScope();
752
+ if (scope === "back") {
753
+ log.dim("Skipped plan docs config.");
754
+ return;
755
+ }
756
+ const targetPath = scope === "global" ? globalConfigPath() : localConfigPath();
757
+ mergeJson(targetPath, {
758
+ disableGUIPlan: disableChoice,
759
+ ...formatChoice !== void 0 ? { guiPlanFormat: formatChoice } : {}
760
+ });
761
+ log.success(`Saved to ${targetPath}`);
762
+ }
715
763
  async function stepClaudePermissions(externalLearnDir, autoCommit) {
716
764
  const scope = await select({
717
765
  message: "Where should permissions be saved?",
@@ -799,6 +847,17 @@ async function initMenu(gitAvailable) {
799
847
  globalCfg,
800
848
  localCfg
801
849
  );
850
+ const planDocsScope = getScopeLabel("disableGUIPlan", globalCfg, localCfg);
851
+ const planDocsDisableVal = getMergedValue(
852
+ "disableGUIPlan",
853
+ globalCfg,
854
+ localCfg
855
+ );
856
+ const planDocsFormatVal = getMergedValue(
857
+ "guiPlanFormat",
858
+ globalCfg,
859
+ localCfg
860
+ );
802
861
  const projectRules = getExistingRules(claudeLocalSettingsPath());
803
862
  const userRules = getExistingRules(claudeSettingsPath());
804
863
  const allRules = getAllRules();
@@ -855,6 +914,11 @@ async function initMenu(gitAvailable) {
855
914
  value: "autoApprove",
856
915
  description: " Auto-approve safe tool calls, block destructive ones, prompt for ambiguous"
857
916
  },
917
+ {
918
+ name: `Plan docs ${formatScopeLabel(planDocsScope)}`,
919
+ value: "planDocs",
920
+ description: " /cf-plan human overview doc \u2014 enable/disable + format (html/md)"
921
+ },
858
922
  {
859
923
  name: `Permissions (${permissionStatus} rules)`,
860
924
  value: "permissions",
@@ -936,6 +1000,41 @@ async function initMenu(gitAvailable) {
936
1000
  }
937
1001
  break;
938
1002
  }
1003
+ case "planDocs": {
1004
+ const planDocsDisableChoice = await confirm({
1005
+ message: "Disable the /cf-plan human overview doc?",
1006
+ default: planDocsDisableVal ?? false
1007
+ });
1008
+ let planDocsFormatChoice;
1009
+ if (!planDocsDisableChoice) {
1010
+ const fmt = await select({
1011
+ message: "Format for the human overview doc?",
1012
+ choices: injectBackChoice(
1013
+ [
1014
+ { name: "HTML", value: "html" },
1015
+ { name: "Markdown", value: "md" }
1016
+ ],
1017
+ "Skip plan docs config"
1018
+ ),
1019
+ default: planDocsFormatVal ?? "html"
1020
+ });
1021
+ if (fmt === BACK) {
1022
+ log.dim("Skipped plan docs config.");
1023
+ break;
1024
+ }
1025
+ planDocsFormatChoice = fmt;
1026
+ }
1027
+ const planDocsTargetScope = await askScope();
1028
+ if (planDocsTargetScope !== "back") {
1029
+ const targetPath = planDocsTargetScope === "global" ? globalConfigPath() : localConfigPath();
1030
+ mergeJson(targetPath, {
1031
+ disableGUIPlan: planDocsDisableChoice,
1032
+ ...planDocsFormatChoice !== void 0 ? { guiPlanFormat: planDocsFormatChoice } : {}
1033
+ });
1034
+ log.success(`Saved to ${targetPath}`);
1035
+ }
1036
+ break;
1037
+ }
939
1038
  case "permissions": {
940
1039
  const learnCfg = globalCfg?.learn;
941
1040
  const learnOutputDir = learnCfg?.outputDir ?? DEFAULT_CONFIG.learn.outputDir;
@@ -1074,6 +1173,7 @@ async function initCommand() {
1074
1173
  const finalLocal = readJson(localConfigPath());
1075
1174
  await stepTdd(finalGlobal, finalLocal);
1076
1175
  await stepAutoApprove(finalGlobal, finalLocal);
1176
+ await stepPlanDocs(finalGlobal, finalLocal);
1077
1177
  printStepHeader(
1078
1178
  "Configure Claude permissions",
1079
1179
  "Grants Coding Friend skills/hooks the permissions they need, so you get fewer prompts."
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getLatestVersion,
3
3
  semverCompare
4
- } from "./chunk-76GDRS54.js";
4
+ } from "./chunk-EAJJVXAE.js";
5
5
  import {
6
6
  getInstalledVersion
7
7
  } from "./chunk-7SMP5CZ4.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveLearnDir
3
- } from "./chunk-YOXXIXMQ.js";
3
+ } from "./chunk-CDTQL4FI.js";
4
4
  import "./chunk-57EGAXYI.js";
5
5
  import {
6
6
  commandExists,
@@ -8,22 +8,22 @@ import {
8
8
  import {
9
9
  ensureMemoryBuilt,
10
10
  printMemoryMcpConfig
11
- } from "./chunk-HF7Y63JR.js";
11
+ } from "./chunk-TPGAW67X.js";
12
12
  import {
13
13
  checkLearnMcpHealth,
14
14
  checkMemoryMcpHealth,
15
15
  detectMemoryMcpState,
16
16
  printHealthSection,
17
17
  warnStaleMcpJson
18
- } from "./chunk-HILXDUVZ.js";
18
+ } from "./chunk-MAGBNYZK.js";
19
19
  import {
20
20
  getMemoryMcpStatus,
21
21
  writeMemoryMcpEntry
22
- } from "./chunk-2MOPHSMC.js";
22
+ } from "./chunk-VV2U7NDN.js";
23
23
  import {
24
24
  resolveLearnDir,
25
25
  resolveMemoryDir
26
- } from "./chunk-YOXXIXMQ.js";
26
+ } from "./chunk-CDTQL4FI.js";
27
27
  import {
28
28
  getLibPath
29
29
  } from "./chunk-RZRT7NGT.js";
@@ -14,10 +14,10 @@ import {
14
14
  memoryStopDaemonCommand,
15
15
  printMemoryMcpConfig,
16
16
  refreshMemoryAfterUpdate
17
- } from "./chunk-HF7Y63JR.js";
18
- import "./chunk-HILXDUVZ.js";
19
- import "./chunk-2MOPHSMC.js";
20
- import "./chunk-YOXXIXMQ.js";
17
+ } from "./chunk-TPGAW67X.js";
18
+ import "./chunk-MAGBNYZK.js";
19
+ import "./chunk-VV2U7NDN.js";
20
+ import "./chunk-CDTQL4FI.js";
21
21
  import "./chunk-RZRT7NGT.js";
22
22
  import "./chunk-57EGAXYI.js";
23
23
  import "./chunk-IKLMHJH6.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-YOXXIXMQ.js";
3
+ } from "./chunk-CDTQL4FI.js";
4
4
  import "./chunk-57EGAXYI.js";
5
5
  import {
6
6
  readJson,
@@ -10,13 +10,13 @@ import {
10
10
  import {
11
11
  checkLearnMcpHealth,
12
12
  checkMemoryMcpHealth
13
- } from "./chunk-HILXDUVZ.js";
14
- import "./chunk-2MOPHSMC.js";
13
+ } from "./chunk-MAGBNYZK.js";
14
+ import "./chunk-VV2U7NDN.js";
15
15
  import {
16
16
  resolveLearnDir,
17
17
  resolveMemoryDir,
18
18
  sanitizeRawConfig
19
- } from "./chunk-YOXXIXMQ.js";
19
+ } from "./chunk-CDTQL4FI.js";
20
20
  import {
21
21
  getLibPath
22
22
  } from "./chunk-RZRT7NGT.js";
@@ -25,7 +25,7 @@ import {
25
25
  getLatestCliVersion,
26
26
  getLatestVersion,
27
27
  semverCompare
28
- } from "./chunk-76GDRS54.js";
28
+ } from "./chunk-EAJJVXAE.js";
29
29
  import {
30
30
  getInstalledVersion
31
31
  } from "./chunk-7SMP5CZ4.js";
@@ -4,7 +4,7 @@ import {
4
4
  getLatestVersion,
5
5
  semverCompare,
6
6
  updateCommand
7
- } from "./chunk-76GDRS54.js";
7
+ } from "./chunk-EAJJVXAE.js";
8
8
  import "./chunk-7SMP5CZ4.js";
9
9
  import "./chunk-57EGAXYI.js";
10
10
  import "./chunk-667NMPN4.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-friend-cli",
3
- "version": "1.36.1",
3
+ "version": "1.36.3",
4
4
  "description": "CLI for coding-friend — host learning docs, setup MCP server, initialize projects",
5
5
  "type": "module",
6
6
  "bin": {