zcf 2.5.0 → 2.5.1

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
@@ -3,6 +3,8 @@
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
  [![Claude Code](https://img.shields.io/badge/Claude-Code-blue)](https://claude.ai/code)
5
5
  [![Version](https://img.shields.io/npm/v/zcf)](https://www.npmjs.com/package/zcf)
6
+ [![codecov](https://codecov.io/gh/UfoMiao/zcf/graph/badge.svg?token=HZI6K4Y7D7)](https://codecov.io/gh/UfoMiao/zcf)
7
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/UfoMiao/zcf)
6
8
 
7
9
  [中文](README_zh.md) | **English**
8
10
 
@@ -270,7 +272,7 @@ npx zcf u -c en # Using short option
270
272
  ## 📁 Project Structure
271
273
 
272
274
  ```
273
- claude-code-config/
275
+ zcf/
274
276
  ├── README.md # Documentation
275
277
  ├── package.json # npm package configuration
276
278
  ├── bin/
@@ -410,4 +412,4 @@ MIT License
410
412
 
411
413
  If this project helps you, please give me a ⭐️ Star!
412
414
 
413
- [![Star History Chart](https://api.star-history.com/svg?repos=UfoMiao/claude-code-config&type=Date)](https://star-history.com/#UfoMiao/claude-code-config&Date)
415
+ [![Star History Chart](https://api.star-history.com/svg?repos=UfoMiao/zcf&type=Date)](https://star-history.com/#UfoMiao/zcf&Date)
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 { h as SUPPORTED_LANGS, I as I18N, L as LANG_LABELS, G as updateZcfConfig, Z as ZCF_CONFIG_FILE, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, H as readZcfConfig, J as resolveAiOutputLanguage, v as applyAiLanguageDirective, K as configureAiPersonality, u as updateDefaultModel, N as isWindows, x as readMcpConfig, E as fixWindowsMcpConfig, y as writeMcpConfig, O as selectMcpServices, z as backupMcpConfig, M as MCP_SERVICES, D as buildMcpServerConfig, B as mergeMcpServers, t as getExistingApiConfig, P as formatApiKeyDisplay, Q as modifyApiConfigPartially, R as validateApiKey, q as configureApi, T as displayBanner, U as selectScriptLanguage, S as SETTINGS_FILE, V as updatePromptOnly, W as version, X as handleExitPromptError, Y as handleGeneralError, _ as displayBannerWithInfo, i as init } from './shared/zcf.DgtRGf5j.mjs';
4
+ import { h as SUPPORTED_LANGS, I as I18N, L as LANG_LABELS, G as updateZcfConfig, Z as ZCF_CONFIG_FILE, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, H as readZcfConfig, J as resolveAiOutputLanguage, v as applyAiLanguageDirective, K as configureAiPersonality, u as updateDefaultModel, N as isWindows, x as readMcpConfig, E as fixWindowsMcpConfig, y as writeMcpConfig, O as selectMcpServices, z as backupMcpConfig, M as MCP_SERVICES, D as buildMcpServerConfig, B as mergeMcpServers, t as getExistingApiConfig, P as formatApiKeyDisplay, Q as modifyApiConfigPartially, R as validateApiKey, q as configureApi, T as displayBanner, U as selectScriptLanguage, S as SETTINGS_FILE, V as updatePromptOnly, W as version, X as handleExitPromptError, Y as handleGeneralError, _ as displayBannerWithInfo, i as init } from './shared/zcf.DnmrEWlk.mjs';
5
5
  import inquirer from 'inquirer';
6
6
  import { existsSync, unlinkSync } from 'node:fs';
7
7
  import 'pathe';
@@ -149,7 +149,7 @@ async function configureMcpFeature(scriptLang) {
149
149
  validate: (value) => !!value || i18n.keyRequired
150
150
  });
151
151
  if (apiKey) {
152
- config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder);
152
+ config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder, service.apiKeyEnvVar);
153
153
  } else {
154
154
  continue;
155
155
  }
package/dist/index.d.mts CHANGED
@@ -14,6 +14,7 @@ interface McpService {
14
14
  'zh-CN': string;
15
15
  };
16
16
  apiKeyPlaceholder?: string;
17
+ apiKeyEnvVar?: string;
17
18
  config: McpServerConfig;
18
19
  }
19
20
  interface McpServerConfig {
@@ -446,7 +447,7 @@ declare function readMcpConfig(): ClaudeConfiguration | null;
446
447
  declare function writeMcpConfig(config: ClaudeConfiguration): void;
447
448
  declare function backupMcpConfig(): string | null;
448
449
  declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
449
- declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string): McpServerConfig;
450
+ declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
450
451
  declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
451
452
  declare function addCompletedOnboarding(): void;
452
453
 
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ interface McpService {
14
14
  'zh-CN': string;
15
15
  };
16
16
  apiKeyPlaceholder?: string;
17
+ apiKeyEnvVar?: string;
17
18
  config: McpServerConfig;
18
19
  }
19
20
  interface McpServerConfig {
@@ -446,7 +447,7 @@ declare function readMcpConfig(): ClaudeConfiguration | null;
446
447
  declare function writeMcpConfig(config: ClaudeConfiguration): void;
447
448
  declare function backupMcpConfig(): string | null;
448
449
  declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
449
- declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string): McpServerConfig;
450
+ declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
450
451
  declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
451
452
  declare function addCompletedOnboarding(): void;
452
453
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, L as LANG_LABELS, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, Z as ZCF_CONFIG_FILE, F as addCompletedOnboarding, v as applyAiLanguageDirective, n as backupExistingConfig, z as backupMcpConfig, D as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, q as configureApi, p as copyConfigFiles, l as ensureClaudeDir, E as fixWindowsMcpConfig, t as getExistingApiConfig, w as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, k as installClaudeCode, j as isClaudeCodeInstalled, m as mergeAndCleanPermissions, r as mergeConfigs, B as mergeMcpServers, s as mergeSettingsFile, o as openSettingsJson, x as readMcpConfig, u as updateDefaultModel, y as writeMcpConfig } from './shared/zcf.DgtRGf5j.mjs';
1
+ export { A as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, L as LANG_LABELS, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, Z as ZCF_CONFIG_FILE, F as addCompletedOnboarding, v as applyAiLanguageDirective, n as backupExistingConfig, z as backupMcpConfig, D as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, q as configureApi, p as copyConfigFiles, l as ensureClaudeDir, E as fixWindowsMcpConfig, t as getExistingApiConfig, w as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, k as installClaudeCode, j as isClaudeCodeInstalled, m as mergeAndCleanPermissions, r as mergeConfigs, B as mergeMcpServers, s as mergeSettingsFile, o as openSettingsJson, x as readMcpConfig, u as updateDefaultModel, y as writeMcpConfig } from './shared/zcf.DnmrEWlk.mjs';
2
2
  import 'inquirer';
3
3
  import 'ansis';
4
4
  import 'node:fs';
@@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url';
7
7
  import { exec } from 'tinyexec';
8
8
  import { homedir, platform } from 'node:os';
9
9
 
10
- const version = "2.5.0";
10
+ const version = "2.5.1";
11
11
  const homepage = "https://github.com/UfoMiao/zcf";
12
12
 
13
13
  const CLAUDE_DIR = join(homedir(), ".claude");
@@ -465,12 +465,14 @@ const MCP_SERVICES = [
465
465
  "zh-CN": "\u8BF7\u8F93\u5165 Exa API Key",
466
466
  en: "Enter Exa API Key"
467
467
  },
468
- apiKeyPlaceholder: "YOUR_EXA_API_KEY",
468
+ apiKeyEnvVar: "EXA_API_KEY",
469
469
  config: {
470
470
  type: "stdio",
471
471
  command: "npx",
472
- args: ["-y", "mcp-remote", "https://mcp.exa.ai/mcp?exaApiKey=YOUR_EXA_API_KEY"],
473
- env: {}
472
+ args: ["-y", "exa-mcp-server"],
473
+ env: {
474
+ EXA_API_KEY: "YOUR_EXA_API_KEY"
475
+ }
474
476
  }
475
477
  }
476
478
  ];
@@ -1391,12 +1393,16 @@ function applyPlatformCommand(config) {
1391
1393
  config.args = [...mcpCmd.slice(1), ...config.args || []];
1392
1394
  }
1393
1395
  }
1394
- function buildMcpServerConfig(baseConfig, apiKey, placeholder = "YOUR_EXA_API_KEY") {
1396
+ function buildMcpServerConfig(baseConfig, apiKey, placeholder = "YOUR_EXA_API_KEY", envVarName) {
1395
1397
  const config = deepClone(baseConfig);
1396
1398
  applyPlatformCommand(config);
1397
1399
  if (!apiKey) {
1398
1400
  return config;
1399
1401
  }
1402
+ if (envVarName && config.env) {
1403
+ config.env[envVarName] = apiKey;
1404
+ return config;
1405
+ }
1400
1406
  if (config.args) {
1401
1407
  config.args = config.args.map((arg) => arg.replace(placeholder, apiKey));
1402
1408
  }
@@ -1742,7 +1748,7 @@ async function init(options = {}) {
1742
1748
  continue;
1743
1749
  }
1744
1750
  if (apiKey) {
1745
- config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder);
1751
+ config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder, service.apiKeyEnvVar);
1746
1752
  } else {
1747
1753
  continue;
1748
1754
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "2.5.0",
4
+ "version": "2.5.1",
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",