zcf 3.4.2 → 3.4.3

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/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 { ak as ensureI18nInitialized, al as i18n, aN as readCcrConfig, aI as isCcrInstalled, aJ as installCcr, aO as configureCcrFeature, ao as promptBoolean, aP as handleExitPromptError, aQ as handleGeneralError, aR as COMETIX_COMMAND_NAME, aS as COMETIX_COMMANDS, aT as installCometixLine, am as addNumbersToChoices, aU as checkAndUpdateTools, aV as runCodexUpdate, aW as resolveCodeType$1, at as readJsonConfig, aX as writeJsonConfig, q as ZCF_CONFIG_FILE, aD as readZcfConfig, D as DEFAULT_CODE_TOOL_TYPE, u as isCodeToolType, aY as displayBanner, aB as updateZcfConfig, aZ as version, a_ as resolveAiOutputLanguage, a$ as updatePromptOnly, b0 as selectAndInstallWorkflows, b1 as checkClaudeCodeVersionAndPrompt, w as resolveCodeToolType$1, b2 as displayBannerWithInfo, s as CODE_TOOL_BANNERS, b3 as runCodexUninstall, b4 as configureCodexMcp, b5 as configureCodexApi, b6 as runCodexWorkflowImportWithLanguageSelection, b7 as runCodexFullInit, i as init, b8 as switchCodexProvider, b9 as listCodexProviders, ax as readCodexConfig, ba as switchToOfficialLogin, bb as switchToProvider, bc as readZcfConfigAsync, bd as initI18n, be as selectScriptLanguage, aC as changeLanguage } from './chunks/simple-config.mjs';
4
+ import { ak as ensureI18nInitialized, al as i18n, aO as readCcrConfig, aJ as isCcrInstalled, aK as installCcr, aP as configureCcrFeature, ao as promptBoolean, aQ as handleExitPromptError, aR as handleGeneralError, aS as COMETIX_COMMAND_NAME, aT as COMETIX_COMMANDS, aU as installCometixLine, am as addNumbersToChoices, aV as checkAndUpdateTools, aW as runCodexUpdate, aX as resolveCodeType$1, at as readJsonConfig, aY as writeJsonConfig, q as ZCF_CONFIG_FILE, aE as readZcfConfig, D as DEFAULT_CODE_TOOL_TYPE, u as isCodeToolType, aZ as displayBanner, aC as updateZcfConfig, a_ as version, a$ as resolveAiOutputLanguage, b0 as updatePromptOnly, b1 as selectAndInstallWorkflows, b2 as checkClaudeCodeVersionAndPrompt, w as resolveCodeToolType$1, b3 as displayBannerWithInfo, s as CODE_TOOL_BANNERS, b4 as runCodexUninstall, b5 as configureCodexMcp, b6 as configureCodexApi, b7 as runCodexWorkflowImportWithLanguageSelection, b8 as runCodexFullInit, i as init, b9 as switchCodexProvider, ba as listCodexProviders, ay as readCodexConfig, bb as switchToOfficialLogin, bc as switchToProvider, bd as readZcfConfigAsync, be as initI18n, bf as selectScriptLanguage, aD as changeLanguage } from './chunks/simple-config.mjs';
5
5
  import { existsSync } from 'node:fs';
6
6
  import { homedir } from 'node:os';
7
7
  import inquirer from 'inquirer';
@@ -687,7 +687,7 @@ class ZcfUninstaller {
687
687
  result.removed.push(".claude.json (includes MCP configuration)");
688
688
  }
689
689
  try {
690
- const { uninstallCodeTool } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bn; });
690
+ const { uninstallCodeTool } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bo; });
691
691
  const success = await uninstallCodeTool("claude-code");
692
692
  if (success) {
693
693
  result.removed.push("@anthropic-ai/claude-code");
@@ -923,7 +923,7 @@ async function uninstall(options = {}) {
923
923
  }
924
924
  const uninstaller = new ZcfUninstaller(options.lang || "en");
925
925
  if (codeType === "codex") {
926
- const { runCodexUninstall } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bm; });
926
+ const { runCodexUninstall } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bn; });
927
927
  await runCodexUninstall();
928
928
  return;
929
929
  }
@@ -1193,7 +1193,7 @@ async function update(options = {}) {
1193
1193
  }
1194
1194
  return;
1195
1195
  }
