zcf 3.2.1 → 3.2.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
@@ -105,6 +105,17 @@ npx zcf i -s -g zh-CN -t api_key -k "sk-xxx" -u "https://xxx.xxx"
105
105
 
106
106
  # Complete version
107
107
  npx zcf i --skip-prompt --all-lang zh-CN --api-type api_key --api-key "sk-xxx" --api-url "https://xxx.xxx"
108
+
109
+ # Shorthand version (with custom models)
110
+ npx zcf i -s -t api_key -k "sk-xxx" -M "claude-sonnet-4-5" -F "claude-haiku-4-5"
111
+
112
+ # Complete version (with custom models)
113
+ npx zcf i --skip-prompt \
114
+ --api-type api_key \
115
+ --api-key "sk-xxx" \
116
+ --api-url "https://xxx.xxx" \
117
+ --api-model "claude-sonnet-4-5" \
118
+ --api-fast-model "claude-haiku-4-5"
108
119
  ```
109
120
 
110
121
  #### Non-interactive Mode Parameters
@@ -122,6 +133,8 @@ When using `--skip-prompt`, the following parameters are available:
122
133
  | `--api-type, -t` | API configuration type | `auth_token`, `api_key`, `ccr_proxy`, `skip` | No | `skip` |
123
134
  | `--api-key, -k` | API key (for both API key and auth token types) | string | Required when `api-type` is not `skip` | - |
124
135
  | `--api-url, -u` | Custom API URL | URL string | No | official API |
136
+ | `--api-model, -M` | Primary API model | string (e.g., `claude-sonnet-4-5`) | No | - |
137
+ | `--api-fast-model, -F` | Fast API model (Claude Code only) | string (e.g., `claude-haiku-4-5`) | No | - |
125
138
  | `--mcp-services, -m` | MCP services to install (multi-select, comma-separated) | `context7`, `open-websearch`, `spec-workflow`, `mcp-deepwiki`, `Playwright`, `exa`, `serena`, or `skip` for none | No | `all` |
126
139
  | `--workflows, -w` | Workflows to install (multi-select, comma-separated) | `commonTools`, `sixStepsWorkflow`, `featPlanUx`, `gitWorkflow`, `bmadWorkflow`, or `skip` for none | No | `all` |
127
140
  | `--output-styles, -o` | Output styles to install (multi-select, comma-separated) | `engineer-professional`, `nekomata-engineer`, `laowang-engineer`, `ojousama-engineer`, or `skip` for none | No | `all` |
@@ -817,7 +830,8 @@ A huge thank you to all our sponsors for their generous support!
817
830
  - \*\*康 (first KFC sponsor🍗)
818
831
  - \*东 (first coffee sponsor☕️)
819
832
  - 炼\*3 (first Termux user sponsor📱)
820
- - 16°C coffee (My best friend🤪, offered Claude Code max $200 package)
833
+ - [chamo101](https://github.com/chamo101) (first GitHub issue sponsor 🎉)
834
+ - 16°C coffee (My best friend🤪, offered ChatGPT Pro $200 package)
821
835
 
822
836
  ## 📄 License
823
837
 
@@ -222,8 +222,9 @@ class ClaudeCodeConfigManager {
222
222
  delete settings.env.ANTHROPIC_BASE_URL;
223
223
  }
224
224
  writeJsonConfig(SETTINGS_FILE, settings);
225
- const { setPrimaryApiKey } = await import('./simple-config.mjs').then(function (n) { return n.b1; });
225
+ const { setPrimaryApiKey, addCompletedOnboarding } = await import('./simple-config.mjs').then(function (n) { return n.b1; });
226
226
  setPrimaryApiKey();
227
+ addCompletedOnboarding();
227
228
  if (shouldRestartCcr) {
228
229
  const { runCcrRestart } = await import('./commands.mjs');
229
230
  await runCcrRestart();
@@ -16,7 +16,7 @@ import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
16
16
  import i18next from 'i18next';
17
17
  import Backend from 'i18next-fs-backend';
18
18
 
19
- const version = "3.2.1";
19
+ const version = "3.2.2";
20
20
  const homepage = "https://github.com/UfoMiao/zcf";
21
21
 
22
22
  const i18n = i18next.createInstance();
@@ -503,6 +503,7 @@ function displayBannerWithInfo(subtitle) {
503
503
  `));
504
504
  }
505
505
 
