coding-friend-cli 1.20.2 → 1.21.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.
Files changed (30) hide show
  1. package/dist/{chunk-IMFS66LB.js → chunk-3KXYEC2T.js} +6 -4
  2. package/dist/{chunk-DMVSYXKX.js → chunk-5UEY7HQX.js} +6 -4
  3. package/dist/chunk-5UVDWG5L.js +28 -0
  4. package/dist/{chunk-RMQKSNH7.js → chunk-BIX7AJU3.js} +5 -3
  5. package/dist/{chunk-DQRUD4H7.js → chunk-DO6FV6BL.js} +1 -27
  6. package/dist/{chunk-U3ERRSBC.js → chunk-HEBLANJO.js} +37 -1
  7. package/dist/{chunk-ENG3TLQX.js → chunk-PDVSGGH6.js} +7 -5
  8. package/dist/{chunk-POC2WHU2.js → chunk-PRIH34UB.js} +4 -0
  9. package/dist/{chunk-NEQZP5D4.js → chunk-PYTEAC6K.js} +3 -1
  10. package/dist/{chunk-2OOQQESF.js → chunk-SIQJPT47.js} +5 -3
  11. package/dist/{chunk-VR3XXOAY.js → chunk-TRIALFOQ.js} +8 -6
  12. package/dist/{config-5ZIOKZHL.js → config-5I3XJEEL.js} +12 -10
  13. package/dist/{dev-D3RW7PLW.js → dev-4A5CTBGK.js} +10 -8
  14. package/dist/{disable-3TVAPIMY.js → disable-FNMRPUO7.js} +4 -3
  15. package/dist/{enable-LIPT4YGN.js → enable-HUKTMK5U.js} +4 -3
  16. package/dist/{host-Q7XY2CTU.js → host-V5O3PDCF.js} +4 -3
  17. package/dist/index.js +37 -31
  18. package/dist/{init-FLADYT36.js → init-3XMC6YJI.js} +32 -14
  19. package/dist/{install-DU264RZD.js → install-5ZBHH2OM.js} +8 -7
  20. package/dist/{mcp-QTPM73K4.js → mcp-U34LFD34.js} +4 -3
  21. package/dist/{memory-LTKZUT5H.js → memory-27ZSRPM7.js} +35 -27
  22. package/dist/{permission-EYGAM2D7.js → permission-BEC6YZQA.js} +15 -8
  23. package/dist/postinstall.js +1 -1
  24. package/dist/{session-OKCDYRB6.js → session-ZDJ2APGL.js} +8 -6
  25. package/dist/{status-ZDJIACCH.js → status-F6WASK7N.js} +13 -11
  26. package/dist/{statusline-A2QPWQ2E.js → statusline-AISH77XP.js} +9 -3
  27. package/dist/{uninstall-6AYMTIJO.js → uninstall-RJ6SBB76.js} +9 -7
  28. package/dist/{update-MPUKWITS.js → update-536C3YG7.js} +7 -6
  29. package/dist/update-check-L5TNWT2J.js +91 -0
  30. package/package.json +1 -1
@@ -6,13 +6,15 @@ import {
6
6
  askScope,
7
7
  formatScopeLabel,
8
8
  injectBackChoice
9
- } from "./chunk-RMQKSNH7.js";
9
+ } from "./chunk-BIX7AJU3.js";
10
10
  import {
11
- globalConfigPath,
12
- localConfigPath,
13
11
  mergeJson,
14
12
  readJson
15
- } from "./chunk-DQRUD4H7.js";
13
+ } from "./chunk-5UVDWG5L.js";
14
+ import {
15
+ globalConfigPath,
16
+ localConfigPath
17
+ } from "./chunk-DO6FV6BL.js";
16
18
  import {
17
19
  log
18
20
  } from "./chunk-W5CD7WTX.js";
@@ -1,12 +1,14 @@
1
+ import {
2
+ readJson,
3
+ writeJson
4
+ } from "./chunk-5UVDWG5L.js";
1
5
  import {
2
6
  claudeLocalSettingsPath,
3
7
  claudeProjectSettingsPath,
4
8
  claudeSettingsPath,
5
9
  installedPluginsPath,
6
- knownMarketplacesPath,
7
- readJson,
8
- writeJson
9
- } from "./chunk-DQRUD4H7.js";
10
+ knownMarketplacesPath
11
+ } from "./chunk-DO6FV6BL.js";
10
12
 
11
13
  // src/lib/plugin-state.ts
12
14
  var MARKETPLACE_NAME = "coding-friend-marketplace";
@@ -0,0 +1,28 @@
1
+ // src/lib/json.ts
2
+ import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
3
+ import { dirname } from "path";
4
+ function readJson(filePath) {
5
+ try {
6
+ const content = readFileSync(filePath, "utf-8");
7
+ return JSON.parse(content);
8
+ } catch {
9
+ return null;
10
+ }
11
+ }
12
+ function writeJson(filePath, data) {
13
+ const dir = dirname(filePath);
14
+ if (!existsSync(dir)) {
15
+ mkdirSync(dir, { recursive: true });
16
+ }
17
+ writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf-8");
18
+ }
19
+ function mergeJson(filePath, data) {
20
+ const existing = readJson(filePath) ?? {};
21
+ writeJson(filePath, { ...existing, ...data });
22
+ }
23
+
24
+ export {
25
+ readJson,
26
+ writeJson,
27
+ mergeJson
28
+ };
@@ -2,10 +2,12 @@ import {
2
2
  run
3
3
  } from "./chunk-EVGXUDX4.js";
4
4
  import {
5
- globalConfigPath,
6
- localConfigPath,
7
5
  readJson
8
- } from "./chunk-DQRUD4H7.js";
6
+ } from "./chunk-5UVDWG5L.js";
7
+ import {
8
+ globalConfigPath,
9
+ localConfigPath
10
+ } from "./chunk-DO6FV6BL.js";
9
11
  import {
10
12
  log
11
13
  } from "./chunk-W5CD7WTX.js";
@@ -71,29 +71,6 @@ function claudeSessionDir(encodedPath) {
71
71
  return join(claudeProjectsDir(), encodedPath);
72
72
  }
73
73
 
74
- // src/lib/json.ts
75
- import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
76
- import { dirname } from "path";
77
- function readJson(filePath) {
78
- try {
79
- const content = readFileSync(filePath, "utf-8");
80
- return JSON.parse(content);
81
- } catch {
82
- return null;
83
- }
84
- }
85
- function writeJson(filePath, data) {
86
- const dir = dirname(filePath);
87
- if (!existsSync(dir)) {
88
- mkdirSync(dir, { recursive: true });
89
- }
90
- writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf-8");
91
- }
92
- function mergeJson(filePath, data) {
93
- const existing = readJson(filePath) ?? {};
94
- writeJson(filePath, { ...existing, ...data });
95
- }
96
-
97
74
  export {
98
75
  resolvePath,
99
76
  localConfigPath,
@@ -109,8 +86,5 @@ export {
109
86
  marketplaceClonePath,
110
87
  globalConfigDir,
111
88
  encodeProjectPath,
112
- claudeSessionDir,
113
- readJson,
114
- writeJson,
115
- mergeJson
89
+ claudeSessionDir
116
90
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readJson,
3
3
  writeJson
4
- } from "./chunk-DQRUD4H7.js";
4
+ } from "./chunk-5UVDWG5L.js";
5
5
 
