zcf 2.9.5 → 2.9.6
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/README.md +3 -0
- package/dist/chunks/simple-config.mjs +6 -2
- package/dist/cli.mjs +19 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ Menu options include:
|
|
|
27
27
|
- `3-7` Configuration management (API/CCR, MCP, Model settings, AI personality, etc.)
|
|
28
28
|
- `R` Claude Code Router management (enhanced in v2.8.1)
|
|
29
29
|
- `U` ccusage - Claude Code usage analysis
|
|
30
|
+
- `+` Check updates - Check and update Claude Code and CCR versions
|
|
30
31
|
- More features...
|
|
31
32
|
|
|
32
33
|
### Or, use direct commands:
|
|
@@ -86,6 +87,8 @@ Check for updates (v2.8.1+):
|
|
|
86
87
|
|
|
87
88
|
```bash
|
|
88
89
|
npx zcf check-updates # Check and update Claude Code and CCR to latest versions
|
|
90
|
+
# or
|
|
91
|
+
npx zcf → select +
|
|
89
92
|
```
|
|
90
93
|
|
|
91
94
|
CCR menu options:
|
|
@@ -18,7 +18,7 @@ import { promisify as promisify$1 } from 'node:util';
|
|
|
18
18
|
import { homedir, platform } from 'node:os';
|
|
19
19
|
import { join as join$2 } from 'node:path';
|
|
20
20
|
|
|
21
|
-
const version = "2.9.
|
|
21
|
+
const version = "2.9.6";
|
|
22
22
|
const homepage = "https://github.com/UfoMiao/zcf";
|
|
23
23
|
|
|
24
24
|
const common$1 = {
|
|
@@ -218,6 +218,7 @@ const menu$1 = {
|
|
|
218
218
|
ccusage: "ccusage",
|
|
219
219
|
installBmad: "\u5B89\u88C5 BMad Method",
|
|
220
220
|
clearCache: "\u6E05\u9664\u504F\u597D\u7F13\u5B58",
|
|
221
|
+
checkUpdates: "\u68C0\u67E5\u66F4\u65B0",
|
|
221
222
|
changeLanguage: "\u66F4\u6539\u663E\u793A\u8BED\u8A00 / Select display language",
|
|
222
223
|
exit: "\u9000\u51FA"
|
|
223
224
|
},
|
|
@@ -235,6 +236,7 @@ const menu$1 = {
|
|
|
235
236
|
ccusage: "Claude Code \u7528\u91CF\u5206\u6790",
|
|
236
237
|
installBmad: "AI \u9A71\u52A8\u7684\u5F00\u53D1\u65B9\u6CD5\u8BBA\u6846\u67B6",
|
|
237
238
|
clearCache: "\u6E05\u9664\u504F\u597D\u8BED\u8A00\u7B49\u7F13\u5B58",
|
|
239
|
+
checkUpdates: "\u68C0\u67E5\u5E76\u66F4\u65B0 Claude Code \u548C CCR \u7684\u7248\u672C",
|
|
238
240
|
changeLanguage: "\u66F4\u6539 ZCF \u754C\u9762\u8BED\u8A00"
|
|
239
241
|
}
|
|
240
242
|
};
|
|
@@ -683,6 +685,7 @@ const menu = {
|
|
|
683
685
|
ccusage: "ccusage",
|
|
684
686
|
installBmad: "Install BMad Method",
|
|
685
687
|
clearCache: "Clear preference cache",
|
|
688
|
+
checkUpdates: "Check updates",
|
|
686
689
|
changeLanguage: "Select display language / \u66F4\u6539\u663E\u793A\u8BED\u8A00",
|
|
687
690
|
exit: "Exit"
|
|
688
691
|
},
|
|
@@ -700,6 +703,7 @@ const menu = {
|
|
|
700
703
|
ccusage: "Claude Code usage analysis",
|
|
701
704
|
installBmad: "AI-driven development methodology framework",
|
|
702
705
|
clearCache: "Clear preference language and other caches",
|
|
706
|
+
checkUpdates: "Check and update Claude Code and CCR versions",
|
|
703
707
|
changeLanguage: "Change ZCF interface language"
|
|
704
708
|
}
|
|
705
709
|
};
|
|
@@ -3415,4 +3419,4 @@ async function openSettingsJson() {
|
|
|
3415
3419
|
}
|
|
3416
3420
|
}
|
|
3417
3421
|
|
|
3418
|
-
export { readCcrConfig as $, AI_OUTPUT_LANGUAGES as A, writeMcpConfig as B, CLAUDE_DIR as C, backupMcpConfig as D, mergeMcpServers as E, buildMcpServerConfig as F, fixWindowsMcpConfig as G, addCompletedOnboarding as H, I18N as I, getTranslation as J, addNumbersToChoices as K, LEGACY_ZCF_CONFIG_FILE as L, MCP_SERVICES as M, updateZcfConfig as N, readZcfConfig as O, configureAiPersonality as P, isWindows as Q, selectMcpServices as R, SETTINGS_FILE as S, formatApiKeyDisplay as T, modifyApiConfigPartially as U, isCcrInstalled as V, installCcr as W, setupCcrConfiguration as X, validateApiKey as Y, ZCF_CONFIG_FILE as Z, readZcfConfigAsync as _, importRecommendedEnv as a, configureCcrFeature as a0, handleExitPromptError as a1, handleGeneralError as a2, displayBanner as a3, selectScriptLanguage as a4, resolveAiOutputLanguage as a5, updatePromptOnly as a6, selectAndInstallWorkflows as a7, version as a8,
|
|
3422
|
+
export { readCcrConfig as $, AI_OUTPUT_LANGUAGES as A, writeMcpConfig as B, CLAUDE_DIR as C, backupMcpConfig as D, mergeMcpServers as E, buildMcpServerConfig as F, fixWindowsMcpConfig as G, addCompletedOnboarding as H, I18N as I, getTranslation as J, addNumbersToChoices as K, LEGACY_ZCF_CONFIG_FILE as L, MCP_SERVICES as M, updateZcfConfig as N, readZcfConfig as O, configureAiPersonality as P, isWindows as Q, selectMcpServices as R, SETTINGS_FILE as S, formatApiKeyDisplay as T, modifyApiConfigPartially as U, isCcrInstalled as V, installCcr as W, setupCcrConfiguration as X, validateApiKey as Y, ZCF_CONFIG_FILE as Z, readZcfConfigAsync as _, importRecommendedEnv as a, configureCcrFeature as a0, handleExitPromptError as a1, handleGeneralError as a2, displayBanner as a3, selectScriptLanguage as a4, resolveAiOutputLanguage as a5, updatePromptOnly as a6, selectAndInstallWorkflows as a7, version as a8, checkAndUpdateTools as a9, displayBannerWithInfo as aa, prompts as ab, importRecommendedPermissions as b, commandExists as c, cleanupPermissions as d, CLAUDE_MD_FILE as e, ClAUDE_CONFIG_FILE as f, getPlatform as g, SUPPORTED_LANGS as h, init as i, LANG_LABELS as j, isClaudeCodeInstalled as k, installClaudeCode as l, mergeAndCleanPermissions as m, ensureClaudeDir as n, openSettingsJson as o, backupExistingConfig as p, copyConfigFiles as q, configureApi as r, mergeConfigs as s, mergeSettingsFile as t, updateDefaultModel as u, getExistingModelConfig as v, getExistingApiConfig as w, applyAiLanguageDirective as x, getMcpConfigPath as y, readMcpConfig as z };
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import { J as getTranslation, Z as ZCF_CONFIG_FILE, h as SUPPORTED_LANGS, K as addNumbersToChoices, j as LANG_LABELS, N as updateZcfConfig, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, O as readZcfConfig, x as applyAiLanguageDirective, P as configureAiPersonality, v as getExistingModelConfig, u as updateDefaultModel, Q as isWindows, z as readMcpConfig, G as fixWindowsMcpConfig, B as writeMcpConfig, R as selectMcpServices, D as backupMcpConfig, M as MCP_SERVICES, F as buildMcpServerConfig, E as mergeMcpServers, w as getExistingApiConfig, T as formatApiKeyDisplay, H as addCompletedOnboarding, U as modifyApiConfigPartially, V as isCcrInstalled, W as installCcr, X as setupCcrConfiguration, Y as validateApiKey, r as configureApi, _ as readZcfConfigAsync, I as I18N, $ as readCcrConfig, a0 as configureCcrFeature, a1 as handleExitPromptError, a2 as handleGeneralError, a3 as displayBanner, a4 as selectScriptLanguage, a5 as resolveAiOutputLanguage, a6 as updatePromptOnly, a7 as selectAndInstallWorkflows, a8 as version, a9 as
|
|
4
|
+
import { J as getTranslation, Z as ZCF_CONFIG_FILE, h as SUPPORTED_LANGS, K as addNumbersToChoices, j as LANG_LABELS, N as updateZcfConfig, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, O as readZcfConfig, x as applyAiLanguageDirective, P as configureAiPersonality, v as getExistingModelConfig, u as updateDefaultModel, Q as isWindows, z as readMcpConfig, G as fixWindowsMcpConfig, B as writeMcpConfig, R as selectMcpServices, D as backupMcpConfig, M as MCP_SERVICES, F as buildMcpServerConfig, E as mergeMcpServers, w as getExistingApiConfig, T as formatApiKeyDisplay, H as addCompletedOnboarding, U as modifyApiConfigPartially, V as isCcrInstalled, W as installCcr, X as setupCcrConfiguration, Y as validateApiKey, r as configureApi, _ as readZcfConfigAsync, I as I18N, $ as readCcrConfig, a0 as configureCcrFeature, a1 as handleExitPromptError, a2 as handleGeneralError, a3 as displayBanner, a4 as selectScriptLanguage, a5 as resolveAiOutputLanguage, a6 as updatePromptOnly, a7 as selectAndInstallWorkflows, a8 as version, a9 as checkAndUpdateTools, aa as displayBannerWithInfo, i as init } from './chunks/simple-config.mjs';
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import { existsSync, unlinkSync } from 'node:fs';
|
|
7
7
|
import { x } from 'tinyexec';
|
|
@@ -759,6 +759,16 @@ ${i18n.configuration.updatingPrompts}
|
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
|
|
762
|
+
async function checkUpdates(options = {}) {
|
|
763
|
+
const scriptLang = options.lang || await selectScriptLanguage();
|
|
764
|
+
try {
|
|
765
|
+
await checkAndUpdateTools(scriptLang);
|
|
766
|
+
} catch (error) {
|
|
767
|
+
console.error(ansis.red("Error checking updates:"), error);
|
|
768
|
+
process.exit(1);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
762
772
|
async function showMainMenu() {
|
|
763
773
|
try {
|
|
764
774
|
displayBannerWithInfo();
|
|
@@ -820,6 +830,9 @@ async function showMainMenu() {
|
|
|
820
830
|
console.log(
|
|
821
831
|
` ${ansis.cyan("-.")} ${i18n.menu.menuOptions.clearCache} ${ansis.gray("- " + i18n.menu.menuDescriptions.clearCache)}`
|
|
822
832
|
);
|
|
833
|
+
console.log(
|
|
834
|
+
` ${ansis.cyan("+.")} ${i18n.menu.menuOptions.checkUpdates} ${ansis.gray("- " + i18n.menu.menuDescriptions.checkUpdates)}`
|
|
835
|
+
);
|
|
823
836
|
console.log(` ${ansis.red("Q.")} ${ansis.red(i18n.menu.menuOptions.exit)}`);
|
|
824
837
|
console.log("");
|
|
825
838
|
const { choice } = await inquirer.prompt({
|
|
@@ -827,7 +840,7 @@ async function showMainMenu() {
|
|
|
827
840
|
name: "choice",
|
|
828
841
|
message: i18n.common.enterChoice,
|
|
829
842
|
validate: (value) => {
|
|
830
|
-
const valid = ["1", "2", "3", "4", "5", "6", "7", "r", "R", "u", "U", "0", "-", "q", "Q"];
|
|
843
|
+
const valid = ["1", "2", "3", "4", "5", "6", "7", "r", "R", "u", "U", "0", "-", "+", "q", "Q"];
|
|
831
844
|
return valid.includes(value) || i18n.common.invalidChoice;
|
|
832
845
|
}
|
|
833
846
|
});
|
|
@@ -875,13 +888,16 @@ async function showMainMenu() {
|
|
|
875
888
|
case "-":
|
|
876
889
|
await clearZcfCacheFeature(scriptLang);
|
|
877
890
|
break;
|
|
891
|
+
case "+":
|
|
892
|
+
await checkUpdates({ lang: scriptLang });
|
|
893
|
+
break;
|
|
878
894
|
case "q":
|
|
879
895
|
exitMenu = true;
|
|
880
896
|
console.log(ansis.cyan(i18n.common.goodbye));
|
|
881
897
|
break;
|
|
882
898
|
}
|
|
883
899
|
if (!exitMenu && choice.toLowerCase() !== "q") {
|
|
884
|
-
if (choice === "0" || choice === "-" || choice.toLowerCase() === "u" || choice.toLowerCase() === "r") {
|
|
900
|
+
if (choice === "0" || choice === "-" || choice === "+" || choice.toLowerCase() === "u" || choice.toLowerCase() === "r") {
|
|
885
901
|
console.log("\n" + ansis.dim("\u2500".repeat(50)) + "\n");
|
|
886
902
|
continue;
|
|
887
903
|
}
|
|
@@ -923,16 +939,6 @@ async function ccr(options = {}) {
|
|
|
923
939
|
}
|
|
924
940
|
}
|
|
925
941
|
|
|
926
|
-
async function checkUpdates(options = {}) {
|
|
927
|
-
const scriptLang = options.lang || await selectScriptLanguage();
|
|
928
|
-
try {
|
|
929
|
-
await checkAndUpdateTools(scriptLang);
|
|
930
|
-
} catch (error) {
|
|
931
|
-
console.error(ansis.red("Error checking updates:"), error);
|
|
932
|
-
process.exit(1);
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
|
|
936
942
|
function setupCommands(cli) {
|
|
937
943
|
cli.command("[lang]", "Show interactive menu (default)").option("--init", "Run full initialization directly").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--force, -f", "Force overwrite existing configuration").action(async (lang, options) => {
|
|
938
944
|
await handleDefaultCommand(lang, options);
|
package/package.json
CHANGED