coding-friend-cli 1.12.0 → 1.13.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-YZ7IZ46F.js → chunk-E76PLDNS.js} +20 -8
- package/dist/{chunk-EMAINEYB.js → chunk-PYRGNY5P.js} +1 -1
- package/dist/{chunk-UFGNO6CW.js → chunk-X5WEODUD.js} +18 -0
- package/dist/{chunk-ZOOFPF5I.js → chunk-YC6MBHCT.js} +25 -0
- package/dist/{config-PTMK6XBN.js → config-F6QRCOYP.js} +2 -2
- package/dist/{dev-UBYW6NRX.js → dev-DXETYVQB.js} +2 -2
- package/dist/{disable-3N2NCMTU.js → disable-AOZ7FLZD.js} +3 -3
- package/dist/{enable-EGG6LTXD.js → enable-MJVTT3RU.js} +3 -3
- package/dist/{host-XHBUWGAW.js → host-D3GAQ4BW.js} +1 -1
- package/dist/index.js +15 -15
- package/dist/{init-2LMIUWUY.js → init-SIZ5RXE7.js} +2 -2
- package/dist/{install-FEOOFN4G.js → install-SNLHV22V.js} +12 -4
- package/dist/{mcp-XE6NZRPD.js → mcp-H42K6Y6T.js} +1 -1
- package/dist/{uninstall-2SYDCOAP.js → uninstall-2IOZZERP.js} +3 -3
- package/dist/{update-4MNVBTI5.js → update-VZZ3SNCZ.js} +3 -3
- package/package.json +1 -1
|
@@ -7,12 +7,13 @@ import {
|
|
|
7
7
|
} from "./chunk-KJUGTLPQ.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveScope
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PYRGNY5P.js";
|
|
11
11
|
import {
|
|
12
12
|
commandExists,
|
|
13
13
|
run,
|
|
14
|
+
runWithStderr,
|
|
14
15
|
sleepSync
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-X5WEODUD.js";
|
|
16
17
|
import {
|
|
17
18
|
claudeSettingsPath,
|
|
18
19
|
readJson
|
|
@@ -156,24 +157,35 @@ async function updateCommand(opts) {
|
|
|
156
157
|
if (scope) {
|
|
157
158
|
updateArgs.push("--scope", scope);
|
|
158
159
|
}
|
|
159
|
-
const result =
|
|
160
|
-
if (result
|
|
160
|
+
const result = runWithStderr("claude", updateArgs);
|
|
161
|
+
if (result.exitCode !== 0) {
|
|
161
162
|
log.error(
|
|
162
163
|
"Plugin update failed. Try manually: claude plugin update coding-friend@coding-friend-marketplace"
|
|
163
164
|
);
|
|
165
|
+
if (result.stderr) {
|
|
166
|
+
log.dim(`stderr: ${result.stderr}`);
|
|
167
|
+
}
|
|
164
168
|
} else {
|
|
165
|
-
log.success("Plugin updated!");
|
|
166
169
|
let newVersion = currentVersion;
|
|
167
|
-
for (let i = 0; i <
|
|
170
|
+
for (let i = 0; i < 3; i++) {
|
|
168
171
|
newVersion = getInstalledVersion();
|
|
169
172
|
if (newVersion !== currentVersion) break;
|
|
170
|
-
if (i <
|
|
173
|
+
if (i < 2) sleepSync(1e3);
|
|
171
174
|
}
|
|
172
175
|
if (newVersion !== currentVersion) {
|
|
173
176
|
log.success(`Plugin updated to ${chalk.green(`v${newVersion}`)}`);
|
|
174
177
|
} else {
|
|
175
178
|
log.warn(
|
|
176
|
-
"
|
|
179
|
+
"Plugin command succeeded but version in installed_plugins.json is still unchanged."
|
|
180
|
+
);
|
|
181
|
+
if (result.stdout) {
|
|
182
|
+
log.dim(`stdout: ${result.stdout}`);
|
|
183
|
+
}
|
|
184
|
+
if (result.stderr) {
|
|
185
|
+
log.dim(`stderr: ${result.stderr}`);
|
|
186
|
+
}
|
|
187
|
+
log.dim(
|
|
188
|
+
"Try manually: claude plugin update coding-friend@coding-friend-marketplace"
|
|
177
189
|
);
|
|
178
190
|
}
|
|
179
191
|
}
|
|
@@ -11,6 +11,23 @@ function run(cmd, args = [], opts) {
|
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
function runWithStderr(cmd, args = [], opts) {
|
|
15
|
+
try {
|
|
16
|
+
const stdout = execFileSync(cmd, args, {
|
|
17
|
+
encoding: "utf-8",
|
|
18
|
+
cwd: opts?.cwd,
|
|
19
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
20
|
+
}).trim();
|
|
21
|
+
return { stdout, stderr: "", exitCode: 0 };
|
|
22
|
+
} catch (err) {
|
|
23
|
+
const e = err;
|
|
24
|
+
return {
|
|
25
|
+
stdout: (e.stdout ?? "").toString().trim(),
|
|
26
|
+
stderr: (e.stderr ?? "").toString().trim(),
|
|
27
|
+
exitCode: e.status ?? 1
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
14
31
|
function streamExec(cmd, args, opts) {
|
|
15
32
|
return new Promise((resolve, reject) => {
|
|
16
33
|
const child = spawn(cmd, args, {
|
|
@@ -30,6 +47,7 @@ function commandExists(cmd) {
|
|
|
30
47
|
|
|
31
48
|
export {
|
|
32
49
|
run,
|
|
50
|
+
runWithStderr,
|
|
33
51
|
streamExec,
|
|
34
52
|
sleepSync,
|
|
35
53
|
commandExists
|
|
@@ -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
|
};
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
getScopeLabel,
|
|
24
24
|
injectBackChoice,
|
|
25
25
|
showConfigHint
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-PYRGNY5P.js";
|
|
27
27
|
import {
|
|
28
28
|
run
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-X5WEODUD.js";
|
|
30
30
|
import {
|
|
31
31
|
globalConfigPath,
|
|
32
32
|
localConfigPath,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isMarketplaceRegistered,
|
|
3
3
|
isPluginInstalled
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YC6MBHCT.js";
|
|
5
5
|
import {
|
|
6
6
|
ensureStatusline
|
|
7
7
|
} from "./chunk-QG6XYVJU.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
commandExists,
|
|
14
14
|
run
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X5WEODUD.js";
|
|
16
16
|
import {
|
|
17
17
|
devStatePath,
|
|
18
18
|
knownMarketplacesPath,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isPluginDisabled,
|
|
3
3
|
setPluginEnabled
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YC6MBHCT.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveScope
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-PYRGNY5P.js";
|
|
8
|
+
import "./chunk-X5WEODUD.js";
|
|
9
9
|
import "./chunk-RWUTFVRB.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isPluginDisabled,
|
|
3
3
|
setPluginEnabled
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YC6MBHCT.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveScope
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-PYRGNY5P.js";
|
|
8
|
+
import "./chunk-X5WEODUD.js";
|
|
9
9
|
import "./chunk-RWUTFVRB.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
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-SNLHV22V.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-SIZ5RXE7.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-F6QRCOYP.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-D3GAQ4BW.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-H42K6Y6T.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) => {
|
|
@@ -54,7 +54,7 @@ program.command("statusline").description("Setup coding-friend statusline in Cla
|
|
|
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-VZZ3SNCZ.js");
|
|
58
58
|
await updateCommand(opts);
|
|
59
59
|
});
|
|
60
60
|
var session = program.command("session").description("Save and load Claude Code sessions across machines");
|
|
@@ -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-DXETYVQB.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-DXETYVQB.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-DXETYVQB.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-DXETYVQB.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-DXETYVQB.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-DXETYVQB.js");
|
|
121
121
|
await devUpdateCommand(path);
|
|
122
122
|
});
|
|
123
123
|
program.parse();
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
getScopeLabel,
|
|
28
28
|
injectBackChoice,
|
|
29
29
|
showConfigHint
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-PYRGNY5P.js";
|
|
31
31
|
import {
|
|
32
32
|
run
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-X5WEODUD.js";
|
|
34
34
|
import {
|
|
35
35
|
claudeSettingsPath,
|
|
36
36
|
globalConfigPath,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLatestVersion,
|
|
3
3
|
semverCompare
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-E76PLDNS.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
12
|
} from "./chunk-QG6XYVJU.js";
|
|
@@ -15,11 +16,11 @@ import {
|
|
|
15
16
|
} from "./chunk-KJUGTLPQ.js";
|
|
16
17
|
import {
|
|
17
18
|
resolveScope
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PYRGNY5P.js";
|
|
19
20
|
import {
|
|
20
21
|
commandExists,
|
|
21
22
|
run
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-X5WEODUD.js";
|
|
23
24
|
import {
|
|
24
25
|
devStatePath
|
|
25
26
|
} from "./chunk-RWUTFVRB.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)...`);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isMarketplaceRegistered,
|
|
3
3
|
isPluginInstalled
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YC6MBHCT.js";
|
|
5
5
|
import {
|
|
6
6
|
hasShellCompletion,
|
|
7
7
|
removeShellCompletion
|
|
8
8
|
} from "./chunk-KJUGTLPQ.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveScope
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PYRGNY5P.js";
|
|
12
12
|
import {
|
|
13
13
|
commandExists,
|
|
14
14
|
run
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X5WEODUD.js";
|
|
16
16
|
import {
|
|
17
17
|
claudeSettingsPath,
|
|
18
18
|
devStatePath,
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
getLatestVersion,
|
|
3
3
|
semverCompare,
|
|
4
4
|
updateCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-E76PLDNS.js";
|
|
6
6
|
import "./chunk-QG6XYVJU.js";
|
|
7
7
|
import "./chunk-PGLUEN7D.js";
|
|
8
8
|
import "./chunk-KJUGTLPQ.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-PYRGNY5P.js";
|
|
10
|
+
import "./chunk-X5WEODUD.js";
|
|
11
11
|
import "./chunk-RWUTFVRB.js";
|
|
12
12
|
import "./chunk-W5CD7WTX.js";
|
|
13
13
|
export {
|