6
6
  // src/lib/permissions.ts
7
7
  import { homedir } from "os";
@@ -152,6 +152,37 @@ var STATIC_RULES = [
152
152
  category: "Git",
153
153
  recommended: true
154
154
  },
155
+ // Git Compound Commands (cd + read-only git, used by subagents like /cf-review)
156
+ {
157
+ rule: "Bash(cd * && git status *)",
158
+ description: "[read-only] Check working tree status in another dir \xB7 Used by: /cf-review subagent",
159
+ category: "Git",
160
+ recommended: true
161
+ },
162
+ {
163
+ rule: "Bash(cd * && git diff *)",
164
+ description: "[read-only] View file changes in another dir \xB7 Used by: /cf-review subagent",
165
+ category: "Git",
166
+ recommended: true
167
+ },
168
+ {
169
+ rule: "Bash(cd * && git log *)",
170
+ description: "[read-only] View commit history in another dir \xB7 Used by: /cf-review subagent",
171
+ category: "Git",
172
+ recommended: true
173
+ },
174
+ {
175
+ rule: "Bash(cd * && git branch *)",
176
+ description: "[read-only] List branches in another dir \xB7 Used by: /cf-review subagent",
177
+ category: "Git",
178
+ recommended: true
179
+ },
180
+ {
181
+ rule: "Bash(cd * && git rev-parse *)",
182
+ description: "[read-only] Check git repo state in another dir \xB7 Used by: /cf-review subagent",
183
+ category: "Git",
184
+ recommended: true
185
+ },
155
186
  // GitHub CLI
156
187
  {
157
188
  rule: "Bash(gh pr *)",
@@ -332,6 +363,10 @@ function groupByCategory(rules) {
332
363
  }
333
364
  return groups;
334
365
  }
366
+ function extractTag(description) {
367
+ const match = description.match(/^(\[[^\]]+\])/);
368
+ return match ? match[1] : null;
369
+ }
335
370
  var OLD_PLUGIN_PATH_PATTERN = "/.claude/plugins/cache/coding-friend-marketplace/coding-friend/";
336
371
  function cleanupStalePluginRules(settingsPath) {
337
372
  const existing = getExistingRules(settingsPath);
@@ -360,6 +395,7 @@ export {
360
395
  buildLearnDirRules,
361
396
  applyPermissions,
362
397
  groupByCategory,
398
+ extractTag,
363
399
  cleanupStalePluginRules,
364
400
  logPluginScriptWarning
365
401
  };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ensureStatusline,
3
3
  getInstalledVersion
4
- } from "./chunk-VR3XXOAY.js";
4
+ } from "./chunk-TRIALFOQ.js";
5
5
  import {
6
6
  ensureShellCompletion
7
- } from "./chunk-NEQZP5D4.js";
7
+ } from "./chunk-PYTEAC6K.js";
8
8
  import {
9
9
  resolveScope
10
- } from "./chunk-RMQKSNH7.js";
10
+ } from "./chunk-BIX7AJU3.js";
11
11
  import {
12
12
  commandExists,
13
13
  run,
@@ -15,9 +15,11 @@ import {
15
15
  sleepSync
16
16
  } from "./chunk-EVGXUDX4.js";
17
17
  import {
18
- claudeSettingsPath,
19
18
  readJson
20
- } from "./chunk-DQRUD4H7.js";
19
+ } from "./chunk-5UVDWG5L.js";
20
+ import {
21
+ claudeSettingsPath
22
+ } from "./chunk-DO6FV6BL.js";
21
23
  import {
22
24
  log
23
25
  } from "./chunk-W5CD7WTX.js";
