coding-friend-cli 1.14.0 → 1.15.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.
|
@@ -172,6 +172,19 @@ async function updateCommand(opts) {
|
|
|
172
172
|
if (newVersion !== currentVersion) break;
|
|
173
173
|
if (i < 2) sleepSync(1e3);
|
|
174
174
|
}
|
|
175
|
+
if (newVersion === currentVersion) {
|
|
176
|
+
log.dim("Marketplace cache may be stale. Trying reinstall...");
|
|
177
|
+
const installArgs = [
|
|
178
|
+
"plugin",
|
|
179
|
+
"install",
|
|
180
|
+
"coding-friend@coding-friend-marketplace"
|
|
181
|
+
];
|
|
182
|
+
if (scope) {
|
|
183
|
+
installArgs.push("--scope", scope);
|
|
184
|
+
}
|
|
185
|
+
run("claude", installArgs);
|
|
186
|
+
newVersion = getInstalledVersion();
|
|
187
|
+
}
|
|
175
188
|
if (newVersion !== currentVersion) {
|
|
176
189
|
log.success(`Plugin updated to ${chalk.green(`v${newVersion}`)}`);
|
|
177
190
|
} else {
|
|
@@ -42,6 +42,16 @@ var PLUGIN_ID = `${PLUGIN_NAME}@${MARKETPLACE_NAME}`;
|
|
|
42
42
|
function getDevState() {
|
|
43
43
|
return readJson(devStatePath());
|
|
44
44
|
}
|
|
45
|
+
function getLocalPluginVersion(localPath) {
|
|
46
|
+
const pluginJsonPath = resolve(
|
|
47
|
+
localPath,
|
|
48
|
+
"plugin",
|
|
49
|
+
".claude-plugin",
|
|
50
|
+
"plugin.json"
|
|
51
|
+
);
|
|
52
|
+
const data = readJson(pluginJsonPath);
|
|
53
|
+
return data?.version ?? null;
|
|
54
|
+
}
|
|
45
55
|
function ensureClaude() {
|
|
46
56
|
if (!commandExists("claude")) {
|
|
47
57
|
log.error(
|
|
@@ -74,9 +84,13 @@ async function devOnCommand(path) {
|
|
|
74
84
|
log.dim("Make sure you point to the coding-friend repo root.");
|
|
75
85
|
return;
|
|
76
86
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
const version = getLocalPluginVersion(localPath);
|
|
88
|
+
const versionLabel = version ? ` ${chalk.dim(`(v${version})`)}` : "";
|
|
89
|
+
console.log(
|
|
90
|
+
`
|
|
91
|
+
=== ${chalk.green("Switching to local dev mode")}${versionLabel} ===
|
|
92
|
+
`
|
|
93
|
+
);
|
|
80
94
|
log.info(`Local path: ${chalk.cyan(localPath)}`);
|
|
81
95
|
if (isPluginInstalled()) {
|
|
82
96
|
if (!runClaude(
|
|
@@ -117,7 +131,7 @@ async function devOnCommand(path) {
|
|
|
117
131
|
ensureShellCompletion({ silent: true });
|
|
118
132
|
console.log();
|
|
119
133
|
log.success(
|
|
120
|
-
`Dev mode ${chalk.green("ON")} \u2014 using local plugin from ${chalk.cyan(localPath)}`
|
|
134
|
+
`Dev mode ${chalk.green("ON")} \u2014 using local plugin${versionLabel} from ${chalk.cyan(localPath)}`
|
|
121
135
|
);
|
|
122
136
|
log.dim("Restart Claude Code to see changes.");
|
|
123
137
|
}
|
|
@@ -247,8 +261,10 @@ async function devReinstall(path, label) {
|
|
|
247
261
|
const state = getDevState();
|
|
248
262
|
if (!ensureClaude()) return;
|
|
249
263
|
const localPath = path ?? state?.localPath;
|
|
264
|
+
const version = localPath ? getLocalPluginVersion(localPath) : null;
|
|
265
|
+
const versionLabel = version ? ` ${chalk.dim(`(v${version})`)}` : "";
|
|
250
266
|
console.log(`
|
|
251
|
-
=== ${chalk.cyan(label)} ===
|
|
267
|
+
=== ${chalk.cyan(label)}${versionLabel} ===
|
|
252
268
|
`);
|
|
253
269
|
if (state) {
|
|
254
270
|
await devOffCommand();
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ 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-EIN7Z5V3.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) => {
|
|
@@ -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-IZ5UEKZN.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-WJ5QQ35B.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-WJ5QQ35B.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-WJ5QQ35B.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-WJ5QQ35B.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-WJ5QQ35B.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-WJ5QQ35B.js");
|
|
121
121
|
await devUpdateCommand(path);
|
|
122
122
|
});
|
|
123
123
|
program.parse();
|