coding-friend-cli 1.12.1 → 1.14.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.
- package/dist/{chunk-KB4JM2EB.js → chunk-4DB4XTSL.js} +1 -1
- package/dist/{chunk-E76PLDNS.js → chunk-IZFUAIP3.js} +1 -1
- package/dist/{chunk-QG6XYVJU.js → chunk-ORACWEDN.js} +2 -2
- package/dist/{chunk-PGLUEN7D.js → chunk-POC2WHU2.js} +4 -1
- package/dist/{chunk-ZOOFPF5I.js → chunk-YC6MBHCT.js} +25 -0
- package/dist/{config-F6QRCOYP.js → config-UQ742WPQ.js} +2 -2
- package/dist/{dev-DIWT3AAU.js → dev-X7OJPTTW.js} +3 -3
- package/dist/{disable-4CD623UW.js → disable-AOZ7FLZD.js} +1 -1
- package/dist/{enable-QTUP4MMY.js → enable-MJVTT3RU.js} +1 -1
- package/dist/{host-D3GAQ4BW.js → host-NA7LZ4HX.js} +2 -2
- package/dist/index.js +18 -18
- package/dist/{init-SIZ5RXE7.js → init-AHIEQ27W.js} +13 -2
- package/dist/{install-5P2S6XVC.js → install-YXZGP2MY.js} +12 -4
- package/dist/{mcp-H42K6Y6T.js → mcp-DLS3J6QJ.js} +2 -2
- package/dist/{session-K6YWJLLU.js → session-E3CZJJZQ.js} +2 -2
- package/dist/{statusline-5ZMM3RYY.js → statusline-6HQCDWBD.js} +15 -2
- package/dist/{uninstall-7SX73XM5.js → uninstall-2IOZZERP.js} +1 -1
- package/dist/{update-VZZ3SNCZ.js → update-OADURRFT.js} +3 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ALL_COMPONENT_IDS,
|
|
3
3
|
STATUSLINE_COMPONENTS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-POC2WHU2.js";
|
|
5
5
|
import {
|
|
6
6
|
claudeSettingsPath,
|
|
7
7
|
globalConfigPath,
|
|
@@ -54,7 +54,7 @@ function loadStatuslineComponents() {
|
|
|
54
54
|
const config = readJson(globalConfigPath());
|
|
55
55
|
const components = config?.statusline?.components;
|
|
56
56
|
if (!components) return ALL_COMPONENT_IDS;
|
|
57
|
-
return components.filter(
|
|
57
|
+
return components.map((c) => c === "usage" ? "rate_limit" : c).filter(
|
|
58
58
|
(c) => ALL_COMPONENT_IDS.includes(c)
|
|
59
59
|
);
|
|
60
60
|
}
|
|
@@ -5,7 +5,10 @@ var STATUSLINE_COMPONENTS = [
|
|
|
5
5
|
{ id: "model", label: "Active model (Opus 4.6)" },
|
|
6
6
|
{ id: "branch", label: "Git branch (\u2387 main)" },
|
|
7
7
|
{ id: "context", label: "Context window usage (ctx 42%)" },
|
|
8
|
-
{
|
|
8
|
+
{
|
|
9
|
+
id: "rate_limit",
|
|
10
|
+
label: "Rate limit \u2014 current & weekly usage (requires curl & jq)"
|
|
11
|
+
}
|
|
9
12
|
];
|
|
10
13
|
var ALL_COMPONENT_IDS = STATUSLINE_COMPONENTS.map((c) => c.id);
|
|
11
14
|
var DEFAULT_CONFIG = {
|
|
@@ -42,6 +42,30 @@ function isPluginDisabled(scope) {
|
|
|
42
42
|
if (!enabled) return false;
|
|
43
43
|
return enabled[PLUGIN_ID] === false;
|
|
44
44
|
}
|
|
45
|
+
function enableMarketplaceAutoUpdate() {
|
|
46
|
+
try {
|
|
47
|
+
const filePath = claudeSettingsPath();
|
|
48
|
+
const settings = readJson(filePath) ?? {};
|
|
49
|
+
const marketplaces = settings.extraKnownMarketplaces ?? {};
|
|
50
|
+
const entry = marketplaces[MARKETPLACE_NAME];
|
|
51
|
+
if (entry && entry.autoUpdate === true) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (entry) {
|
|
55
|
+
entry.autoUpdate = true;
|
|
56
|
+
} else {
|
|
57
|
+
marketplaces[MARKETPLACE_NAME] = {
|
|
58
|
+
source: { source: "github", repo: "dinhanhthi/coding-friend" },
|
|
59
|
+
autoUpdate: true
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
settings.extraKnownMarketplaces = marketplaces;
|
|
63
|
+
writeJson(filePath, settings);
|
|
64
|
+
return true;
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
45
69
|
function setPluginEnabled(scope, enabled) {
|
|
46
70
|
const filePath = settingsPathForScope(scope);
|
|
47
71
|
const settings = readJson(filePath) ?? {};
|
|
@@ -64,5 +88,6 @@ export {
|
|
|
64
88
|
isPluginInstalled,
|
|
65
89
|
isMarketplaceRegistered,
|
|
66
90
|
isPluginDisabled,
|
|
91
|
+
enableMarketplaceAutoUpdate,
|
|
67
92
|
setPluginEnabled
|
|
68
93
|
};
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
saveStatuslineConfig,
|
|
5
5
|
selectStatuslineComponents,
|
|
6
6
|
writeStatuslineSettings
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ORACWEDN.js";
|
|
8
8
|
import {
|
|
9
9
|
ALL_COMPONENT_IDS,
|
|
10
10
|
DEFAULT_CONFIG
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-POC2WHU2.js";
|
|
12
12
|
import {
|
|
13
13
|
ensureShellCompletion,
|
|
14
14
|
hasShellCompletion,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isMarketplaceRegistered,
|
|
3
3
|
isPluginInstalled
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YC6MBHCT.js";
|
|
5
5
|
import {
|
|
6
6
|
ensureStatusline
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-ORACWEDN.js";
|
|
8
|
+
import "./chunk-POC2WHU2.js";
|
|
9
9
|
import {
|
|
10
10
|
ensureShellCompletion
|
|
11
11
|
} from "./chunk-KJUGTLPQ.js";
|
package/dist/index.js
CHANGED
|
@@ -14,35 +14,35 @@ 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-
|
|
17
|
+
const { installCommand } = await import("./install-YXZGP2MY.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-
|
|
21
|
+
const { uninstallCommand } = await import("./uninstall-2IOZZERP.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-
|
|
25
|
+
const { disableCommand } = await import("./disable-AOZ7FLZD.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-
|
|
29
|
+
const { enableCommand } = await import("./enable-MJVTT3RU.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-
|
|
33
|
+
const { initCommand } = await import("./init-AHIEQ27W.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-
|
|
37
|
+
const { configCommand } = await import("./config-UQ742WPQ.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-
|
|
41
|
+
const { hostCommand } = await import("./host-NA7LZ4HX.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-
|
|
45
|
+
const { mcpCommand } = await import("./mcp-DLS3J6QJ.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").action(async (opts) => {
|
|
@@ -50,11 +50,11 @@ program.command("permission").description("Manage Claude Code permission rules f
|
|
|
50
50
|
await permissionCommand(opts);
|
|
51
51
|
});
|
|
52
52
|
program.command("statusline").description("Setup coding-friend statusline in Claude Code").action(async () => {
|
|
53
|
-
const { statuslineCommand } = await import("./statusline-
|
|
53
|
+
const { statuslineCommand } = await import("./statusline-6HQCDWBD.js");
|
|
54
54
|
await statuslineCommand();
|
|
55
55
|
});
|
|
56
56
|
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) => {
|
|
57
|
-
const { updateCommand } = await import("./update-
|
|
57
|
+
const { updateCommand } = await import("./update-OADURRFT.js");
|
|
58
58
|
await updateCommand(opts);
|
|
59
59
|
});
|
|
60
60
|
var session = program.command("session").description("Save and load Claude Code sessions across machines");
|
|
@@ -69,11 +69,11 @@ session.command("save").description("Save current Claude Code session to sync fo
|
|
|
69
69
|
"-s, --session-id <id>",
|
|
70
70
|
"session UUID to save (default: auto-detect newest)"
|
|
71
71
|
).option("-l, --label <label>", "label for this session").action(async (opts) => {
|
|
72
|
-
const { sessionSaveCommand } = await import("./session-
|
|
72
|
+
const { sessionSaveCommand } = await import("./session-E3CZJJZQ.js");
|
|
73
73
|
await sessionSaveCommand(opts);
|
|
74
74
|
});
|
|
75
75
|
session.command("load").description("Load a saved session from sync folder").action(async () => {
|
|
76
|
-
const { sessionLoadCommand } = await import("./session-
|
|
76
|
+
const { sessionLoadCommand } = await import("./session-E3CZJJZQ.js");
|
|
77
77
|
await sessionLoadCommand();
|
|
78
78
|
});
|
|
79
79
|
var dev = program.command("dev").description("Development mode commands");
|
|
@@ -89,35 +89,35 @@ Dev subcommands:
|
|
|
89
89
|
dev update [path] Update local dev plugin to latest version`
|
|
90
90
|
);
|
|
91
91
|
dev.command("on").description("Switch to local plugin source").argument("[path]", "path to local coding-friend repo (default: cwd)").action(async (path) => {
|
|
92
|
-
const { devOnCommand } = await import("./dev-
|
|
92
|
+
const { devOnCommand } = await import("./dev-X7OJPTTW.js");
|
|
93
93
|
await devOnCommand(path);
|
|
94
94
|
});
|
|
95
95
|
dev.command("off").description("Switch back to remote marketplace").action(async () => {
|
|
96
|
-
const { devOffCommand } = await import("./dev-
|
|
96
|
+
const { devOffCommand } = await import("./dev-X7OJPTTW.js");
|
|
97
97
|
await devOffCommand();
|
|
98
98
|
});
|
|
99
99
|
dev.command("status").description("Show current dev mode").action(async () => {
|
|
100
|
-
const { devStatusCommand } = await import("./dev-
|
|
100
|
+
const { devStatusCommand } = await import("./dev-X7OJPTTW.js");
|
|
101
101
|
await devStatusCommand();
|
|
102
102
|
});
|
|
103
103
|
dev.command("sync").description(
|
|
104
104
|
"Copy local source files to plugin cache (no version bump needed)"
|
|
105
105
|
).action(async () => {
|
|
106
|
-
const { devSyncCommand } = await import("./dev-
|
|
106
|
+
const { devSyncCommand } = await import("./dev-X7OJPTTW.js");
|
|
107
107
|
await devSyncCommand();
|
|
108
108
|
});
|
|
109
109
|
dev.command("restart").description("Reinstall local dev plugin (off + on)").argument(
|
|
110
110
|
"[path]",
|
|
111
111
|
"path to local coding-friend repo (default: saved path or cwd)"
|
|
112
112
|
).action(async (path) => {
|
|
113
|
-
const { devRestartCommand } = await import("./dev-
|
|
113
|
+
const { devRestartCommand } = await import("./dev-X7OJPTTW.js");
|
|
114
114
|
await devRestartCommand(path);
|
|
115
115
|
});
|
|
116
116
|
dev.command("update").description("Update local dev plugin to latest version (off + on)").argument(
|
|
117
117
|
"[path]",
|
|
118
118
|
"path to local coding-friend repo (default: saved path or cwd)"
|
|
119
119
|
).action(async (path) => {
|
|
120
|
-
const { devUpdateCommand } = await import("./dev-
|
|
120
|
+
const { devUpdateCommand } = await import("./dev-X7OJPTTW.js");
|
|
121
121
|
await devUpdateCommand(path);
|
|
122
122
|
});
|
|
123
123
|
program.parse();
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
saveStatuslineConfig,
|
|
11
11
|
selectStatuslineComponents,
|
|
12
12
|
writeStatuslineSettings
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ORACWEDN.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_CONFIG
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-POC2WHU2.js";
|
|
17
17
|
import {
|
|
18
18
|
ensureShellCompletion,
|
|
19
19
|
hasShellCompletion
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
showConfigHint
|
|
30
30
|
} from "./chunk-PYRGNY5P.js";
|
|
31
31
|
import {
|
|
32
|
+
commandExists,
|
|
32
33
|
run
|
|
33
34
|
} from "./chunk-X5WEODUD.js";
|
|
34
35
|
import {
|
|
@@ -409,6 +410,16 @@ async function stepStatusline() {
|
|
|
409
410
|
return;
|
|
410
411
|
}
|
|
411
412
|
const components = await selectStatuslineComponents();
|
|
413
|
+
if (components.includes("rate_limit")) {
|
|
414
|
+
const missing = [];
|
|
415
|
+
if (!commandExists("curl")) missing.push("curl");
|
|
416
|
+
if (!commandExists("jq")) missing.push("jq");
|
|
417
|
+
if (missing.length > 0) {
|
|
418
|
+
log.warn(
|
|
419
|
+
`Rate limit requires ${missing.join(" & ")}. Install them first, or the statusline will show a warning instead.`
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
412
423
|
saveStatuslineConfig(components);
|
|
413
424
|
writeStatuslineSettings(hookResult.hookPath);
|
|
414
425
|
log.success("Statusline configured!");
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLatestVersion,
|
|
3
3
|
semverCompare
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IZFUAIP3.js";
|
|
5
5
|
import {
|
|
6
|
+
enableMarketplaceAutoUpdate,
|
|
6
7
|
isMarketplaceRegistered,
|
|
7
8
|
isPluginDisabled
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YC6MBHCT.js";
|
|
9
10
|
import {
|
|
10
11
|
getInstalledVersion
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-ORACWEDN.js";
|
|
13
|
+
import "./chunk-POC2WHU2.js";
|
|
13
14
|
import {
|
|
14
15
|
ensureShellCompletion
|
|
15
16
|
} from "./chunk-KJUGTLPQ.js";
|
|
@@ -65,6 +66,13 @@ async function installCommand(opts = {}) {
|
|
|
65
66
|
}
|
|
66
67
|
log.success("Marketplace added.");
|
|
67
68
|
}
|
|
69
|
+
if (enableMarketplaceAutoUpdate()) {
|
|
70
|
+
log.success("Auto-update enabled for coding-friend plugin.");
|
|
71
|
+
} else {
|
|
72
|
+
log.warn(
|
|
73
|
+
`Cannot make plugin auto-update. Please enable it manually: ${chalk.cyan("https://cf.dinhanhthi.com/docs/getting-started/installation/")}`
|
|
74
|
+
);
|
|
75
|
+
}
|
|
68
76
|
const installedVersion = getInstalledVersion();
|
|
69
77
|
if (!installedVersion || scope !== "user") {
|
|
70
78
|
log.step(`Installing plugin (${chalk.cyan(scope)} scope)...`);
|
|
@@ -4,10 +4,13 @@ import {
|
|
|
4
4
|
saveStatuslineConfig,
|
|
5
5
|
selectStatuslineComponents,
|
|
6
6
|
writeStatuslineSettings
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ORACWEDN.js";
|
|
8
8
|
import {
|
|
9
9
|
ALL_COMPONENT_IDS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-POC2WHU2.js";
|
|
11
|
+
import {
|
|
12
|
+
commandExists
|
|
13
|
+
} from "./chunk-X5WEODUD.js";
|
|
11
14
|
import "./chunk-RWUTFVRB.js";
|
|
12
15
|
import {
|
|
13
16
|
log
|
|
@@ -39,6 +42,16 @@ async function statuslineCommand() {
|
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
const components = await selectStatuslineComponents();
|
|
45
|
+
if (components.includes("rate_limit")) {
|
|
46
|
+
const missing = [];
|
|
47
|
+
if (!commandExists("curl")) missing.push("curl");
|
|
48
|
+
if (!commandExists("jq")) missing.push("jq");
|
|
49
|
+
if (missing.length > 0) {
|
|
50
|
+
log.warn(
|
|
51
|
+
`Rate limit requires ${missing.join(" & ")}. Install them first, or the statusline will show a warning instead.`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
42
55
|
saveStatuslineConfig(components);
|
|
43
56
|
writeStatuslineSettings(result.hookPath);
|
|
44
57
|
log.success("Statusline configured!");
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
getLatestVersion,
|
|
3
3
|
semverCompare,
|
|
4
4
|
updateCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-IZFUAIP3.js";
|
|
6
|
+
import "./chunk-ORACWEDN.js";
|
|
7
|
+
import "./chunk-POC2WHU2.js";
|
|
8
8
|
import "./chunk-KJUGTLPQ.js";
|
|
9
9
|
import "./chunk-PYRGNY5P.js";
|
|
10
10
|
import "./chunk-X5WEODUD.js";
|