Simple AI Committer
A simple, practical way to generate Git commit messages from staged changes using an OpenAI-compatible LLM, then insert them directly into the VS Code Source Control input box.
🛍️ Marketplace · 📚 Documentation · 🐙 GitHub · 🚀 快速说明
Features
- Generate Conventional Commits with the wand button in the Source Control title bar.
- Analyze only the changes you stage yourself. The extension never runs
git add or commits for you.
- Skip the AI request when no changes are staged, with a hint explaining whether there are unstaged changes.
- Use English interface text and built-in prompts by default. With the Simplified Chinese (
zh-cn) VS Code display language, use Chinese text and prompts.
- Customize
aiCommit.systemPrompt to match your team's commit format and preferred output language.
- Connect to an OpenAI-compatible Chat Completions endpoint, including OpenAI, DeepSeek, Kimi, GLM, or local Ollama.
- Include file summaries for long diffs within a strict character budget, and cancel generation from its notification.
- Preserve drafts edited during generation and allow only one generation task per repository.
- Store a single API key securely in VS Code SecretStorage, with confirmed migration of legacy settings.
- Generate for the selected repository when using its Source Control title-bar command in a workspace with multiple repositories.
Installation
Marketplace
- Open the Extensions view in VS Code (
Ctrl+Shift+X on Windows/Linux or Cmd+Shift+X on macOS).
- Search for Simple AI Committer by u7pi.
- Click Install.
Local VSIX
Use Extensions: Install from VSIX... from the Command Palette, or run:
code --install-extension simple-ai-committer-0.3.2.vsix
Usage
- Configure your API base URL and model. Enter the API key in Settings (
aiCommit.apiKey) or run Simple AI Committer: Set API Key if authentication is required.
- Stage changes in Source Control using the
+ button or git add.
- Click the wand button in the Source Control title bar, or run Simple AI Committer: Generate Commit Message from Staged Changes from the Command Palette.
- Review and edit the generated message in the Source Control input box.
- Commit when you are ready.
No staged changes means no AI request. If a Source Control repository is unavailable but generation succeeds, the message is copied to the clipboard.
Cancel from the generation notification. Repeated clicks for the same repository are skipped while generation is running. If you edit the commit draft during generation, your draft is preserved and the result is not inserted.
Documentation
See the documentation index for all guides.
| Guide |
Contents |
| Configuration |
Settings, API URL selection, commit format, and output language |
| Provider examples |
OpenAI, DeepSeek, Kimi, GLM, Ollama, and compatible gateways |
| Troubleshooting |
Git setup, output language, and generation errors |
| Development |
Local setup, tests, compilation, and debugging |
| Packaging and publishing |
Version updates, VSIX verification, and Marketplace publishing |
Changelog and license
See the English changelog or 简体中文更新日志.
Licensed under MIT.
快速说明
本扩展读取已暂存的 diff,使用兼容 OpenAI Chat Completions 的模型生成提交信息并填入源代码管理输入框。不会自动暂存或提交;没有已暂存更改时不调用 AI。
- 在设置中搜索
aiCommit,配置 API 地址和模型;需要认证时直接在设置中输入 API Key(aiCommit.apiKey),或运行“Simple AI Committer:设置 API Key”。
- 手动暂存更改,点击源代码管理标题栏的魔杖按钮,或运行“Simple AI Committer:根据已暂存的更改生成提交信息”。
- 审查生成的提交信息后再提交。
运行“Simple AI Committer:选择 API 地址(支持自定义输入)”可选择常用接口,也可输入完整的 http(s) URL。已有工作区地址时更新工作区,否则更新用户设置;模型与 API Key 需单独配置。
密钥保存在 VS Code SecretStorage 中,切换 API 地址后仍使用同一密钥,且不跨机器同步。在设置中输入的 Key 首次使用时会迁入安全存储,该栏随即改为 ***** 掩码显示,不再留空或暴露明文;设置栏中的明文 Key 一律视为最新输入——与安全存储不同的值会自动覆盖旧值并恢复掩码(无需确认),相同值自动改为掩码;仅首次从空的存储迁入明文 Key 时需要一次确认,「暂不」则本次直接使用该明文 Key 但不存储。通过“设置 API Key”命令保存的 Key 同样会在设置栏显示 *****。运行“清除已存储的 API Key”会同时删除安全存储中的值和设置栏掩码;设置中遗留的明文 Key 仍会生效。
生成通知提供取消按钮。同一仓库重复点击会跳过,不同仓库可以并行;生成期间修改草稿会保留草稿,不写入生成结果。无暂存更改时也不会覆盖已有非空草稿。
VS Code 显示语言为简体中文(zh-cn)时,界面和内置提示词使用中文;其他语言统一使用英文。aiCommit.systemPrompt 保持内置默认值(未修改)时启用该行为,自定义提示词仍优先使用。设置界面中显示的默认提示词为英文版;如需固定生成语言,请直接修改该提示词。
aiCommit.maxDiffChars 默认 6000,长 diff 先加入文件及增删摘要(最多占三分之一预算),再截断正文;摘要和截断提示也计入上限。temperature 为 -1 或 0–2,默认 -1(不发送该参数,Claude、GPT-5.x、Kimi 等固定温度模型必须省略,否则报 400);仅在模型接受时设 0–2(如 0.3 更稳定)。timeoutMs 默认 30000 毫秒,是包含连接和接收响应的总时限;两个长度/时间设置必须为正整数。Git 不在 PATH 时设置 gitPath 的完整路径。本地 Ollama 无需认证时可不设置密钥;已有安全密钥需先清除,并清空旧设置。
详细说明见文档索引:配置参考、服务商示例、故障排查。历史变更见简体中文更新日志。
Attribution
Forked from humaid24/ai-commit-generator under the MIT license.