coding-friend-cli 1.12.1 → 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-ZOOFPF5I.js → chunk-YC6MBHCT.js} +25 -0
- package/dist/{dev-DIWT3AAU.js → dev-DXETYVQB.js} +1 -1
- package/dist/{disable-4CD623UW.js → disable-AOZ7FLZD.js} +1 -1
- package/dist/{enable-QTUP4MMY.js → enable-MJVTT3RU.js} +1 -1
- package/dist/index.js +10 -10
- package/dist/{install-5P2S6XVC.js → install-SNLHV22V.js} +9 -1
- package/dist/{uninstall-7SX73XM5.js → uninstall-2IOZZERP.js} +1 -1
- package/package.json +1 -1
|
@@ -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
|
};
|
package/dist/index.js
CHANGED
|
@@ -14,19 +14,19 @@ 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 () => {
|
|
@@ -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();
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
semverCompare
|
|
4
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";
|
|
@@ -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)...`);
|