1196
- const { resolveTemplateLanguage } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bl; });
1196
+ const { resolveTemplateLanguage } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bm; });
1197
1197
  const configLang = await resolveTemplateLanguage(
1198
1198
  options.configLang,
1199
1199
  // Command line option
@@ -1906,7 +1906,9 @@ function customizeHelp(sections) {
1906
1906
  ` ${ansis.green("--api-key, -k")} <key> ${i18n.t("cli:help.optionDescriptions.apiKey")}`,
1907
1907
  ` ${ansis.green("--api-url, -u")} <url> ${i18n.t("cli:help.optionDescriptions.customApiUrl")}`,
1908
1908
  ` ${ansis.green("--api-model, -M")} <model> ${i18n.t("cli:help.optionDescriptions.apiModel")} (e.g., claude-sonnet-4-5)`,
1909
- ` ${ansis.green("--api-fast-model, -F")} <model> ${i18n.t("cli:help.optionDescriptions.apiFastModel")} (e.g., claude-haiku-4-5)`,
1909
+ ` ${ansis.green("--api-haiku-model, -H")} <model> ${i18n.t("cli:help.optionDescriptions.apiHaikuModel")} (e.g., claude-haiku-4-5)`,
1910
+ ` ${ansis.green("--api-sonnet-model, -S")} <model> ${i18n.t("cli:help.optionDescriptions.apiSonnetModel")} (e.g., claude-sonnet-4-5)`,
1911
+ ` ${ansis.green("--api-opus-model, -O")} <model> ${i18n.t("cli:help.optionDescriptions.apiOpusModel")} (e.g., claude-opus-4-5)`,
1910
1912
  ` ${ansis.green("--ai-output-lang, -a")} <lang> ${i18n.t("cli:help.optionDescriptions.aiOutputLanguage")}`,
1911
1913
  ` ${ansis.green("--all-lang, -g")} <lang> ${i18n.t("cli:help.optionDescriptions.setAllLanguageParams")}`,
1912
1914
  ` ${ansis.green("--config-action, -r")} <action> ${i18n.t("cli:help.optionDescriptions.configHandling")} (${i18n.t("cli:help.defaults.prefix")} backup)`,
@@ -1972,7 +1974,7 @@ async function setupCommands(cli) {
1972
1974
  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 (options) => {
1973
1975
  await showMainMenu({ codeType: options.codeType });
1974
1976
  }));
1975
- 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("--provider, -p <provider>", "API provider preset (302ai, glm, minimax, kimi, custom)").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) => {
1977
+ 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-haiku-model, -H <model>", "Default Haiku model (e.g., claude-haiku-4-5)").option("--api-sonnet-model, -S <model>", "Default Sonnet model (e.g., claude-sonnet-4-5)").option("--api-opus-model, -O <model>", "Default Opus model (e.g., claude-opus-4-5)").option("--provider, -p <provider>", "API provider preset (302ai, glm, minimax, kimi, custom)").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) => {
1976
1978
  await init(options);
1977
1979
  }));