@@ -4,6 +4,10 @@ var STATUSLINE_COMPONENTS = [
4
4
  { id: "folder", label: "Project name (MyProject)" },
5
5
  { id: "model", label: "Active model (Opus 4.6)" },
6
6
  { id: "branch", label: "Git branch (\u2387 main)" },
7
+ {
8
+ id: "account",
9
+ label: "Account info \u2014 name, email & org (from ~/.claude.json)"
10
+ },
7
11
  { id: "context", label: "Context window usage (ctx 42%)" },
8
12
  {
9
13
  id: "rate_limit",
@@ -12,7 +12,7 @@ import {
12
12
  writeFileSync
13
13
  } from "fs";
14
14
  import { homedir } from "os";
15
- import { basename, join } from "path";
15
+ import { basename, dirname, join } from "path";
16
16
  var MARKER_START = "# >>> coding-friend CLI completion >>>";
17
17
  var MARKER_END = "# <<< coding-friend CLI completion <<<";
18
18
  var BASH_BLOCK = `
@@ -387,6 +387,8 @@ function ensureShellCompletion(opts) {
387
387
  return true;
388
388
  }
389
389
  }
390
+ const rcDir = dirname(rcPath);
391
+ if (!existsSync(rcDir)) mkdirSync(rcDir, { recursive: true });
390
392
  appendFileSync(rcPath, newBlock);
391
393
  if (!opts?.silent) {
392
394
  log.success(`Tab completion added to ~/${rcName}`);
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  DEFAULT_CONFIG
3
- } from "./chunk-POC2WHU2.js";
3
+ } from "./chunk-PRIH34UB.js";
4
+ import {
5
+ readJson
6
+ } from "./chunk-5UVDWG5L.js";
4
7
  import {
5
8
  globalConfigPath,
6
9
  localConfigPath,
7
- readJson,
8
10
  resolvePath
9
- } from "./chunk-DQRUD4H7.js";
11
+ } from "./chunk-DO6FV6BL.js";
10
12
 
11
13
  // src/lib/config.ts
12
14
  function deepMerge(base, override) {
@@ -1,16 +1,18 @@
1
1
  import {
2
2
  ALL_COMPONENT_IDS,
3
3
  STATUSLINE_COMPONENTS
4
- } from "./chunk-POC2WHU2.js";
4
+ } from "./chunk-PRIH34UB.js";
5
5
  import {
6
- claudeSettingsPath,
7
- globalConfigPath,
8
- installedPluginsPath,
9
6
  mergeJson,
10
- pluginCachePath,
11
7
  readJson,
12
8
  writeJson
13
- } from "./chunk-DQRUD4H7.js";
9
+ } from "./chunk-5UVDWG5L.js";
10
+ import {
11
+ claudeSettingsPath,
12
+ globalConfigPath,
13
+ installedPluginsPath,
14
+ pluginCachePath
15
+ } from "./chunk-DO6FV6BL.js";
14
16
 
15
17
  // src/lib/statusline.ts
16
18
  import { existsSync, readdirSync } from "fs";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  memoryConfigMenu
3
- } from "./chunk-IMFS66LB.js";
3
+ } from "./chunk-3KXYEC2T.js";
4
4
  import {
5
5
  getAllRules,
6
6
  getExistingRules
7
- } from "./chunk-U3ERRSBC.js";
7
+ } from "./chunk-HEBLANJO.js";
8
8
  import "./chunk-RZRT7NGT.js";
9
9
  import {
10
10
  findStatuslineHookPath,
@@ -12,16 +12,16 @@ import {
12
12
  saveStatuslineConfig,
13
13
  selectStatuslineComponents,
14
14
  writeStatuslineSettings
15
- } from "./chunk-VR3XXOAY.js";
15
+ } from "./chunk-TRIALFOQ.js";
16
16
  import {
17
17
  ALL_COMPONENT_IDS,
18
18
  DEFAULT_CONFIG
19
- } from "./chunk-POC2WHU2.js";
19
+ } from "./chunk-PRIH34UB.js";
20
20
  import {
21
21
  ensureShellCompletion,
22
22
  hasShellCompletion,
23
23
  removeShellCompletion
24
- } from "./chunk-NEQZP5D4.js";
24
+ } from "./chunk-PYTEAC6K.js";
25
25
  import {
26
26
  BACK,
27
27
  applyDocsDirChange,
@@ -31,19 +31,21 @@ import {
31
31
  getScopeLabel,
32
32
  injectBackChoice,
33
33
  showConfigHint
34
- } from "./chunk-RMQKSNH7.js";
34
+ } from "./chunk-BIX7AJU3.js";
35
35
  import {
36
36
  run
37
37
  } from "./chunk-EVGXUDX4.js";
38
+ import {
39
+ mergeJson,
40
+ readJson
41
+ } from "./chunk-5UVDWG5L.js";
38
42
  import {
39
43
  claudeLocalSettingsPath,
40
44
  claudeSettingsPath,
41
45
  globalConfigPath,
42
46
  localConfigPath,
43
- mergeJson,
44
- readJson,
45
47
  resolvePath
46
- } from "./chunk-DQRUD4H7.js";
48
+ } from "./chunk-DO6FV6BL.js";
47
49
  import {
48
50
  log
49
51
  } from "./chunk-W5CD7WTX.js";
@@ -540,7 +542,7 @@ async function editPermissions() {
540
542
  )
541
543
  });
542
544
  if (choice === BACK) return;
543
- const { permissionCommand } = await import("./permission-EYGAM2D7.js");
545
+ const { permissionCommand } = await import("./permission-BEC6YZQA.js");
544
546
  switch (choice) {
545
547
  case "interactive":
546
548
  await permissionCommand({});
@@ -1,25 +1,27 @@
1
1
  import {
2
2
  isMarketplaceRegistered,
3
3
  isPluginInstalled
4
- } from "./chunk-DMVSYXKX.js";
4
+ } from "./chunk-5UEY7HQX.js";
5
5
  import {
6
6
  ensureStatusline
7
- } from "./chunk-VR3XXOAY.js";
8
- import "./chunk-POC2WHU2.js";
7
+ } from "./chunk-TRIALFOQ.js";
8
+ import "./chunk-PRIH34UB.js";
9
9
  import {
10
10
  ensureShellCompletion
11
- } from "./chunk-NEQZP5D4.js";
11
+ } from "./chunk-PYTEAC6K.js";
12
12
  import {
13
13
  commandExists,
14
14
  run
15
15
  } from "./chunk-EVGXUDX4.js";
16
16
  import {
17
- devStatePath,
18
- knownMarketplacesPath,
19
- pluginCachePath,
20
17
  readJson,
21
18
  writeJson
22
- } from "./chunk-DQRUD4H7.js";
19
+ } from "./chunk-5UVDWG5L.js";
20
+ import {
21
+ devStatePath,
22
+ knownMarketplacesPath,
23
+ pluginCachePath
24
+ } from "./chunk-DO6FV6BL.js";
23
25
  import {
24
26
  log
25
27
  } from "./chunk-W5CD7WTX.js";
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  isPluginDisabled,
3
3
  setPluginEnabled
4
- } from "./chunk-DMVSYXKX.js";
4
+ } from "./chunk-5UEY7HQX.js";
5
5
  import {
6
6
  resolveScope
7
- } from "./chunk-RMQKSNH7.js";
7
+ } from "./chunk-BIX7AJU3.js";
8
8
  import "./chunk-EVGXUDX4.js";
9
- import "./chunk-DQRUD4H7.js";
9
+ import "./chunk-5UVDWG5L.js";
10
+ import "./chunk-DO6FV6BL.js";
10
11
  import {
11
12
  log
12
13
  } from "./chunk-W5CD7WTX.js";
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  isPluginDisabled,
3
3
  setPluginEnabled
4
- } from "./chunk-DMVSYXKX.js";
4
+ } from "./chunk-5UEY7HQX.js";
5
5
  import {
6
6
  resolveScope
7
- } from "./chunk-RMQKSNH7.js";
7
+ } from "./chunk-BIX7AJU3.js";
8
8
  import "./chunk-EVGXUDX4.js";
9
- import "./chunk-DQRUD4H7.js";
9
+ import "./chunk-5UVDWG5L.js";
10
+ import "./chunk-DO6FV6BL.js";
10
11
  import {
11
12
  log
12
13
  } from "./chunk-W5CD7WTX.js";
@@ -1,15 +1,16 @@
1
1
  import {
2
2
  resolveDocsDir
3
- } from "./chunk-2OOQQESF.js";
3
+ } from "./chunk-SIQJPT47.js";
4
4
  import {
5
5
  getLibPath
6
6
  } from "./chunk-RZRT7NGT.js";
7
- import "./chunk-POC2WHU2.js";
7
+ import "./chunk-PRIH34UB.js";
8
8
  import {
9
9
  run,
10
10
  streamExec
11
11
  } from "./chunk-EVGXUDX4.js";
12
- import "./chunk-DQRUD4H7.js";
12
+ import "./chunk-5UVDWG5L.js";
13
+ import "./chunk-DO6FV6BL.js";
13
14
  import {
14
15
  log
15
16
  } from "./chunk-W5CD7WTX.js";
package/dist/index.js CHANGED
@@ -14,54 +14,54 @@ program.name("cf").description(
14
14
  "coding-friend CLI \u2014 host learning docs, setup MCP, init projects"
15
15
  ).version(pkg.version, "-v, --version");
16
16
  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-DU264RZD.js");
17
+ const { installCommand } = await import("./install-5ZBHH2OM.js");
18
18
  await installCommand(opts);
19
19
  });
20
20
  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) => {
21
- const { uninstallCommand } = await import("./uninstall-6AYMTIJO.js");
21
+ const { uninstallCommand } = await import("./uninstall-RJ6SBB76.js");
22
22
  await uninstallCommand(opts);
23
23
  });
24
24
  program.command("disable").description("Disable the Coding Friend plugin without uninstalling").option("--user", "Disable at user scope (all projects)").option("--global", "Disable at user scope (all projects)").option("--project", "Disable at project scope").option("--local", "Disable at local scope").action(async (opts) => {
25
- const { disableCommand } = await import("./disable-3TVAPIMY.js");
25
+ const { disableCommand } = await import("./disable-FNMRPUO7.js");
26
26
  await disableCommand(opts);
27
27
  });
28
28
  program.command("enable").description("Re-enable the Coding Friend plugin").option("--user", "Enable at user scope (all projects)").option("--global", "Enable at user scope (all projects)").option("--project", "Enable at project scope").option("--local", "Enable at local scope").action(async (opts) => {
29
- const { enableCommand } = await import("./enable-LIPT4YGN.js");
29
+ const { enableCommand } = await import("./enable-HUKTMK5U.js");
30
30
  await enableCommand(opts);
31
31
  });
32
32
  program.command("init").description("Initialize coding-friend in current project").action(async () => {
33
- const { initCommand } = await import("./init-FLADYT36.js");
33
+ const { initCommand } = await import("./init-3XMC6YJI.js");
34
34
  await initCommand();
35
35
  });
36
36
  program.command("config").description("Manage Coding Friend configuration").action(async () => {
37
- const { configCommand } = await import("./config-5ZIOKZHL.js");
37
+ const { configCommand } = await import("./config-5I3XJEEL.js");
38
38
  await configCommand();
39
39
  });
40
40
  program.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) => {
41
- const { hostCommand } = await import("./host-Q7XY2CTU.js");
41
+ const { hostCommand } = await import("./host-V5O3PDCF.js");
42
42
  await hostCommand(path, opts);
43
43
  });
44
44
  program.command("mcp").description("Setup MCP server for learning docs").argument("[path]", "path to docs folder").action(async (path) => {
45
- const { mcpCommand } = await import("./mcp-QTPM73K4.js");
45
+ const { mcpCommand } = await import("./mcp-U34LFD34.js");
46
46
  await mcpCommand(path);
47
47
  });
48
48
  program.command("permission").description("Manage Claude Code permission rules for Coding Friend").option("--all", "Apply all recommended permissions without prompts").option("--user", "Save to user-level settings (~/.claude/settings.json)").option(
49
49
  "--project",
50
50
  "Save to project-level settings (.claude/settings.local.json)"
51
51
  ).action(async (opts) => {
52
- const { permissionCommand } = await import("./permission-EYGAM2D7.js");
52
+ const { permissionCommand } = await import("./permission-BEC6YZQA.js");
53
53
  await permissionCommand(opts);
54
54
  });
55
55
  program.command("statusline").description("Setup coding-friend statusline in Claude Code").action(async () => {
56
- const { statuslineCommand } = await import("./statusline-A2QPWQ2E.js");
56
+ const { statuslineCommand } = await import("./statusline-AISH77XP.js");
57
57
  await statuslineCommand();
58
58
  });
59
59
  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) => {
60
- const { updateCommand } = await import("./update-MPUKWITS.js");
60
+ const { updateCommand } = await import("./update-536C3YG7.js");
61
61
  await updateCommand(opts);
62
62
  });
63
63
  program.command("status").description("Show comprehensive Coding Friend status").action(async () => {
64
- const { statusCommand } = await import("./status-ZDJIACCH.js");
64
+ const { statusCommand } = await import("./status-F6WASK7N.js");
65
65
  await statusCommand();
66
66
  });
67
67
  var session = program.command("session").description("Save and load Claude Code sessions across machines");
@@ -76,11 +76,11 @@ session.command("save").description("Save current Claude Code session to sync fo
76
76
  "-s, --session-id <id>",
77
77
  "session UUID to save (default: auto-detect newest)"
78
78
  ).option("-l, --label <label>", "label for this session").action(async (opts) => {
79
- const { sessionSaveCommand } = await import("./session-OKCDYRB6.js");
79
+ const { sessionSaveCommand } = await import("./session-ZDJ2APGL.js");
80
80
  await sessionSaveCommand(opts);
81
81
  });
82
82
  session.command("load").description("Load a saved session from sync folder").action(async () => {
83
- const { sessionLoadCommand } = await import("./session-OKCDYRB6.js");
83
+ const { sessionLoadCommand } = await import("./session-ZDJ2APGL.js");
84
84
  await sessionLoadCommand();
85
85
  });
86
86
  var memory = program.command("memory").description("AI memory system \u2014 store and search project knowledge");
@@ -100,43 +100,43 @@ Memory subcommands:
100
100
  memory mcp Show MCP server setup instructions`
101
101
  );
102
102
  memory.command("status").description("Show memory system status").action(async () => {
103
- const { memoryStatusCommand } = await import("./memory-LTKZUT5H.js");
103
+ const { memoryStatusCommand } = await import("./memory-27ZSRPM7.js");
104
104
  await memoryStatusCommand();
105
105
  });
106
106
  memory.command("search").description("Search memories by query").argument("<query>", "search query").action(async (query) => {
107
- const { memorySearchCommand } = await import("./memory-LTKZUT5H.js");
107
+ const { memorySearchCommand } = await import("./memory-27ZSRPM7.js");
108
108
  await memorySearchCommand(query);
109
109
  });
110
110
  memory.command("list").description(
111
111
  "List memories in current project, or all projects with --projects"
112
112
  ).option("--projects", "List all project databases with size and metadata").action(async (opts) => {
113
- const { memoryListCommand } = await import("./memory-LTKZUT5H.js");
113
+ const { memoryListCommand } = await import("./memory-27ZSRPM7.js");
114
114
  await memoryListCommand(opts);
115
115
  });
116
116
  memory.command("init").description(
117
117
  "Initialize memory system \u2014 interactive wizard (first time) or config menu"
118
118
  ).action(async () => {
119
- const { memoryInitCommand } = await import("./memory-LTKZUT5H.js");
119
+ const { memoryInitCommand } = await import("./memory-27ZSRPM7.js");
120
120
  await memoryInitCommand();
121
121
  });
122
122
  memory.command("config").description("Configure memory system settings").action(async () => {
123
- const { memoryConfigCommand } = await import("./memory-LTKZUT5H.js");
123
+ const { memoryConfigCommand } = await import("./memory-27ZSRPM7.js");
124
124
  await memoryConfigCommand();
125
125
  });
126
126
  memory.command("start-daemon").description("Start the memory daemon (Tier 2 \u2014 MiniSearch)").action(async () => {
127
- const { memoryStartDaemonCommand } = await import("./memory-LTKZUT5H.js");
127
+ const { memoryStartDaemonCommand } = await import("./memory-27ZSRPM7.js");
128
128
  await memoryStartDaemonCommand();
129
129
  });
130
130
  memory.command("stop-daemon").description("Stop the memory daemon").action(async () => {
131
- const { memoryStopDaemonCommand } = await import("./memory-LTKZUT5H.js");
131
+ const { memoryStopDaemonCommand } = await import("./memory-27ZSRPM7.js");
132
132
  await memoryStopDaemonCommand();
133
133
  });
134
134
  memory.command("rebuild").description("Rebuild the daemon search index").action(async () => {
135
- const { memoryRebuildCommand } = await import("./memory-LTKZUT5H.js");
135
+ const { memoryRebuildCommand } = await import("./memory-27ZSRPM7.js");
136
136
  await memoryRebuildCommand();
137
137
  });
138
138
  memory.command("mcp").description("Show MCP server setup instructions").action(async () => {
139
- const { memoryMcpCommand } = await import("./memory-LTKZUT5H.js");
139
+ const { memoryMcpCommand } = await import("./memory-27ZSRPM7.js");
140
140
  await memoryMcpCommand();
141
141
  });
142
142
  memory.command("rm").description("Remove a project database").option("--project-id <id>", "Project ID to remove").option("--all", "Remove all project databases").option(
@@ -144,7 +144,7 @@ memory.command("rm").description("Remove a project database").option("--project-
144
144
  "Remove orphaned projects (source dir missing or 0 memories)"
145
145
  ).action(
146
146
  async (opts) => {
147
- const { memoryRmCommand } = await import("./memory-LTKZUT5H.js");
147
+ const { memoryRmCommand } = await import("./memory-27ZSRPM7.js");
148
148
  await memoryRmCommand(opts);
149
149
  }
150
150
  );
@@ -161,35 +161,41 @@ Dev subcommands:
161
161
  dev update [path] Update local dev plugin to latest version`
162
162
  );
163
163
  dev.command("on").description("Switch to local plugin source").argument("[path]", "path to local coding-friend repo (default: cwd)").action(async (path) => {
164
- const { devOnCommand } = await import("./dev-D3RW7PLW.js");
164
+ const { devOnCommand } = await import("./dev-4A5CTBGK.js");
165
165
  await devOnCommand(path);
166
166
  });
167
167
  dev.command("off").description("Switch back to remote marketplace").action(async () => {
168
- const { devOffCommand } = await import("./dev-D3RW7PLW.js");
168
+ const { devOffCommand } = await import("./dev-4A5CTBGK.js");
169
169
  await devOffCommand();
170
170
  });
171
171
  dev.command("status").description("Show current dev mode").action(async () => {
172
- const { devStatusCommand } = await import("./dev-D3RW7PLW.js");
172
+ const { devStatusCommand } = await import("./dev-4A5CTBGK.js");
173
173
  await devStatusCommand();
174
174
  });
175
175
  dev.command("sync").description(
176
176
  "Copy local source files to plugin cache (no version bump needed)"
177
177
  ).action(async () => {
178
- const { devSyncCommand } = await import("./dev-D3RW7PLW.js");
178
+ const { devSyncCommand } = await import("./dev-4A5CTBGK.js");
179
179
  await devSyncCommand();
180
180
  });
181
181
  dev.command("restart").description("Reinstall local dev plugin (off + on)").argument(
182
182
  "[path]",
183
183
  "path to local coding-friend repo (default: saved path or cwd)"
184
184
  ).action(async (path) => {
185
- const { devRestartCommand } = await import("./dev-D3RW7PLW.js");
185
+ const { devRestartCommand } = await import("./dev-4A5CTBGK.js");
186
186
  await devRestartCommand(path);
187
187
  });
188
188
  dev.command("update").description("Update local dev plugin to latest version (off + on)").argument(
189
189
  "[path]",
190
190
  "path to local coding-friend repo (default: saved path or cwd)"
191
191
  ).action(async (path) => {
192
- const { devUpdateCommand } = await import("./dev-D3RW7PLW.js");
192
+ const { devUpdateCommand } = await import("./dev-4A5CTBGK.js");
193
193
  await devUpdateCommand(path);
194
194
  });
195
- program.parse();
195
+ program.hook("postAction", async () => {
196
+ const topCmd = process.argv[2];
197
+ if (topCmd === "update") return;
198
+ const { checkAndNotifyCliUpdate } = await import("./update-check-L5TNWT2J.js");
199
+ checkAndNotifyCliUpdate(pkg.version);
200
+ });
201
+ await program.parseAsync();
@@ -6,7 +6,7 @@ import {
6
6
  getExistingRules,
7
7
  getMissingRules,
8
8
  logPluginScriptWarning
9
- } from "./chunk-U3ERRSBC.js";
9
+ } from "./chunk-HEBLANJO.js";
10
10
  import {
11
11
  getLibPath
12
12
  } from "./chunk-RZRT7NGT.js";
@@ -16,14 +16,14 @@ import {
16
16
  saveStatuslineConfig,
17
17
  selectStatuslineComponents,
18
18
  writeStatuslineSettings
19
- } from "./chunk-VR3XXOAY.js";
19
+ } from "./chunk-TRIALFOQ.js";
20
20
  import {
21
21
  DEFAULT_CONFIG
22
- } from "./chunk-POC2WHU2.js";
22
+ } from "./chunk-PRIH34UB.js";
23
23
  import {
24
24
  ensureShellCompletion,
25
25
  hasShellCompletion
26
- } from "./chunk-NEQZP5D4.js";
26
+ } from "./chunk-PYTEAC6K.js";
27
27
  import {
28
28
  BACK,
29
29
  applyDocsDirChange,
@@ -34,21 +34,23 @@ import {
34
34
  getScopeLabel,
35
35
  injectBackChoice,
36
36
  showConfigHint
37
- } from "./chunk-RMQKSNH7.js";
37
+ } from "./chunk-BIX7AJU3.js";
38
38
  import {
39
39
  commandExists,
40
40
  run
41
41
  } from "./chunk-EVGXUDX4.js";
42
+ import {
43
+ mergeJson,
44
+ readJson,
45
+ writeJson
46
+ } from "./chunk-5UVDWG5L.js";
42
47
  import {
43
48
  claudeLocalSettingsPath,
44
49
  claudeSettingsPath,
45
50
  globalConfigPath,
46
51
  localConfigPath,
47
- mergeJson,
48
- readJson,
49
- resolvePath,
50
- writeJson
51
- } from "./chunk-DQRUD4H7.js";
52
+ resolvePath
53
+ } from "./chunk-DO6FV6BL.js";
52
54
  import {
53
55
  log
54
56
  } from "./chunk-W5CD7WTX.js";
@@ -108,7 +110,14 @@ function paddedScopeLabel(scope) {
108
110
  }
109
111
  function printSetupStatus(globalCfg, localCfg, gitAvailable) {
110
112
  const docsDir = getDocsDir(globalCfg, localCfg);
111
- const subfolders = ["plans", "memory", "research", "learn", "sessions"];
113
+ const subfolders = [
114
+ "plans",
115
+ "memory",
116
+ "research",
117
+ "learn",
118
+ "sessions",
119
+ "reviews"
120
+ ];
112
121
  const folderStatus = subfolders.map((sub) => ({
113
122
  name: `${docsDir}/${sub}`,
114
123
  exists: existsSync(`${docsDir}/${sub}`)
@@ -229,7 +238,8 @@ async function stepDocsDir(globalCfg, localCfg) {
229
238
  "memory",
230
239
  "research",
231
240
  "learn",
232
- "sessions"
241
+ "sessions",
242
+ "reviews"
233
243
  ];
234
244
  ensureDocsFolders(globalValue, DOCS_SUBFOLDERS2);
235
245
  return;
@@ -249,7 +259,14 @@ async function stepDocsDir(globalCfg, localCfg) {
249
259
  log.dim("Skipped docsDir.");
250
260
  return;
251
261
  }
252
- const DOCS_SUBFOLDERS = ["plans", "memory", "research", "learn", "sessions"];
262
+ const DOCS_SUBFOLDERS = [
263
+ "plans",
264
+ "memory",
265
+ "research",
266
+ "learn",
267
+ "sessions",
268
+ "reviews"
269
+ ];
253
270
  applyDocsDirChange(value, currentValue, scope, DOCS_SUBFOLDERS);
254
271
  writeToScope(scope, { docsDir: value });
255
272
  }
@@ -289,6 +306,7 @@ async function stepGitignore(docsDir) {
289
306
  `${docsDir}/research/`,
290
307
  `${docsDir}/learn/`,
291
308
  `${docsDir}/sessions/`,
309
+ `${docsDir}/reviews/`,
292
310
  ".coding-friend/"
293
311
  ];
294
312
  let entries = allEntries;
@@ -958,7 +976,7 @@ async function initCommand() {
958
976
  console.log();
959
977
  log.congrats("Setup complete!");
960
978
  log.dim(
961
- "Available commands: /cf-ask, /cf-plan, /cf-fix, /cf-commit, /cf-review, /cf-ship, /cf-optimize, /cf-scan, /cf-remember, /cf-learn, /cf-research, /cf-session, /cf-help"
979
+ "Available commands: /cf-ask, /cf-plan, /cf-fix, /cf-commit, /cf-review, /cf-review-out, /cf-review-in, /cf-ship, /cf-optimize, /cf-scan, /cf-remember, /cf-learn, /cf-research, /cf-session, /cf-help"
962
980
  );
963
981
  }
964
982
  export {
@@ -1,29 +1,30 @@
1
1
  import {
2
2
  getLatestVersion,
3
3
  semverCompare
4
- } from "./chunk-ENG3TLQX.js";
4
+ } from "./chunk-PDVSGGH6.js";
5
5
  import {
6
6
  enableMarketplaceAutoUpdate,
7
7
  isMarketplaceRegistered,
8
8
  isPluginDisabled
9
- } from "./chunk-DMVSYXKX.js";
9
+ } from "./chunk-5UEY7HQX.js";
10
10
  import {
11
11
  getInstalledVersion
12
- } from "./chunk-VR3XXOAY.js";
13
- import "./chunk-POC2WHU2.js";
12
+ } from "./chunk-TRIALFOQ.js";
13
+ import "./chunk-PRIH34UB.js";
14
14
  import {
15
15
  ensureShellCompletion
16
- } from "./chunk-NEQZP5D4.js";
16
+ } from "./chunk-PYTEAC6K.js";
17
17
  import {
18
18
  resolveScope
19
- } from "./chunk-RMQKSNH7.js";
19
+ } from "./chunk-BIX7AJU3.js";
20
20
  import {
21
21
  commandExists,
22
22
  run
23
23
  } from "./chunk-EVGXUDX4.js";
24
+ import "./chunk-5UVDWG5L.js";
24
25
  import {
25
26
  devStatePath
26
- } from "./chunk-DQRUD4H7.js";
27
+ } from "./chunk-DO6FV6BL.js";
27
28
  import {
28
29
  log
29
30
  } from "./chunk-W5CD7WTX.js";
@@ -1,14 +1,15 @@
1
1
  import {
2
2
  resolveDocsDir
3
- } from "./chunk-2OOQQESF.js";
3
+ } from "./chunk-SIQJPT47.js";
4
4
  import {
5
5
  getLibPath
6
6
  } from "./chunk-RZRT7NGT.js";
7
- import "./chunk-POC2WHU2.js";
7
+ import "./chunk-PRIH34UB.js";
8
8
  import {
9
9
  run
10
10
  } from "./chunk-EVGXUDX4.js";
11
- import "./chunk-DQRUD4H7.js";
11
+ import "./chunk-5UVDWG5L.js";
12
+ import "./chunk-DO6FV6BL.js";
12
13
  import {
13
14
  log
14
15
  } from "./chunk-W5CD7WTX.js";
@@ -5,27 +5,29 @@ import {
5
5
  editMemoryEmbedding,
6
6
  editMemoryTier,
7
7
  memoryConfigMenu
8
- } from "./chunk-IMFS66LB.js";
8
+ } from "./chunk-3KXYEC2T.js";
9
9
  import {
10
10
  loadConfig,
11
11
  resolveMemoryDir
12
- } from "./chunk-2OOQQESF.js";
12
+ } from "./chunk-SIQJPT47.js";
13
13
  import {
14
14
  getLibPath
15
15
  } from "./chunk-RZRT7NGT.js";
16
- import "./chunk-POC2WHU2.js";
16
+ import "./chunk-PRIH34UB.js";
17
17
  import {
18
18
  showConfigHint
19
- } from "./chunk-RMQKSNH7.js";
19
+ } from "./chunk-BIX7AJU3.js";
20
20
  import {
21
21
  run,
22
22
  runWithStderr
23
23
  } from "./chunk-EVGXUDX4.js";
24
24
  import {
25
- globalConfigPath,
26
- localConfigPath,
27
25
  readJson
28
- } from "./chunk-DQRUD4H7.js";
26
+ } from "./chunk-5UVDWG5L.js";
27
+ import {
28
+ globalConfigPath,
29
+ localConfigPath
30
+ } from "./chunk-DO6FV6BL.js";
29
31
  import {
30
32
  log
31
33
  } from "./chunk-W5CD7WTX.js";
@@ -344,6 +346,29 @@ function getDbPath(memoryDir) {
344
346
  }
345
347
  }
346
348
  var em = chalk.hex("#10b981");
349
+ async function ensureSqliteDepsIfNeeded(mcpDir) {
350
+ const config = loadConfig();
351
+ const tier = config.memory?.tier ?? "auto";
352
+ if (tier === "markdown" || tier === "lite") return true;
353
+ const { ensureDeps, areSqliteDepsAvailable } = await import(join(mcpDir, "dist/lib/lazy-install.js"));
354
+ if (areSqliteDepsAvailable()) return true;
355
+ log.step("Installing SQLite dependencies...");
356
+ const installed = await ensureDeps({
357
+ onProgress: (msg) => log.step(msg)
358
+ });
359
+ if (!installed) {
360
+ log.error("Failed to install SQLite dependencies.");
361
+ log.dim(
362
+ "Ensure you have a C++ compiler installed (Xcode CLT on macOS, build-essential on Linux)."
363
+ );
364
+ log.dim(
365
+ 'Memory will fall back to a lower tier. You can retry later with "cf memory init".'
366
+ );
367
+ return false;
368
+ }
369
+ log.success("Dependencies installed.");
370
+ return true;
371
+ }
347
372
  async function memoryInitCommand() {
348
373
  const memoryDir = getMemoryDir();
349
374
  const mcpDir = getLibPath("cf-memory");
@@ -357,6 +382,7 @@ async function memoryInitCommand() {
357
382
  log.dim('To re-import memories, run "cf memory rebuild".');
358
383
  console.log();
359
384
  await memoryConfigMenu({ exitLabel: "Done" });
385
+ await ensureSqliteDepsIfNeeded(mcpDir);
360
386
  return;
361
387
  }
362
388
  console.log();
@@ -412,26 +438,8 @@ async function memoryInitCommand() {
412
438
  );
413
439
  return;
414
440
  }
415
- log.step("Installing SQLite dependencies...");
416
- const { ensureDeps, areSqliteDepsAvailable } = await import(join(mcpDir, "dist/lib/lazy-install.js"));
417
- if (areSqliteDepsAvailable()) {
418
- log.info("SQLite dependencies already installed.");
419
- } else {
420
- const installed = await ensureDeps({
421
- onProgress: (msg) => log.step(msg)
422
- });
423
- if (!installed) {
424
- log.error("Failed to install SQLite dependencies.");
425
- log.dim(
426
- "Ensure you have a C++ compiler installed (Xcode CLT on macOS, build-essential on Linux)."
427
- );
428
- log.dim(
429
- 'Memory will fall back to a lower tier. You can retry later with "cf memory init".'
430
- );
431
- return;
432
- }
433
- log.success("Dependencies installed.");
434
- }
441
+ const depsOk = await ensureSqliteDepsIfNeeded(mcpDir);
442
+ if (!depsOk) return;
435
443
  if (!existsSync(memoryDir)) {
436
444
  log.info(
437
445
  "No memory directory found. Memories will be indexed as they're created."
@@ -2,15 +2,17 @@ import {
2
2
  STATIC_RULES,
3
3
  applyPermissions,
4
4
  cleanupStalePluginRules,
5
+ extractTag,
5
6
  getAllRules,
6
7
  getExistingRules,
7
8
  groupByCategory,
8
9
  logPluginScriptWarning
9
- } from "./chunk-U3ERRSBC.js";
10
+ } from "./chunk-HEBLANJO.js";
11
+ import "./chunk-5UVDWG5L.js";
10
12
  import {
11
13
  claudeLocalSettingsPath,
12
14
  claudeSettingsPath
13
- } from "./chunk-DQRUD4H7.js";
15
+ } from "./chunk-DO6FV6BL.js";
14
16
  import {
15
17
  log
16
18
  } from "./chunk-W5CD7WTX.js";
@@ -113,12 +115,17 @@ async function interactiveFlow(allRules, existing) {
113
115
  const categoryRules = groups.get(chosen);
114
116
  const selected = await checkbox({
115
117
  message: `${chosen} permissions:`,
116
- choices: categoryRules.map((rule) => ({
117
- name: rule.rule,
118
- value: rule.rule,
119
- checked: enabled.has(rule.rule),
120
- description: colorDescription(rule.description)
121
- }))
118
+ choices: categoryRules.map((rule) => {
119
+ const tag = extractTag(rule.description);
120
+ const colorFn = tag ? TAG_COLORS[tag] ?? chalk.cyan : chalk.cyan;
121
+ const prefix = tag ? `${colorFn(tag)} ` : "";
122
+ return {
123
+ name: `${prefix}${rule.rule}`,
124
+ value: rule.rule,
125
+ checked: enabled.has(rule.rule),
126
+ description: colorDescription(rule.description)
127
+ };
128
+ })
122
129
  });
123
130
  for (const rule of categoryRules) {
124
131
  if (selected.includes(rule.rule)) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ensureShellCompletion
4
- } from "./chunk-NEQZP5D4.js";
4
+ } from "./chunk-PYTEAC6K.js";
5
5
  import "./chunk-W5CD7WTX.js";
6
6
 
7
7
  // src/postinstall.ts
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-2OOQQESF.js";
4
- import "./chunk-POC2WHU2.js";
3
+ } from "./chunk-SIQJPT47.js";
4
+ import "./chunk-PRIH34UB.js";
5
5
  import {
6
- claudeSessionDir,
7
- encodeProjectPath,
8
6
  readJson,
9
- resolvePath,
10
7
  writeJson
11
- } from "./chunk-DQRUD4H7.js";
8
+ } from "./chunk-5UVDWG5L.js";
9
+ import {
10
+ claudeSessionDir,
11
+ encodeProjectPath,
12
+ resolvePath
13
+ } from "./chunk-DO6FV6BL.js";
12
14
  import {
13
15
  log
14
16
  } from "./chunk-W5CD7WTX.js";
@@ -1,36 +1,38 @@
1
1
  import {
2
2
  resolveMemoryDir
3
- } from "./chunk-2OOQQESF.js";
3
+ } from "./chunk-SIQJPT47.js";
4
4
  import {
5
5
  getCliVersion,
6
6
  getLatestCliVersion,
7
7
  getLatestVersion,
8
8
  semverCompare
9
- } from "./chunk-ENG3TLQX.js";
9
+ } from "./chunk-PDVSGGH6.js";
10
10
  import {
11
11
  detectPluginScope,
12
12
  isPluginDisabled
13
- } from "./chunk-DMVSYXKX.js";
13
+ } from "./chunk-5UEY7HQX.js";
14
14
  import {
15
15
  getExistingRules
16
- } from "./chunk-U3ERRSBC.js";
16
+ } from "./chunk-HEBLANJO.js";
17
17
  import {
18
18
  getLibPath
19
19
  } from "./chunk-RZRT7NGT.js";
20
20
  import {
21
21
  getInstalledVersion
22
- } from "./chunk-VR3XXOAY.js";
23
- import "./chunk-POC2WHU2.js";
24
- import "./chunk-NEQZP5D4.js";
25
- import "./chunk-RMQKSNH7.js";
22
+ } from "./chunk-TRIALFOQ.js";
23
+ import "./chunk-PRIH34UB.js";
24
+ import "./chunk-PYTEAC6K.js";
25
+ import "./chunk-BIX7AJU3.js";
26
26
  import "./chunk-EVGXUDX4.js";
27
+ import {
28
+ readJson
29
+ } from "./chunk-5UVDWG5L.js";
27
30
  import {
28
31
  claudeSettingsPath,
29
32
  devStatePath,
30
33
  globalConfigPath,
31
- localConfigPath,
32
- readJson
33
- } from "./chunk-DQRUD4H7.js";
34
+ localConfigPath
35
+ } from "./chunk-DO6FV6BL.js";
34
36
  import "./chunk-W5CD7WTX.js";
35
37
 
36
38
  // src/commands/status.ts
@@ -4,14 +4,15 @@ import {
4
4
  saveStatuslineConfig,
5
5
  selectStatuslineComponents,
6
6
  writeStatuslineSettings
7
- } from "./chunk-VR3XXOAY.js";
7
+ } from "./chunk-TRIALFOQ.js";
8
8
  import {
9
9
  ALL_COMPONENT_IDS
10
- } from "./chunk-POC2WHU2.js";
10
+ } from "./chunk-PRIH34UB.js";
11
11
  import {
12
12
  commandExists
13
13
  } from "./chunk-EVGXUDX4.js";
14
- import "./chunk-DQRUD4H7.js";
14
+ import "./chunk-5UVDWG5L.js";
15
+ import "./chunk-DO6FV6BL.js";
15
16
  import {
16
17
  log
17
18
  } from "./chunk-W5CD7WTX.js";
@@ -52,6 +53,11 @@ async function statuslineCommand() {
52
53
  );
53
54
  }
54
55
  }
56
+ if (components.includes("account") && !components.includes("rate_limit") && !commandExists("jq")) {
57
+ log.warn(
58
+ "Account info requires jq. Install it first, or the statusline will skip account info."
59
+ );
60
+ }
55
61
  saveStatuslineConfig(components);
56
62
  writeStatuslineSettings(result.hookPath);
57
63
  log.success("Statusline configured!");
@@ -1,27 +1,29 @@
1
1
  import {
2
2
  isMarketplaceRegistered,
3
3
  isPluginInstalled
4
- } from "./chunk-DMVSYXKX.js";
4
+ } from "./chunk-5UEY7HQX.js";
5
5
  import {
6
6
  hasShellCompletion,
7
7
  removeShellCompletion
8
- } from "./chunk-NEQZP5D4.js";
8
+ } from "./chunk-PYTEAC6K.js";
9
9
  import {
10
10
  resolveScope
11
- } from "./chunk-RMQKSNH7.js";
11
+ } from "./chunk-BIX7AJU3.js";
12
12
  import {
13
13
  commandExists,
14
14
  run
15
15
  } from "./chunk-EVGXUDX4.js";
16
+ import {
17
+ readJson,
18
+ writeJson
19
+ } from "./chunk-5UVDWG5L.js";
16
20
  import {
17
21
  claudeSettingsPath,
18
22
  devStatePath,
19
23
  globalConfigDir,
20
24
  marketplaceCachePath,
21
- marketplaceClonePath,
22
- readJson,
23
- writeJson
24
- } from "./chunk-DQRUD4H7.js";
25
+ marketplaceClonePath
26
+ } from "./chunk-DO6FV6BL.js";
25
27
  import {
26
28
  log
27
29
  } from "./chunk-W5CD7WTX.js";
@@ -4,13 +4,14 @@ import {
4
4
  getLatestVersion,
5
5
  semverCompare,
6
6
  updateCommand
7
- } from "./chunk-ENG3TLQX.js";
8
- import "./chunk-VR3XXOAY.js";
9
- import "./chunk-POC2WHU2.js";
10
- import "./chunk-NEQZP5D4.js";
11
- import "./chunk-RMQKSNH7.js";
7
+ } from "./chunk-PDVSGGH6.js";
8
+ import "./chunk-TRIALFOQ.js";
9
+ import "./chunk-PRIH34UB.js";
10
+ import "./chunk-PYTEAC6K.js";
11
+ import "./chunk-BIX7AJU3.js";
12
12
  import "./chunk-EVGXUDX4.js";
13
- import "./chunk-DQRUD4H7.js";
13
+ import "./chunk-5UVDWG5L.js";
14
+ import "./chunk-DO6FV6BL.js";
14
15
  import "./chunk-W5CD7WTX.js";
15
16
  export {
16
17
  getCliVersion,
@@ -0,0 +1,91 @@
1
+ import {
2
+ run
3
+ } from "./chunk-EVGXUDX4.js";
4
+ import {
5
+ globalConfigDir
6
+ } from "./chunk-DO6FV6BL.js";
7
+ import {
8
+ log
9
+ } from "./chunk-W5CD7WTX.js";
10
+
11
+ // src/lib/update-check.ts
12
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
13
+ import { join } from "path";
14
+ import chalk from "chalk";
15
+ var UPDATE_CHECK_FILE = "cli-update-check.json";
16
+ var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
17
+ function getUpdateCachePath() {
18
+ return join(globalConfigDir(), UPDATE_CHECK_FILE);
19
+ }
20
+ function readUpdateCache() {
21
+ try {
22
+ const path = getUpdateCachePath();
23
+ if (!existsSync(path)) return null;
24
+ return JSON.parse(readFileSync(path, "utf-8"));
25
+ } catch {
26
+ return null;
27
+ }
28
+ }
29
+ function writeUpdateCache(latestVersion) {
30
+ const dir = globalConfigDir();
31
+ mkdirSync(dir, { recursive: true });
32
+ writeFileSync(
33
+ getUpdateCachePath(),
34
+ JSON.stringify({ lastCheck: Date.now(), latestVersion })
35
+ );
36
+ }
37
+ function isCheckStale(cache, now = Date.now()) {
38
+ if (!cache) return true;
39
+ return now - cache.lastCheck > CHECK_INTERVAL_MS;
40
+ }
41
+ function semverCompare(a, b) {
42
+ const pa = a.split(".").map(Number);
43
+ const pb = b.split(".").map(Number);
44
+ for (let i = 0; i < 3; i++) {
45
+ const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
46
+ if (diff !== 0) return diff > 0 ? 1 : -1;
47
+ }
48
+ return 0;
49
+ }
50
+ function checkAndNotifyCliUpdate(currentVersion, opts = {}) {
51
+ const { autoUpdate = true } = opts;
52
+ try {
53
+ const cache = readUpdateCache();
54
+ let latestVersion = null;
55
+ if (isCheckStale(cache)) {
56
+ latestVersion = run("npm", ["view", "coding-friend-cli", "version"]);
57
+ if (latestVersion) {
58
+ writeUpdateCache(latestVersion);
59
+ }
60
+ } else {
61
+ latestVersion = cache.latestVersion;
62
+ }
63
+ if (!latestVersion) return;
64
+ const cmp = semverCompare(currentVersion, latestVersion);
65
+ if (cmp >= 0) return;
66
+ console.log();
67
+ log.warn(
68
+ `Update available: ${chalk.dim(`v${currentVersion}`)} \u2192 ${chalk.green(`v${latestVersion}`)}. Run ${chalk.cyan("cf update --cli")} to update.`
69
+ );
70
+ if (autoUpdate) {
71
+ log.step("Auto-updating CLI...");
72
+ const result = run("npm", ["install", "-g", "coding-friend-cli@latest"]);
73
+ if (result !== null) {
74
+ log.success(`CLI auto-updated to ${chalk.green(`v${latestVersion}`)}`);
75
+ } else {
76
+ log.dim(
77
+ "Auto-update failed. Run manually: npm install -g coding-friend-cli@latest"
78
+ );
79
+ }
80
+ }
81
+ } catch {
82
+ }
83
+ }
84
+ export {
85
+ CHECK_INTERVAL_MS,
86
+ checkAndNotifyCliUpdate,
87
+ getUpdateCachePath,
88
+ isCheckStale,
89
+ readUpdateCache,
90
+ writeUpdateCache
91
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-friend-cli",
3
- "version": "1.20.2",
3
+ "version": "1.21.1",
4
4
  "description": "CLI for coding-friend — host learning docs, setup MCP server, initialize projects",
5
5
  "type": "module",
6
6
  "bin": {