zcf 2.10.1 → 2.10.2
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 +6 -0
- package/dist/chunks/simple-config.mjs +16 -5
- package/dist/cli.mjs +36 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -135,8 +135,14 @@ After CCR setup, ZCF automatically configures Claude Code to use CCR as the API
|
|
|
135
135
|
- **Git Integration**: Display Git status and branch information
|
|
136
136
|
- **Status Line Display**: Native integration with your terminal statusline
|
|
137
137
|
- **Performance Optimized**: Built with Rust for minimal resource usage
|
|
138
|
+
- **TUI Configuration**: Interactive terminal UI for customizing themes, segments, and display options
|
|
138
139
|
- **Auto Updates**: Included in ZCF's update checking system
|
|
139
140
|
|
|
141
|
+
CCometixLine menu options (accessible via `npx zcf` → `L`):
|
|
142
|
+
- `1` Install or Update - Install or update CCometixLine using npm
|
|
143
|
+
- `2` Print Default Configuration - Display current CCometixLine configuration
|
|
144
|
+
- `3` Custom Config - TUI Configuration Mode - Interactive terminal UI for customizing settings
|
|
145
|
+
|
|
140
146
|
> **Important Note for v2.9.9 Users**: If you have previously used ZCF v2.9.9 to set up your environment, please re-run the initialization process to ensure CCometixLine configuration is properly added. Run `npx zcf` and select the appropriate setup option to update your configuration with CCometixLine support.
|
|
141
147
|
|
|
142
148
|
#### 🚀 Check for updates (v2.8.1+, CCometixLine support v2.9.9+):
|
|
@@ -15,7 +15,7 @@ import semver from 'semver';
|
|
|
15
15
|
import { exec } from 'tinyexec';
|
|
16
16
|
import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
|
|
17
17
|
|
|
18
|
-
const version = "2.10.
|
|
18
|
+
const version = "2.10.2";
|
|
19
19
|
const homepage = "https://github.com/UfoMiao/zcf";
|
|
20
20
|
|
|
21
21
|
const WORKFLOW_CONFIGS = [
|
|
@@ -534,17 +534,22 @@ const cometixMessages$1 = {
|
|
|
534
534
|
printingConfig: "\u6B63\u5728\u6253\u5370 CCometixLine \u914D\u7F6E...",
|
|
535
535
|
printConfigSuccess: "\u914D\u7F6E\u6253\u5370\u6210\u529F",
|
|
536
536
|
printConfigFailed: "\u6253\u5370\u914D\u7F6E\u5931\u8D25",
|
|
537
|
+
enteringTuiConfig: "\u6B63\u5728\u8FDB\u5165 CCometixLine TUI \u914D\u7F6E\u6A21\u5F0F...",
|
|
538
|
+
tuiConfigSuccess: "TUI \u914D\u7F6E\u5B8C\u6210\u6210\u529F",
|
|
539
|
+
tuiConfigFailed: "\u8FD0\u884C TUI \u914D\u7F6E\u5931\u8D25",
|
|
537
540
|
commandNotFound: "ccline \u547D\u4EE4\u672A\u627E\u5230\u3002\u8BF7\u5148\u5B89\u88C5 CCometixLine\u3002",
|
|
538
541
|
// CCometixLine Menu
|
|
539
542
|
cometixMenuTitle: "CCometixLine - \u57FA\u4E8E Rust \u7684\u9AD8\u6027\u80FD Claude Code \u72B6\u6001\u680F\u5DE5\u5177\uFF0C\u96C6\u6210 Git \u4FE1\u606F\u548C\u5B9E\u65F6\u4F7F\u7528\u91CF\u8DDF\u8E2A",
|
|
540
543
|
cometixMenuOptions: {
|
|
541
544
|
installOrUpdate: "\u5B89\u88C5\u6216\u66F4\u65B0",
|
|
542
545
|
printConfig: "\u6253\u5370\u9ED8\u8BA4\u914D\u7F6E",
|
|
546
|
+
customConfig: "\u81EA\u5B9A\u4E49\u914D\u7F6E",
|
|
543
547
|
back: "\u8FD4\u56DE\u4E3B\u83DC\u5355"
|
|
544
548
|
},
|
|
545
549
|
cometixMenuDescriptions: {
|
|
546
550
|
installOrUpdate: "\u4F7F\u7528 npm \u5B89\u88C5\u6216\u66F4\u65B0 CCometixLine",
|
|
547
|
-
printConfig: "\u663E\u793A\u5F53\u524D CCometixLine \u914D\u7F6E"
|
|
551
|
+
printConfig: "\u663E\u793A\u5F53\u524D CCometixLine \u914D\u7F6E",
|
|
552
|
+
customConfig: "\u8FDB\u5165 CCometixLine \u7684 TUI \u914D\u7F6E\u6A21\u5F0F"
|
|
548
553
|
}
|
|
549
554
|
};
|
|
550
555
|
|
|
@@ -1042,17 +1047,22 @@ const cometixMessages = {
|
|
|
1042
1047
|
printingConfig: "Printing CCometixLine configuration...",
|
|
1043
1048
|
printConfigSuccess: "Configuration printed successfully",
|
|
1044
1049
|
printConfigFailed: "Failed to print configuration",
|
|
1050
|
+
enteringTuiConfig: "Entering CCometixLine TUI configuration mode...",
|
|
1051
|
+
tuiConfigSuccess: "TUI configuration completed successfully",
|
|
1052
|
+
tuiConfigFailed: "Failed to run TUI configuration",
|
|
1045
1053
|
commandNotFound: "ccline command not found. Please install CCometixLine first.",
|
|
1046
1054
|
// CCometixLine Menu
|
|
1047
1055
|
cometixMenuTitle: "CCometixLine - High-performance Claude Code statusline tool with Git integration and real-time usage tracking",
|
|
1048
1056
|
cometixMenuOptions: {
|
|
1049
1057
|
installOrUpdate: "Install or Update",
|
|
1050
1058
|
printConfig: "Print Default Configuration",
|
|
1059
|
+
customConfig: "Custom Config",
|
|
1051
1060
|
back: "Back to Main Menu"
|
|
1052
1061
|
},
|
|
1053
1062
|
cometixMenuDescriptions: {
|
|
1054
1063
|
installOrUpdate: "Install or update CCometixLine using npm",
|
|
1055
|
-
printConfig: "Display current CCometixLine configuration"
|
|
1064
|
+
printConfig: "Display current CCometixLine configuration",
|
|
1065
|
+
customConfig: "Enter TUI configuration mode for CCometixLine"
|
|
1056
1066
|
}
|
|
1057
1067
|
};
|
|
1058
1068
|
|
|
@@ -2692,7 +2702,8 @@ const COMETIX_COMMANDS = {
|
|
|
2692
2702
|
CHECK_INSTALL: `npm list -g ${COMETIX_PACKAGE_NAME}`,
|
|
2693
2703
|
INSTALL: `npm install -g ${COMETIX_PACKAGE_NAME}`,
|
|
2694
2704
|
UPDATE: `npm update -g ${COMETIX_PACKAGE_NAME}`,
|
|
2695
|
-
PRINT_CONFIG: `${COMETIX_COMMAND_NAME} --print
|
|
2705
|
+
PRINT_CONFIG: `${COMETIX_COMMAND_NAME} --print`,
|
|
2706
|
+
TUI_CONFIG: `${COMETIX_COMMAND_NAME} -c`
|
|
2696
2707
|
};
|
|
2697
2708
|
|
|
2698
2709
|
function getPlatformStatusLineConfig() {
|
|
@@ -3853,4 +3864,4 @@ async function openSettingsJson() {
|
|
|
3853
3864
|
}
|
|
3854
3865
|
}
|
|
3855
3866
|
|
|
3856
|
-
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,
|
|
3867
|
+
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, COMETIX_COMMAND_NAME as a3, COMETIX_COMMANDS as a4, installCometixLine as a5, displayBanner as a6, selectScriptLanguage as a7, resolveAiOutputLanguage as a8, updatePromptOnly as a9, selectAndInstallWorkflows as aa, version as ab, checkAndUpdateTools as ac, displayBannerWithInfo as ad, prompts as ae, 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
|
|
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 COMETIX_COMMAND_NAME, a4 as COMETIX_COMMANDS, a5 as installCometixLine, a6 as displayBanner, a7 as selectScriptLanguage, a8 as resolveAiOutputLanguage, a9 as updatePromptOnly, aa as selectAndInstallWorkflows, ab as version, ac as checkAndUpdateTools, ad 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';
|
|
@@ -9,7 +9,7 @@ import { homedir } from 'node:os';
|
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
import { exec } from 'child_process';
|
|
11
11
|
import { promisify } from 'util';
|
|
12
|
-
import { exec as exec$1 } from 'node:child_process';
|
|
12
|
+
import { exec as exec$1, spawn } from 'node:child_process';
|
|
13
13
|
import { promisify as promisify$1 } from 'node:util';
|
|
14
14
|
import 'pathe';
|
|
15
15
|
import 'dayjs';
|
|
@@ -664,6 +664,35 @@ async function runCometixPrintConfig(scriptLang) {
|
|
|
664
664
|
throw error;
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
+
async function runCometixTuiConfig(scriptLang) {
|
|
668
|
+
const i18n = getTranslation(scriptLang);
|
|
669
|
+
return new Promise((resolve, reject) => {
|
|
670
|
+
console.log(ansis.blue(`${i18n.cometix.enteringTuiConfig}`));
|
|
671
|
+
const child = spawn(COMETIX_COMMAND_NAME, ["-c"], {
|
|
672
|
+
stdio: "inherit",
|
|
673
|
+
// This allows the TUI to interact directly with the terminal
|
|
674
|
+
shell: true
|
|
675
|
+
});
|
|
676
|
+
child.on("close", (code) => {
|
|
677
|
+
if (code === 0) {
|
|
678
|
+
console.log(ansis.green(`\u2713 ${i18n.cometix.tuiConfigSuccess}`));
|
|
679
|
+
resolve();
|
|
680
|
+
} else {
|
|
681
|
+
const error = new Error(`${COMETIX_COMMAND_NAME} -c exited with code ${code}`);
|
|
682
|
+
console.error(ansis.red(`\u2717 ${i18n.cometix.tuiConfigFailed}: ${error.message}`));
|
|
683
|
+
reject(error);
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
child.on("error", (error) => {
|
|
687
|
+
if (error.message.includes(`command not found`) || error.message.includes("ENOENT")) {
|
|
688
|
+
console.error(ansis.red(`\u2717 ${i18n.cometix.commandNotFound}`));
|
|
689
|
+
} else {
|
|
690
|
+
console.error(ansis.red(`\u2717 ${i18n.cometix.tuiConfigFailed}: ${error.message}`));
|
|
691
|
+
}
|
|
692
|
+
reject(error);
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
}
|
|
667
696
|
|
|
668
697
|
async function showCometixMenu(scriptLang) {
|
|
669
698
|
try {
|
|
@@ -673,6 +702,7 @@ async function showCometixMenu(scriptLang) {
|
|
|
673
702
|
console.log(ansis.cyan("\u2550".repeat(50)) + "\n");
|
|
674
703
|
console.log(` ${ansis.cyan("1.")} ${i18n.cometix.cometixMenuOptions.installOrUpdate} ${ansis.gray("- " + i18n.cometix.cometixMenuDescriptions.installOrUpdate)}`);
|
|
675
704
|
console.log(` ${ansis.cyan("2.")} ${i18n.cometix.cometixMenuOptions.printConfig} ${ansis.gray("- " + i18n.cometix.cometixMenuDescriptions.printConfig)}`);
|
|
705
|
+
console.log(` ${ansis.cyan("3.")} ${i18n.cometix.cometixMenuOptions.customConfig} ${ansis.gray("- " + i18n.cometix.cometixMenuDescriptions.customConfig)}`);
|
|
676
706
|
console.log(` ${ansis.yellow("0.")} ${i18n.cometix.cometixMenuOptions.back}`);
|
|
677
707
|
console.log("");
|
|
678
708
|
const { choice } = await inquirer.prompt({
|
|
@@ -680,7 +710,7 @@ async function showCometixMenu(scriptLang) {
|
|
|
680
710
|
name: "choice",
|
|
681
711
|
message: i18n.common.enterChoice,
|
|
682
712
|
validate: (value) => {
|
|
683
|
-
const valid = ["1", "2", "0"];
|
|
713
|
+
const valid = ["1", "2", "3", "0"];
|
|
684
714
|
return valid.includes(value) || i18n.common.invalidChoice;
|
|
685
715
|
}
|
|
686
716
|
});
|
|
@@ -691,6 +721,9 @@ async function showCometixMenu(scriptLang) {
|
|
|
691
721
|
case "2":
|
|
692
722
|
await runCometixPrintConfig(scriptLang);
|
|
693
723
|
break;
|
|
724
|
+
case "3":
|
|
725
|
+
await runCometixTuiConfig(scriptLang);
|
|
726
|
+
break;
|
|
694
727
|
case "0":
|
|
695
728
|
return false;
|
|
696
729
|
}
|
package/package.json
CHANGED