zcf 2.10.0 → 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 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.0";
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
 
@@ -2316,6 +2326,22 @@ function showConfigurationTips(scriptLang, apiKey) {
2316
2326
  }
2317
2327
  console.log("");
2318
2328
  }
2329
+ function createDefaultCcrConfig() {
2330
+ return {
2331
+ LOG: false,
2332
+ CLAUDE_PATH: "",
2333
+ HOST: "127.0.0.1",
2334
+ PORT: 3456,
2335
+ APIKEY: "sk-zcf-x-ccr",
2336
+ API_TIMEOUT_MS: "600000",
2337
+ PROXY_URL: "",
2338
+ transformers: [],
2339
+ Providers: [],
2340
+ // Empty providers array - user configures in UI
2341
+ Router: {}
2342
+ // Empty router configuration - user configures in UI
2343
+ };
2344
+ }
2319
2345
  async function setupCcrConfiguration(scriptLang) {
2320
2346
  const i18n = getTranslation(scriptLang);
2321
2347
  try {
@@ -2352,21 +2378,7 @@ async function setupCcrConfiguration(scriptLang) {
2352
2378
  let config;
2353
2379
  if (preset === "skip") {
2354
2380
  console.log(ansis.yellow(`${i18n.ccr.skipConfiguring}`));
2355
- config = {
2356
- LOG: false,
2357
- CLAUDE_PATH: "",
2358
- HOST: "127.0.0.1",
2359
- PORT: 3456,
2360
- APIKEY: "sk-zcf-x-ccr",
2361
- API_TIMEOUT_MS: "600000",
2362
- PROXY_URL: "",
2363
- transformers: [],
2364
- Providers: [],
2365
- // Empty providers array
2366
- Router: {
2367
- // Empty router configuration - user will configure in CCR UI
2368
- }
2369
- };
2381
+ config = createDefaultCcrConfig();
2370
2382
  } else {
2371
2383
  config = await configureCcrWithPreset(preset, scriptLang);
2372
2384
  }
@@ -2461,8 +2473,8 @@ async function checkClaudeCodeVersion() {
2461
2473
  };
2462
2474
  }
2463
2475
  async function checkCometixLineVersion() {
2464
- const currentVersion = await getInstalledVersion("ccometix");
2465
- const latestVersion = await getLatestVersion("ccometix");
2476
+ const currentVersion = await getInstalledVersion("ccline");
2477
+ const latestVersion = await getLatestVersion("@cometix/ccline");
2466
2478
  return {
2467
2479
  installed: currentVersion !== null,
2468
2480
  currentVersion,
@@ -2690,7 +2702,8 @@ const COMETIX_COMMANDS = {
2690
2702
  CHECK_INSTALL: `npm list -g ${COMETIX_PACKAGE_NAME}`,
2691
2703
  INSTALL: `npm install -g ${COMETIX_PACKAGE_NAME}`,
2692
2704
  UPDATE: `npm update -g ${COMETIX_PACKAGE_NAME}`,
2693
- PRINT_CONFIG: `${COMETIX_COMMAND_NAME} --print`
2705
+ PRINT_CONFIG: `${COMETIX_COMMAND_NAME} --print`,
2706
+ TUI_CONFIG: `${COMETIX_COMMAND_NAME} -c`
2694
2707
  };
2695
2708
 
2696
2709
  function getPlatformStatusLineConfig() {
@@ -3476,7 +3489,7 @@ async function init(options = {}) {
3476
3489
  }
3477
3490
  let apiConfig = null;
3478
3491
  const isNewInstall = !existsSync(SETTINGS_FILE);
3479
- if (action !== "docs-only" && (isNewInstall || ["backup", "merge"].includes(action))) {
3492
+ if (action !== "docs-only" && (isNewInstall || ["backup", "merge", "new"].includes(action))) {
3480
3493
  if (options.skipPrompt) {
3481
3494
  if (options.apiType === "auth_token" && options.apiKey) {
3482
3495
  apiConfig = {
@@ -3491,15 +3504,30 @@ async function init(options = {}) {
3491
3504
  url: options.apiUrl || "https://api.anthropic.com"
3492
3505
  };
3493
3506
  } else if (options.apiType === "ccr_proxy") {
3494
- const ccrInstalled = await isCcrInstalled();
3495
- if (!ccrInstalled) {
3507
+ const ccrStatus = await isCcrInstalled();
3508
+ if (!ccrStatus.hasCorrectPackage) {
3496
3509
  await installCcr(scriptLang);
3510
+ } else {
3511
+ console.log(ansis.green(`\u2714 ${i18n.ccr?.ccrAlreadyInstalled || "CCR already installed"}`));
3497
3512
  }
3498
- const ccrConfigured = await setupCcrConfiguration(scriptLang);
3499
- if (ccrConfigured) {
3500
- console.log(ansis.green(`\u2714 ${i18n.ccr.ccrSetupComplete}`));
3501
- apiConfig = null;
3513
+ const existingCcrConfig = readCcrConfig();
3514
+ if (existingCcrConfig) {
3515
+ const backupPath = backupCcrConfig(scriptLang);
3516
+ if (backupPath) {
3517
+ console.log(ansis.gray(`\u2714 ${i18n.ccr?.ccrBackupSuccess?.replace("{path}", backupPath) || "CCR configuration backed up"}`));
3518
+ }
3519
+ }
3520
+ const defaultCcrConfig = createDefaultCcrConfig();
3521
+ writeCcrConfig(defaultCcrConfig);
3522
+ console.log(ansis.green(`\u2714 ${i18n.ccr?.ccrConfigSuccess || "CCR configuration created"}`));
3523
+ await configureCcrProxy(defaultCcrConfig);
3524
+ console.log(ansis.green(`\u2714 ${i18n.ccr?.proxyConfigSuccess || "Proxy settings configured"}`));
3525
+ try {
3526
+ addCompletedOnboarding();
3527
+ } catch (error) {
3528
+ console.error(ansis.red(i18n.configuration?.failedToSetOnboarding || "Failed to set onboarding flag"), error);
3502
3529
  }
3530
+ apiConfig = null;
3503
3531
  }
3504
3532
  } else {
3505
3533
  const existingApiConfig = getExistingApiConfig();
@@ -3836,4 +3864,4 @@ async function openSettingsJson() {
3836
3864
  }
3837
3865
  }
3838
3866
 
3839
- 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_COMMANDS as a3, COMETIX_COMMAND_NAME 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 };
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 COMETIX_COMMANDS, a4 as COMETIX_COMMAND_NAME, 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';
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "2.10.0",
4
+ "version": "2.10.2",
5
5
  "description": "Zero-Config Claude-Code Flow - One-click configuration tool for Claude Code",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/UfoMiao/zcf",