1978
1980
  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) => {
@@ -24,7 +24,9 @@
24
24
  "help.optionDescriptions.apiKey": "API key (for both types)",
25
25
  "help.optionDescriptions.customApiUrl": "Custom API URL",
26
26
  "help.optionDescriptions.apiModel": "Primary API model",
27
- "help.optionDescriptions.apiFastModel": "Fast API model",
27
+ "help.optionDescriptions.apiHaikuModel": "Default Haiku model",
28
+ "help.optionDescriptions.apiSonnetModel": "Default Sonnet model",
29
+ "help.optionDescriptions.apiOpusModel": "Default Opus model",
28
30
  "help.optionDescriptions.aiOutputLanguage": "AI output language",
29
31
  "help.optionDescriptions.setAllLanguageParams": "Set all language params",
30
32
  "help.optionDescriptions.configHandling": "Config handling",
@@ -15,7 +15,9 @@
15
15
  "currentModel": "Current model",
16
16
  "defaultModelOption": "Default - Let Claude Code choose",
17
17
  "defaultStyle": "Default style",
18
- "enterFastModel": "Enter fast model name for background tasks",
18
+ "enterHaikuModel": "Enter default Haiku model",
19
+ "enterSonnetModel": "Enter default Sonnet model",
20
+ "enterOpusModel": "Enter default Opus model",
19
21
  "enterPrimaryModel": "Enter primary model name",
20
22
  "envImportSuccess": "Environment variables imported",
21
23
  "existingConfig": "Existing config detected. How to proceed?",
@@ -12,7 +12,7 @@
12
12
  "invalidWorkflow": "Invalid workflow: {workflow}. Available workflows: {validWorkflows}",
13
13
  "invalidModel": "Invalid model: {model}. Expected 'opus', 'sonnet', or 'sonnet[1m]'",
14
14
  "invalidApiModel": "Invalid API model parameter: {value}",
15
- "invalidApiFastModel": "Invalid fast model parameter: {value}",
15
+ "invalidModelParam": "Invalid model parameter {key}: {value}",
16
16
  "invalidEnvConfig": "Invalid env configuration: expected object",
17
17
  "invalidBaseUrl": "Invalid ANTHROPIC_BASE_URL: expected string",
18
18
  "invalidApiKeyConfig": "Invalid ANTHROPIC_API_KEY: expected string",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "autoUpdating": "Auto-updating {tool}...",
3
+ "usingSudo": "Detected non-root Linux user. Using sudo for update (password prompt may appear).",
3
4
  "cannotCheckVersion": "Cannot check latest version",
4
5
  "ccrNotInstalled": "CCR is not installed",
5
6
  "ccrUpToDate": "CCR is up to date (v{version})",
@@ -24,7 +24,9 @@
24
24
  "help.optionDescriptions.apiKey": "API密钥(适用于所有类型)",
25
25
  "help.optionDescriptions.customApiUrl": "自定义API地址",
26
26
  "help.optionDescriptions.apiModel": "主API模型",
27
- "help.optionDescriptions.apiFastModel": "快速API模型",
27
+ "help.optionDescriptions.apiHaikuModel": "默认 Haiku 模型",
28
+ "help.optionDescriptions.apiSonnetModel": "默认 Sonnet 模型",
29
+ "help.optionDescriptions.apiOpusModel": "默认 Opus 模型",
28
30
  "help.optionDescriptions.aiOutputLanguage": "AI输出语言",
29
31
  "help.optionDescriptions.setAllLanguageParams": "统一设置所有语言参数",
30
32
  "help.optionDescriptions.configHandling": "配置处理",
@@ -15,7 +15,9 @@
15
15
  "currentModel": "当前模型",
16
16
  "defaultModelOption": "默认 - 让 Claude Code 自动选择",
17
17
  "defaultStyle": "默认风格",
18
- "enterFastModel": "请输入后台任务的快速模型名称",
18
+ "enterHaikuModel": "请输入默认 Haiku 模型名称",
19
+ "enterSonnetModel": "请输入默认 Sonnet 模型名称",
20
+ "enterOpusModel": "请输入默认 Opus 模型名称",
19
21
  "enterPrimaryModel": "请输入主要使用的模型名称",
20
22
  "envImportSuccess": "环境变量已导入",
21
23
  "existingConfig": "检测到已有配置文件,如何处理?",
@@ -12,7 +12,7 @@
12
12
  "invalidWorkflow": "无效的工作流:{workflow}。可用的工作流:{validWorkflows}",
13
13
  "invalidModel": "无效的模型:{model}。期望的值:'opus', 'sonnet', 或 'sonnet[1m]'",
14
14
  "invalidApiModel": "无效的 API 模型参数:{value}",
15
- "invalidApiFastModel": "无效的快速模型参数:{value}",
15
+ "invalidModelParam": "无效的模型参数 {key}:{value}",
16
16
  "invalidEnvConfig": "无效的环境配置:期望对象类型",
17
17
  "invalidBaseUrl": "无效的 ANTHROPIC_BASE_URL:期望字符串类型",
18
18
  "invalidApiKeyConfig": "无效的 ANTHROPIC_API_KEY:期望字符串类型",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "autoUpdating": "正在自动更新 {tool}...",
3
+ "usingSudo": "检测到 Linux 非 root 用户,正在使用 sudo 提升权限进行更新(可能需要输入密码)。",
3
4
  "cannotCheckVersion": "无法检查最新版本",
4
5
  "ccrNotInstalled": "CCR 未安装",
5
6
  "ccrUpToDate": "CCR 已是最新版本 (v{version})",
package/dist/index.d.mts CHANGED
@@ -52,7 +52,9 @@ interface InitOptions {
52
52
  apiKey?: string;
53
53
  apiUrl?: string;
54
54
  apiModel?: string;
55
- apiFastModel?: string;
55
+ apiHaikuModel?: string;
56
+ apiSonnetModel?: string;
57
+ apiOpusModel?: string;
56
58
  provider?: string;
57
59
  mcpServices?: string[] | string | boolean;
58
60
  workflows?: string[] | string | boolean;
@@ -159,9 +161,11 @@ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
159
161
  /**
160
162
  * Update custom model configuration using environment variables
161
163
  * @param primaryModel - Primary model name for general tasks
162
- * @param fastModel - Fast model name for background tasks (optional)
164
+ * @param haikuModel - Default Haiku model (optional)
165
+ * @param sonnetModel - Default Sonnet model (optional)
166
+ * @param opusModel - Default Opus model (optional)
163
167
  */
164
- declare function updateCustomModel(primaryModel?: string, fastModel?: string): void;
168
+ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string): void;
165
169
  /**
166
170
  * Update the default model configuration in settings.json
167
171
  * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
package/dist/index.d.ts CHANGED
@@ -52,7 +52,9 @@ interface InitOptions {
52
52
  apiKey?: string;
53
53
  apiUrl?: string;
54
54
  apiModel?: string;
55
- apiFastModel?: string;
55
+ apiHaikuModel?: string;
56
+ apiSonnetModel?: string;
57
+ apiOpusModel?: string;
56
58
  provider?: string;
57
59
  mcpServices?: string[] | string | boolean;
58
60
  workflows?: string[] | string | boolean;
@@ -159,9 +161,11 @@ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
159
161
  /**
160
162
  * Update custom model configuration using environment variables
161
163
  * @param primaryModel - Primary model name for general tasks
162
- * @param fastModel - Fast model name for background tasks (optional)
164
+ * @param haikuModel - Default Haiku model (optional)
165
+ * @param sonnetModel - Default Sonnet model (optional)
166
+ * @param opusModel - Default Opus model (optional)
163
167
  */
164
- declare function updateCustomModel(primaryModel?: string, fastModel?: string): void;
168
+ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string): void;
165
169
  /**
166
170
  * Update the default model configuration in settings.json
167
171
  * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
package/dist/index.mjs CHANGED
@@ -11,9 +11,9 @@ import 'pathe';
11
11
  import 'node:url';
12
12
  import 'inquirer-toggle';
13
13
  import 'ora';
14
+ import 'tinyexec';
14
15
  import 'semver';
15
16
  import 'smol-toml';
16
- import 'tinyexec';
17
17
  import 'node:fs/promises';
18
18
  import 'i18next';
19
19
  import 'i18next-fs-backend';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "3.4.2",
4
+ "version": "3.4.3",
5
5
  "description": "Zero-Config Code Flow - One-click configuration tool for Code Cli",
6
6
  "author": {
7
7
  "name": "Miao Da",
@@ -66,7 +66,16 @@ This command works **without any package manager/build tools**, using only **Git
66
66
  4. **Commit Message Generation (Conventional with Optional Emoji)**
67
67
  - Auto-infer `type` (`feat`/`fix`/`docs`/`refactor`/`test`/`chore`/`perf`/`style`/`ci`/`revert`...) and optional `scope`.
68
68
  - Generate message header: `[<emoji>] <type>(<scope>)?: <subject>` (first line ≤ 72 chars, imperative mood, emoji included only with `--emoji` flag).
69
- - Generate message body: bullet points (motivation, implementation details, impact scope, BREAKING CHANGE if any).
69
+ - Generate message body:
70
+ - Must have a blank line after the subject.
71
+ - Use list format, each item starts with `-`.
72
+ - Each item **must use imperative verb-first sentences** (e.g., "add…", "fix…", "update…").
73
+ - **Colon-separated formats are prohibited** (e.g., ~~"Feature: description"~~, ~~"Impl: content"~~).
74
+ - Describe the motivation, implementation details, or impact scope (3 items or fewer recommended).
75
+ - Generate message footer (if any):
76
+ - Must have a blank line after the Body.
77
+ - **BREAKING CHANGE**: If there are breaking changes, must include `BREAKING CHANGE: <description>`, or add exclamation mark after type (e.g., `feat!:`).
78
+ - Other footers use git trailer format (e.g., `Closes #123`, `Refs: #456`, `Reviewed-by: Name`).
70
79
  - Select message language to match the predominant language in Git history. Inspect recent commit subjects (e.g., `git log -n 50 --pretty=%s`) to decide Chinese vs English; if unclear, fall back to the repository's primary locale or English.
71
80
  - Write draft to `.git/COMMIT_EDITMSG` for use with `git commit`.
72
81
 
@@ -83,8 +92,8 @@ This command works **without any package manager/build tools**, using only **Git
83
92
 
84
93
  - **Atomic commits**: One commit does one thing, easier to trace and review.
85
94
  - **Group before committing**: Split by directory/module/feature.
86
- - **Clear subject**: First line ≤ 72 chars, imperative mood (e.g., "add... / fix...").
87
- - **Body with context**: Explain motivation, solution, impact scope, risks, and next steps.
95
+ - **Clear subject**: First line ≤ 72 chars, imperative mood.
96
+ - **Body with context**: Explain motivation, solution, and impact scope (colon-separated formats prohibited).
88
97
  - **Follow Conventional Commits**: `<type>(<scope>): <subject>`.
89
98
 
90
99
  ---
@@ -122,6 +131,7 @@ This command works **without any package manager/build tools**, using only **Git
122
131
 
123
132
  **Good (with --emoji)**
124
133
 
134
+ ```text
125
135
  - ✨ feat(ui): add user authentication flow
126
136
  - 🐛 fix(api): handle token refresh race condition
127
137
  - 📝 docs: update API usage examples
@@ -129,9 +139,11 @@ This command works **without any package manager/build tools**, using only **Git
129
139
  - ✅ test: add unit tests for rate limiter
130
140
  - 🔧 chore: update git hooks and repository settings
131
141
  - ⏪️ revert: revert "feat(core): introduce streaming API"
142
+ ```
132
143
 
133
144
  **Good (without --emoji)**
134
145
 
146
+ ```text
135
147
  - feat(ui): add user authentication flow
136
148
  - fix(api): handle token refresh race condition
137
149
  - docs: update API usage examples
@@ -139,13 +151,48 @@ This command works **without any package manager/build tools**, using only **Git
139
151
  - test: add unit tests for rate limiter
140
152
  - chore: update git hooks and repository settings
141
153
  - revert: revert "feat(core): introduce streaming API"
154
+ ```
155
+
156
+ **Good (with Body)**
157
+
158
+ ```text
159
+ feat(auth): add OAuth2 login flow
160
+
161
+ - implement Google and GitHub third-party login
162
+ - add user authorization callback handling
163
+ - improve login state persistence logic
164
+
165
+ Closes #42
166
+ ```
167
+
168
+ ```text
169
+ fix(ui): fix button spacing on mobile devices
170
+
171
+ - adjust button padding to fit small screens
172
+ - fix styling issues on iOS Safari
173
+ - optimize touch target size
174
+ ```
175
+
176
+ **Good (with BREAKING CHANGE)**
177
+
178
+ ```text
179
+ feat(api)!: redesign authentication API
180
+
181
+ - migrate from session-based to JWT authentication
182
+ - update all endpoint signatures
183
+ - remove deprecated login methods
184
+
185
+ BREAKING CHANGE: authentication API has been completely redesigned, all clients must update their integration
186
+ ```
142
187
 
143
188
  **Split Example**
144
189
 
190
+ ```text
145
191
  - `feat(types): add new type defs for payment method`
146
192
  - `docs: update API docs for new types`
147
193
  - `test: add unit tests for payment types`
148
194
  - `fix: address linter warnings in new files` ← (if your repo has hook errors)
195
+ ```
149
196
 
150
197
  ---
151
198
 
@@ -66,7 +66,16 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
66
66
  4. **提交信息生成(Conventional 规范,可选 Emoji)**
67
67
  - 自动推断 `type`(`feat`/`fix`/`docs`/`refactor`/`test`/`chore`/`perf`/`style`/`ci`/`revert` …)与可选 `scope`。
68
68
  - 生成消息头:`[<emoji>] <type>(<scope>)?: <subject>`(首行 ≤ 72 字符,祈使语气,仅在使用 `--emoji` 时包含 emoji)。
69
- - 生成消息体:要点列表(动机、实现要点、影响范围、BREAKING CHANGE 如有)。
69
+ - 生成消息体:
70
+ - 必须在 subject 之后空一行。
71
+ - 使用列表格式,每项以 `-` 开头。
72
+ - 每项**必须使用动词开头的祈使句**(如 "add…"、"fix…"、"update…")。
73
+ - **禁止使用冒号分隔的格式**(如 ~~"Feature: description"~~、~~"Impl: content"~~)。
74
+ - 说明变更的动机、实现要点或影响范围(3 项以内为宜)。
75
+ - 生成消息脚注(如有):
76
+ - 必须在 Body 之后空一行。
77
+ - **BREAKING CHANGE**:若存在破坏性变更,必须包含 `BREAKING CHANGE: <description>`,或在类型后添加感叹号(如 `feat!:`)。
78
+ - 其它脚注采用 git trailer 格式(如 `Closes #123`、`Refs: #456`、`Reviewed-by: Name`)。
70
79
  - 根据 Git 历史提交的主要语言选择提交信息语言。优先检查最近提交主题(例如 `git log -n 50 --pretty=%s`)判断中文/英文;若无法判断,则回退到仓库主要语言或英文。
71
80
  - 将草稿写入 `.git/COMMIT_EDITMSG`,并用于 `git commit`。
72
81
 
@@ -83,8 +92,8 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
83
92
 
84
93
  - **Atomic commits**:一次提交只做一件事,便于回溯与审阅。
85
94
  - **先分组再提交**:按目录/模块/功能点拆分。
86
- - **清晰主题**:首行 ≤ 72 字符,祈使语气(如 “add… / fix…”)。
87
- - **正文含上下文**:说明动机、方案、影响范围、风险与后续工作。
95
+ - **清晰主题**:首行 ≤ 72 字符,祈使语气。
96
+ - **正文含上下文**:说明动机、方案、影响范围(禁止冒号分隔格式)。
88
97
  - **遵循 Conventional Commits**:`<type>(<scope>): <subject>`。
89
98
 
90
99
  ---
@@ -122,6 +131,7 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
122
131
 
123
132
  **Good (使用 --emoji)**
124
133
 
134
+ ```text
125
135
  - ✨ feat(ui): add user authentication flow
126
136
  - 🐛 fix(api): handle token refresh race condition
127
137
  - 📝 docs: update API usage examples
@@ -129,9 +139,11 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
129
139
  - ✅ test: add unit tests for rate limiter
130
140
  - 🔧 chore: update git hooks and repository settings
131
141
  - ⏪️ revert: revert "feat(core): introduce streaming API"
142
+ ```
132
143
 
133
144
  **Good (不使用 --emoji)**
134
145
 
146
+ ```text
135
147
  - feat(ui): add user authentication flow
136
148
  - fix(api): handle token refresh race condition
137
149
  - docs: update API usage examples
@@ -139,13 +151,48 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
139
151
  - test: add unit tests for rate limiter
140
152
  - chore: update git hooks and repository settings
141
153
  - revert: revert "feat(core): introduce streaming API"
154
+ ```
155
+
156
+ **Good (包含 Body)**
157
+
158
+ ```text
159
+ feat(auth): add OAuth2 login flow
160
+
161
+ - implement Google and GitHub third-party login
162
+ - add user authorization callback handling
163
+ - improve login state persistence logic
164
+
165
+ Closes #42
166
+ ```
167
+
168
+ ```text
169
+ fix(ui): fix button spacing on mobile devices
170
+
171
+ - adjust button padding to fit small screens
172
+ - fix styling issues on iOS Safari
173
+ - optimize touch target size
174
+ ```
175
+
176
+ **Good (包含 BREAKING CHANGE)**
177
+
178
+ ```text
179
+ feat(api)!: redesign authentication API
180
+
181
+ - migrate from session-based to JWT authentication
182
+ - update all endpoint signatures
183
+ - remove deprecated login methods
184
+
185
+ BREAKING CHANGE: authentication API has been completely redesigned, all clients must update their integration
186
+ ```
142
187
 
143
188
  **Split Example**
144
189
 
190
+ ```text
145
191
  - `feat(types): add new type defs for payment method`
146
192
  - `docs: update API docs for new types`
147
193
  - `test: add unit tests for payment types`
148
194
  - `fix: address linter warnings in new files` ←(如你的仓库有钩子报错)
195
+ ```
149
196
 
150
197
  ---
151
198
 
@@ -66,7 +66,16 @@ This command works **without any package manager/build tools**, using only **Git
66
66
  4. **Commit Message Generation (Conventional with Optional Emoji)**
67
67
  - Auto-infer `type` (`feat`/`fix`/`docs`/`refactor`/`test`/`chore`/`perf`/`style`/`ci`/`revert`...) and optional `scope`.
68
68
  - Generate message header: `[<emoji>] <type>(<scope>)?: <subject>` (first line ≤ 72 chars, imperative mood, emoji included only with `--emoji` flag).
69
- - Generate message body: bullet points (motivation, implementation details, impact scope, BREAKING CHANGE if any).
69
+ - Generate message body:
70
+ - Must have a blank line after the subject.
71
+ - Use list format, each item starts with `-`.
72
+ - Each item **must use imperative verb-first sentences** (e.g., "add…", "fix…", "update…").
73
+ - **Colon-separated formats are prohibited** (e.g., ~~"Feature: description"~~, ~~"Impl: content"~~).
74
+ - Describe the motivation, implementation details, or impact scope (3 items or fewer recommended).
75
+ - Generate message footer (if any):
76
+ - Must have a blank line after the Body.
77
+ - **BREAKING CHANGE**: If there are breaking changes, must include `BREAKING CHANGE: <description>`, or add exclamation mark after type (e.g., `feat!:`).
78
+ - Other footers use git trailer format (e.g., `Closes #123`, `Refs: #456`, `Reviewed-by: Name`).
70
79
  - Select message language to match the predominant language in Git history. Inspect recent commit subjects (e.g., `git log -n 50 --pretty=%s`) to decide Chinese vs English; if unclear, fall back to the repository's primary locale or English.
71
80
  - Write draft to `.git/COMMIT_EDITMSG` for use with `git commit`.
72
81
 
@@ -83,8 +92,8 @@ This command works **without any package manager/build tools**, using only **Git
83
92
 
84
93
  - **Atomic commits**: One commit does one thing, easier to trace and review.
85
94
  - **Group before committing**: Split by directory/module/feature.
86
- - **Clear subject**: First line ≤ 72 chars, imperative mood (e.g., "add... / fix...").
87
- - **Body with context**: Explain motivation, solution, impact scope, risks, and next steps.
95
+ - **Clear subject**: First line ≤ 72 chars, imperative mood.
96
+ - **Body with context**: Explain motivation, solution, and impact scope (colon-separated formats prohibited).
88
97
  - **Follow Conventional Commits**: `<type>(<scope>): <subject>`.
89
98
 
90
99
  ---
@@ -122,6 +131,7 @@ This command works **without any package manager/build tools**, using only **Git
122
131
 
123
132
  **Good (with --emoji)**
124
133
 
134
+ ```text
125
135
  - ✨ feat(ui): add user authentication flow
126
136
  - 🐛 fix(api): handle token refresh race condition
127
137
  - 📝 docs: update API usage examples
@@ -129,9 +139,11 @@ This command works **without any package manager/build tools**, using only **Git
129
139
  - ✅ test: add unit tests for rate limiter
130
140
  - 🔧 chore: update git hooks and repository settings
131
141
  - ⏪️ revert: revert "feat(core): introduce streaming API"
142
+ ```
132
143
 
133
144
  **Good (without --emoji)**
134
145
 
146
+ ```text
135
147
  - feat(ui): add user authentication flow
136
148
  - fix(api): handle token refresh race condition
137
149
  - docs: update API usage examples
@@ -139,13 +151,48 @@ This command works **without any package manager/build tools**, using only **Git
139
151
  - test: add unit tests for rate limiter
140
152
  - chore: update git hooks and repository settings
141
153
  - revert: revert "feat(core): introduce streaming API"
154
+ ```
155
+
156
+ **Good (with Body)**
157
+
158
+ ```text
159
+ feat(auth): add OAuth2 login flow
160
+
161
+ - implement Google and GitHub third-party login
162
+ - add user authorization callback handling
163
+ - improve login state persistence logic
164
+
165
+ Closes #42
166
+ ```
167
+
168
+ ```text
169
+ fix(ui): fix button spacing on mobile devices
170
+
171
+ - adjust button padding to fit small screens
172
+ - fix styling issues on iOS Safari
173
+ - optimize touch target size
174
+ ```
175
+
176
+ **Good (with BREAKING CHANGE)**
177
+
178
+ ```text
179
+ feat(api)!: redesign authentication API
180
+
181
+ - migrate from session-based to JWT authentication
182
+ - update all endpoint signatures
183
+ - remove deprecated login methods
184
+
185
+ BREAKING CHANGE: authentication API has been completely redesigned, all clients must update their integration
186
+ ```
142
187
 
143
188
  **Split Example**
144
189
 
190
+ ```text
145
191
  - `feat(types): add new type defs for payment method`
146
192
  - `docs: update API docs for new types`
147
193
  - `test: add unit tests for payment types`
148
194
  - `fix: address linter warnings in new files` ← (if your repo has hook errors)
195
+ ```
149
196
 
150
197
  ---
151
198
 
@@ -66,7 +66,16 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
66
66
  4. **提交信息生成(Conventional 规范,可选 Emoji)**
67
67
  - 自动推断 `type`(`feat`/`fix`/`docs`/`refactor`/`test`/`chore`/`perf`/`style`/`ci`/`revert` …)与可选 `scope`。
68
68
  - 生成消息头:`[<emoji>] <type>(<scope>)?: <subject>`(首行 ≤ 72 字符,祈使语气,仅在使用 `--emoji` 时包含 emoji)。
69
- - 生成消息体:要点列表(动机、实现要点、影响范围、BREAKING CHANGE 如有)。
69
+ - 生成消息体:
70
+ - 必须在 subject 之后空一行。
71
+ - 使用列表格式,每项以 `-` 开头。
72
+ - 每项**必须使用动词开头的祈使句**(如 "add…"、"fix…"、"update…")。
73
+ - **禁止使用冒号分隔的格式**(如 ~~"Feature: description"~~、~~"Impl: content"~~)。
74
+ - 说明变更的动机、实现要点或影响范围(3 项以内为宜)。
75
+ - 生成消息脚注(如有):
76
+ - 必须在 Body 之后空一行。
77
+ - **BREAKING CHANGE**:若存在破坏性变更,必须包含 `BREAKING CHANGE: <description>`,或在类型后添加感叹号(如 `feat!:`)。
78
+ - 其它脚注采用 git trailer 格式(如 `Closes #123`、`Refs: #456`、`Reviewed-by: Name`)。
70
79
  - 根据 Git 历史提交的主要语言选择提交信息语言。优先检查最近提交主题(例如 `git log -n 50 --pretty=%s`)判断中文/英文;若无法判断,则回退到仓库主要语言或英文。
71
80
  - 将草稿写入 `.git/COMMIT_EDITMSG`,并用于 `git commit`。
72
81
 
@@ -83,8 +92,8 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
83
92
 
84
93
  - **Atomic commits**:一次提交只做一件事,便于回溯与审阅。
85
94
  - **先分组再提交**:按目录/模块/功能点拆分。
86
- - **清晰主题**:首行 ≤ 72 字符,祈使语气(如 “add… / fix…”)。
87
- - **正文含上下文**:说明动机、方案、影响范围、风险与后续工作。
95
+ - **清晰主题**:首行 ≤ 72 字符,祈使语气。
96
+ - **正文含上下文**:说明动机、方案、影响范围(禁止冒号分隔格式)。
88
97
  - **遵循 Conventional Commits**:`<type>(<scope>): <subject>`。
89
98
 
90
99
  ---
@@ -122,6 +131,7 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
122
131
 
123
132
  **Good (使用 --emoji)**
124
133
 
134
+ ```text
125
135
  - ✨ feat(ui): add user authentication flow
126
136
  - 🐛 fix(api): handle token refresh race condition
127
137
  - 📝 docs: update API usage examples
@@ -129,9 +139,11 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
129
139
  - ✅ test: add unit tests for rate limiter
130
140
  - 🔧 chore: update git hooks and repository settings
131
141
  - ⏪️ revert: revert "feat(core): introduce streaming API"
142
+ ```
132
143
 
133
144
  **Good (不使用 --emoji)**
134
145
 
146
+ ```text
135
147
  - feat(ui): add user authentication flow
136
148
  - fix(api): handle token refresh race condition
137
149
  - docs: update API usage examples
@@ -139,13 +151,48 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
139
151
  - test: add unit tests for rate limiter
140
152
  - chore: update git hooks and repository settings
141
153
  - revert: revert "feat(core): introduce streaming API"
154
+ ```
155
+
156
+ **Good (包含 Body)**
157
+
158
+ ```text
159
+ feat(auth): add OAuth2 login flow
160
+
161
+ - implement Google and GitHub third-party login
162
+ - add user authorization callback handling
163
+ - improve login state persistence logic
164
+
165
+ Closes #42
166
+ ```
167
+
168
+ ```text
169
+ fix(ui): fix button spacing on mobile devices
170
+
171
+ - adjust button padding to fit small screens
172
+ - fix styling issues on iOS Safari
173
+ - optimize touch target size
174
+ ```
175
+
176
+ **Good (包含 BREAKING CHANGE)**
177
+
178
+ ```text
179
+ feat(api)!: redesign authentication API
180
+
181
+ - migrate from session-based to JWT authentication
182
+ - update all endpoint signatures
183
+ - remove deprecated login methods
184
+
185
+ BREAKING CHANGE: authentication API has been completely redesigned, all clients must update their integration
186
+ ```
142
187
 
143
188
  **Split Example**
144
189
 
190
+ ```text
145
191
  - `feat(types): add new type defs for payment method`
146
192
  - `docs: update API docs for new types`
147
193
  - `test: add unit tests for payment types`
148
194
  - `fix: address linter warnings in new files` ←(如你的仓库有钩子报错)
195
+ ```
149
196
 
150
197
  ---
151
198