feat(changelog): 添加 --no-generate 标志以支持纯模板生成

- 新增 `--no-generate` 参数,强制使用模板生成而非 AI
- 调整 `--yes` 参数仅跳过交互提示,不改变生成行为
- 统一使用工具函数替代 println 输出
This commit is contained in:
2026-08-21 13:57:25 +08:00
parent e6b8b344aa
commit a40c88c768
22 changed files with 5709 additions and 1473 deletions

View File

@@ -230,6 +230,10 @@ quicommit profile token
quicommit config set-llm ollama
quicommit config set-llm ollama --base-url http://localhost:11434 --model llama2
> ⚠️ **安全提示**:把 API 密钥作为命令行参数传入会留在 shell history 与进程列表中。
> 建议直接运行 `quicommit config set-api-key`(或 `config set-llm`)不携带密钥,
> 以隐藏方式输入。
# 配置OpenAI
quicommit config set-llm openai
quicommit config set-api-key YOUR_API_KEY
@@ -323,7 +327,7 @@ quicommit config reset --force
| `--commitlint` | 使用commitlint格式 |
| `--no-verify` | 不验证提交信息 |
| `-t, --think` | 启用 LLM 思考/推理模式(覆盖配置) |
| `-y, --yes` | 跳过确认提示 |
| `-y, --yes` | 跳过确认提示(生成行为不变) |
| `--push` | 提交后推送到远程 |
| `--remote` | 指定远程仓库默认origin |
@@ -343,7 +347,7 @@ quicommit config reset --force
| `-r, --remote` | 指定远程仓库默认origin |
| `--dry-run` | 试运行 |
| `-t, --think` | 启用 LLM 思考/推理模式(覆盖配置) |
| `-y, --yes` | 跳过确认提示 |
| `-y, --yes` | 跳过确认提示(生成行为不变) |
### changelog命令选项
@@ -360,7 +364,8 @@ quicommit config reset --force
| `--format` | 格式keep-a-changelog、github-releases |
| `--dry-run` | 试运行输出到stdout |
| `--think` | 启用 LLM 思考/推理模式(覆盖配置) |
| `-y, --yes` | 跳过确认提示 |
| `--no-generate` | 使用模板确定性生成(不调用 AI |
| `-y, --yes` | 仅跳过确认提示(生成行为不变) |
## 配置文件
@@ -419,6 +424,9 @@ auto_generate = true
path = "CHANGELOG.md"
auto_generate = true
[output]
emoji = true
[repo_profiles]
"/path/to/work/project" = "work"
"/path/to/personal/project" = "personal"
@@ -430,7 +438,15 @@ auto_generate = true
|--------|------|
| `QUICOMMIT_CONFIG` | 配置文件路径 |
| `EDITOR` | 默认编辑器 |
| `NO_COLOR` | 禁用彩色输出 |
| `NO_COLOR` | 禁用彩色与 Emoji 装饰输出(任意值即生效) |
| `RUST_LOG` | 覆盖 `-v` 的日志过滤(例如 `debug` |
## 全局选项
- `-v, --verbose`(可叠加):`-v` 显示 info 日志、`-vv` debug、`-vvv` trace。
- `--no-color`:禁用彩色**与** Emoji 装饰(最高优先级)。
- `--emoji` / `--no-emoji`:强制开启/关闭 Emoji 装饰,覆盖 `output.emoji` 配置。
- Emoji 装饰也可通过 `quicommit config set output.emoji true|false` 配置。
## 故障排除
@@ -447,7 +463,7 @@ quicommit config set llm.provider ollama
# 获取配置值
quicommit config get llm.provider
# 设置API密钥存储在系统密钥环中
# 设置API密钥存储在系统密钥环中;省略密钥值可通过隐藏提示输入
quicommit config set-api-key YOUR_API_KEY
# 从密钥环删除API密钥