506
+ const WINDOWS_WRAPPED_COMMANDS = ["npx", "uvx", "uv"];
506
507
  function getPlatform() {
507
508
  const p = platform();
508
509
  if (p === "win32")
@@ -571,11 +572,11 @@ function getWSLInfo() {
571
572
  version
572
573
  };
573
574
  }
574
- function getMcpCommand() {
575
- if (isWindows()) {
576
- return ["cmd", "/c", "npx"];
575
+ function getMcpCommand(command = "npx") {
576
+ if (isWindows() && WINDOWS_WRAPPED_COMMANDS.includes(command)) {
577
+ return ["cmd", "/c", command];
577
578
  }
578
- return ["npx"];
579
+ return [command];
579
580
  }
580
581
  function getSystemRoot() {
581
582
  if (!isWindows())
@@ -950,10 +951,12 @@ function mergeMcpServers(existing, newServers) {
950
951
  return config;
951
952
  }
952
953
  function applyPlatformCommand(config) {
953
- if (config.command === "npx" && isWindows()) {
954
- const mcpCmd = getMcpCommand();
955
- config.command = mcpCmd[0];
956
- config.args = [...mcpCmd.slice(1), ...config.args || []];
954
+ if (isWindows() && config.command) {
955
+ const mcpCmd = getMcpCommand(config.command);
956
+ if (mcpCmd[0] === "cmd") {
957
+ config.command = mcpCmd[0];
958
+ config.args = [...mcpCmd.slice(1), ...config.args || []];
959
+ }
957
960
  }
958
961
  }
959
962
  function buildMcpServerConfig(baseConfig, apiKey, placeholder = "YOUR_EXA_API_KEY", envVarName) {
@@ -2784,10 +2787,12 @@ async function selectMcpServices() {
2784
2787
  }
2785
2788
 
2786
2789
  function applyCodexPlatformCommand(config) {
2787
- if (config.command === "npx" && isWindows()) {
2788
- const mcpCmd = getMcpCommand();
2789
- config.command = mcpCmd[0];
2790
- config.args = [...mcpCmd.slice(1), ...config.args || []];
2790
+ if (isWindows() && config.command) {
2791
+ const mcpCmd = getMcpCommand(config.command);
2792
+ if (mcpCmd[0] === "cmd") {
2793
+ config.command = mcpCmd[0];
2794
+ config.args = [...mcpCmd.slice(1), ...config.args || []];
2795
+ }
2791
2796
  }
2792
2797
  }
2793
2798
 
@@ -3579,7 +3584,7 @@ function createApiConfigChoices(providers, currentProvider, isCommented) {
3579
3584
  return choices;
3580
3585
  }
3581
3586
  async function applyCustomApiConfig(customApiConfig) {
3582
- const { type, token, baseUrl } = customApiConfig;
3587
+ const { type, token, baseUrl, model } = customApiConfig;
3583
3588
  const backupPath = backupCodexComplete();
3584
3589
  if (backupPath) {
3585
3590
  console.log(ansis.gray(getBackupMessage(backupPath)));
@@ -3600,7 +3605,8 @@ async function applyCustomApiConfig(customApiConfig) {
3600
3605
  authEntries[providerId] = token;
3601
3606
  }
3602
3607
  const configData = {
3603
- model: "claude-3-5-sonnet-20241022",
3608
+ model: model || "claude-3-5-sonnet-20241022",
3609
+ // Use provided model or default
3604
3610
  modelProvider: providerId,
3605
3611
  modelProviderCommented: false,
3606
3612
  providers,
@@ -5092,6 +5098,16 @@ function validateSkipPromptOptions(options) {
5092
5098
  if (options.apiConfigs && options.apiConfigsFile) {
5093
5099
  throw new Error(i18n.t("multi-config:conflictingParams"));
5094
5100
  }
5101
+ if (options.apiModel && typeof options.apiModel !== "string") {
5102
+ throw new Error(
5103
+ i18n.t("errors:invalidApiModel", { value: options.apiModel })
5104
+ );
5105
+ }
5106
+ if (options.apiFastModel && typeof options.apiFastModel !== "string") {
5107
+ throw new Error(
5108
+ i18n.t("errors:invalidApiFastModel", { value: options.apiFastModel })
5109
+ );
5110
+ }
5095
5111
  if (options.apiType === "api_key" && !options.apiKey) {
5096
5112
  throw new Error(i18n.t("errors:apiKeyRequiredForApiKey"));
5097
5113
  }
@@ -5284,7 +5300,9 @@ async function init(options = {}) {
5284
5300
  const customApiConfig = options.apiType === "api_key" && options.apiKey ? {
5285
5301
  type: "api_key",
5286
5302
  token: options.apiKey,
5287
- baseUrl: options.apiUrl
5303
+ baseUrl: options.apiUrl,
5304
+ model: options.apiModel
5305
+ // Add model parameter for Codex
5288
5306
  } : void 0;
5289
5307
  let selectedWorkflows;
5290
5308
  if (Array.isArray(options.workflows)) {
@@ -5521,6 +5539,22 @@ async function init(options = {}) {
5521
5539
  console.log(ansis.gray(` Key: ${formatApiKeyDisplay(configuredApi.key)}`));
5522
5540
  }
5523
5541
  }
5542
+ if ((options.apiModel || options.apiFastModel) && action !== "docs-only" && codeToolType === "claude-code") {
5543
+ if (options.skipPrompt) {
5544
+ const { updateCustomModel } = await Promise.resolve().then(function () { return config$1; });
5545
+ updateCustomModel(
5546
+ options.apiModel || void 0,
5547
+ options.apiFastModel || void 0
5548
+ );
5549
+ console.log(ansis.green(`\u2714 ${i18n.t("api:modelConfigSuccess")}`));
5550
+ if (options.apiModel) {
5551
+ console.log(ansis.gray(` ${i18n.t("api:primaryModel")}: ${options.apiModel}`));
5552
+ }
5553
+ if (options.apiFastModel) {
5554
+ console.log(ansis.gray(` ${i18n.t("api:fastModel")}: ${options.apiFastModel}`));
5555
+ }
5556
+ }
5557
+ }
5524
5558
  if (action !== "docs-only") {
5525
5559
  let shouldConfigureMcp = false;
5526
5560
  if (options.skipPrompt) {
package/dist/cli.mjs CHANGED
@@ -2482,6 +2482,8 @@ function customizeHelp(sections) {
2482
2482
  ` ${ansis.green("--api-type, -t")} <type> ${i18n.t("cli:help.optionDescriptions.apiType")} (auth_token, api_key, ccr_proxy, skip)`,
2483
2483
  ` ${ansis.green("--api-key, -k")} <key> ${i18n.t("cli:help.optionDescriptions.apiKey")}`,
2484
2484
  ` ${ansis.green("--api-url, -u")} <url> ${i18n.t("cli:help.optionDescriptions.customApiUrl")}`,
2485
+ ` ${ansis.green("--api-model, -M")} <model> ${i18n.t("cli:help.optionDescriptions.apiModel")} (e.g., claude-sonnet-4-5)`,
2486
+ ` ${ansis.green("--api-fast-model, -F")} <model> ${i18n.t("cli:help.optionDescriptions.apiFastModel")} (e.g., claude-haiku-4-5)`,
2485
2487
  ` ${ansis.green("--ai-output-lang, -a")} <lang> ${i18n.t("cli:help.optionDescriptions.aiOutputLanguage")}`,
2486
2488
  ` ${ansis.green("--all-lang, -g")} <lang> ${i18n.t("cli:help.optionDescriptions.setAllLanguageParams")}`,
2487
2489
  ` ${ansis.green("--config-action, -r")} <action> ${i18n.t("cli:help.optionDescriptions.configHandling")} (${i18n.t("cli:help.defaults.prefix")} backup)`,
@@ -2547,7 +2549,7 @@ async function setupCommands(cli) {
2547
2549
  cli.command("", "Show interactive menu (default)").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--force, -f", "Force overwrite existing configuration").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").action(await withLanguageResolution(async () => {
2548
2550
  await showMainMenu();
2549
2551
  }));
2550
- cli.command("init", "Initialize Claude Code configuration").alias("i").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--ai-output-lang, -a <lang>", "AI output language").option("--force, -f", "Force overwrite existing configuration").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").option("--config-action, -r <action>", `Config handling (new/backup/merge/docs-only/skip), ${i18n.t("cli:help.defaults.prefix")} backup`).option("--api-type, -t <type>", "API type (auth_token/api_key/ccr_proxy/skip)").option("--api-key, -k <key>", "API key (used for both API key and auth token types)").option("--api-url, -u <url>", "Custom API URL").option("--mcp-services, -m <services>", `Comma-separated MCP services to install (context7,mcp-deepwiki,Playwright,exa), "skip" to skip all, "all" for all non-key services, ${i18n.t("cli:help.defaults.prefix")} all`).option("--workflows, -w <workflows>", `Comma-separated workflows to install (sixStepsWorkflow,featPlanUx,gitWorkflow,bmadWorkflow), "skip" to skip all, "all" for all workflows, ${i18n.t("cli:help.defaults.prefix")} all`).option("--output-styles, -o <styles>", `Comma-separated output styles (engineer-professional,nekomata-engineer,laowang-engineer,default,explanatory,learning), "skip" to skip all, "all" for all custom styles, ${i18n.t("cli:help.defaults.prefix")} all`).option("--default-output-style, -d <style>", `Default output style, ${i18n.t("cli:help.defaults.prefix")} engineer-professional`).option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").option("--install-cometix-line, -x <value>", `Install CCometixLine statusline tool (true/false), ${i18n.t("cli:help.defaults.prefix")} true`).option("--api-configs <configs>", "API configurations as JSON string for multiple profiles").option("--api-configs-file <file>", "Path to JSON file containing API configurations").action(await withLanguageResolution(async (options) => {
2552
+ cli.command("init", "Initialize Claude Code configuration").alias("i").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--ai-output-lang, -a <lang>", "AI output language").option("--force, -f", "Force overwrite existing configuration").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").option("--config-action, -r <action>", `Config handling (new/backup/merge/docs-only/skip), ${i18n.t("cli:help.defaults.prefix")} backup`).option("--api-type, -t <type>", "API type (auth_token/api_key/ccr_proxy/skip)").option("--api-key, -k <key>", "API key (used for both API key and auth token types)").option("--api-url, -u <url>", "Custom API URL").option("--api-model, -M <model>", "Primary API model (e.g., claude-sonnet-4-5)").option("--api-fast-model, -F <model>", "Fast API model (e.g., claude-haiku-4-5)").option("--mcp-services, -m <services>", `Comma-separated MCP services to install (context7,mcp-deepwiki,Playwright,exa), "skip" to skip all, "all" for all non-key services, ${i18n.t("cli:help.defaults.prefix")} all`).option("--workflows, -w <workflows>", `Comma-separated workflows to install (sixStepsWorkflow,featPlanUx,gitWorkflow,bmadWorkflow), "skip" to skip all, "all" for all workflows, ${i18n.t("cli:help.defaults.prefix")} all`).option("--output-styles, -o <styles>", `Comma-separated output styles (engineer-professional,nekomata-engineer,laowang-engineer,default,explanatory,learning), "skip" to skip all, "all" for all custom styles, ${i18n.t("cli:help.defaults.prefix")} all`).option("--default-output-style, -d <style>", `Default output style, ${i18n.t("cli:help.defaults.prefix")} engineer-professional`).option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").option("--install-cometix-line, -x <value>", `Install CCometixLine statusline tool (true/false), ${i18n.t("cli:help.defaults.prefix")} true`).option("--api-configs <configs>", "API configurations as JSON string for multiple profiles").option("--api-configs-file <file>", "Path to JSON file containing API configurations").action(await withLanguageResolution(async (options) => {
2551
2553
  await init(options);
2552
2554
  }));
2553
2555
  cli.command("update", "Update Claude Code prompts only").alias("u").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").action(await withLanguageResolution(async (options) => {
@@ -3,6 +3,9 @@
3
3
  "apiConfigKey": "Key",
4
4
  "apiConfigSuccess": "API configured",
5
5
  "apiConfigUrl": "URL",
6
+ "modelConfigSuccess": "API models configured",
7
+ "primaryModel": "Primary model",
8
+ "fastModel": "Fast model",
6
9
  "apiKeyDesc": "For API keys from Anthropic Console",
7
10
  "apiKeyValidation.example": "Example format: sk-abcdef123456_789xyz",
8
11
  "authTokenDesc": "For tokens obtained via OAuth or browser login",
@@ -23,6 +23,8 @@
23
23
  "help.optionDescriptions.apiType": "API type",
24
24
  "help.optionDescriptions.apiKey": "API key (for both types)",
25
25
  "help.optionDescriptions.customApiUrl": "Custom API URL",
26
+ "help.optionDescriptions.apiModel": "Primary API model",
27
+ "help.optionDescriptions.apiFastModel": "Fast API model",
26
28
  "help.optionDescriptions.aiOutputLanguage": "AI output language",
27
29
  "help.optionDescriptions.setAllLanguageParams": "Set all language params",
28
30
  "help.optionDescriptions.configHandling": "Config handling",
@@ -11,6 +11,8 @@
11
11
  "invalidDefaultOutputStyle": "Invalid default output style: {style}. Available styles: {validStyles}",
12
12
  "invalidWorkflow": "Invalid workflow: {workflow}. Available workflows: {validWorkflows}",
13
13
  "invalidModel": "Invalid model: {model}. Expected 'opus', 'sonnet', or 'sonnet[1m]'",
14
+ "invalidApiModel": "Invalid API model parameter: {value}",
15
+ "invalidApiFastModel": "Invalid fast model parameter: {value}",
14
16
  "invalidEnvConfig": "Invalid env configuration: expected object",
15
17
  "invalidBaseUrl": "Invalid ANTHROPIC_BASE_URL: expected string",
16
18
  "invalidApiKeyConfig": "Invalid ANTHROPIC_API_KEY: expected string",
@@ -3,6 +3,9 @@
3
3
  "apiConfigKey": "Key",
4
4
  "apiConfigSuccess": "API 配置完成",
5
5
  "apiConfigUrl": "URL",
6
+ "modelConfigSuccess": "API 模型配置完成",
7
+ "primaryModel": "主模型",
8
+ "fastModel": "快速模型",
6
9
  "apiKeyDesc": "适用于从 Anthropic Console 获取的 API 密钥",
7
10
  "apiKeyValidation.example": "示例格式: sk-abcdef123456_789xyz",
8
11
  "authTokenDesc": "适用于通过 OAuth 或浏览器登录获取的令牌",
@@ -23,6 +23,8 @@
23
23
  "help.optionDescriptions.apiType": "API类型",
24
24
  "help.optionDescriptions.apiKey": "API密钥(适用于所有类型)",
25
25
  "help.optionDescriptions.customApiUrl": "自定义API地址",
26
+ "help.optionDescriptions.apiModel": "主API模型",
27
+ "help.optionDescriptions.apiFastModel": "快速API模型",
26
28
  "help.optionDescriptions.aiOutputLanguage": "AI输出语言",
27
29
  "help.optionDescriptions.setAllLanguageParams": "统一设置所有语言参数",
28
30
  "help.optionDescriptions.configHandling": "配置处理",
@@ -11,6 +11,8 @@
11
11
  "invalidDefaultOutputStyle": "无效的默认输出样式:{style}。可用的样式:{validStyles}",
12
12
  "invalidWorkflow": "无效的工作流:{workflow}。可用的工作流:{validWorkflows}",
13
13
  "invalidModel": "无效的模型:{model}。期望的值:'opus', 'sonnet', 或 'sonnet[1m]'",
14
+ "invalidApiModel": "无效的 API 模型参数:{value}",
15
+ "invalidApiFastModel": "无效的快速模型参数:{value}",
14
16
  "invalidEnvConfig": "无效的环境配置:期望对象类型",
15
17
  "invalidBaseUrl": "无效的 ANTHROPIC_BASE_URL:期望字符串类型",
16
18
  "invalidApiKeyConfig": "无效的 ANTHROPIC_API_KEY:期望字符串类型",
package/dist/index.d.mts CHANGED
@@ -46,6 +46,8 @@ interface InitOptions {
46
46
  apiType?: 'auth_token' | 'api_key' | 'ccr_proxy' | 'skip';
47
47
  apiKey?: string;
48
48
  apiUrl?: string;
49
+ apiModel?: string;
50
+ apiFastModel?: string;
49
51
  mcpServices?: string[] | string | boolean;
50
52
  workflows?: string[] | string | boolean;
51
53
  outputStyles?: string[] | string | boolean;
package/dist/index.d.ts CHANGED
@@ -46,6 +46,8 @@ interface InitOptions {
46
46
  apiType?: 'auth_token' | 'api_key' | 'ccr_proxy' | 'skip';
47
47
  apiKey?: string;
48
48
  apiUrl?: string;
49
+ apiModel?: string;
50
+ apiFastModel?: string;
49
51
  mcpServices?: string[] | string | boolean;
50
52
  workflows?: string[] | string | boolean;
51
53
  outputStyles?: string[] | string | boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "3.2.1",
4
+ "version": "3.2.2",
5
5
  "description": "Zero-Config Code Flow - One-click configuration tool for Claude Code",
6
6
  "author": {
7
7
  "name": "Miao Da",
@@ -29,7 +29,8 @@
29
29
  "mcp__mcp-deepwiki",
30
30
  "mcp__Playwright",
31
31
  "mcp__spec-workflow",
32
- "mcp__open-websearch"
32
+ "mcp__open-websearch",
33
+ "mcp__serena"
33
34
  ],
34
35
  "deny": []
35
36
  },