# vscode-plugin-ai-git-commit
**Repository Path**: fallsown/vscode-plugin-ai-git-commit
## Basic Information
- **Project Name**: vscode-plugin-ai-git-commit
- **Description**: vscode ai生成插件
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-04-27
- **Last Updated**: 2026-04-29
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# waxy-rice ai git commit
让 AI 读懂你的 Git 变更,一键生成清晰、规范、可直接提交的 commit message。
---
## 它能做什么
`waxy-rice ai git commit` 是一个面向日常开发工作流的 VS Code 插件。它会读取当前仓库的 Git 变更上下文,调用 DeepSeek 或任意 OpenAI 兼容的 Chat Completions API,自动生成符合团队习惯的提交信息。
少写重复文案,多留精力给真正的代码。
## 核心亮点
- 一键生成提交信息:从 Source Control 面板或命令面板直接触发。
- 默认支持 DeepSeek:内置 `https://api.deepseek.com/v1` 与 `deepseek-v4-flash`。
- 兼容 OpenAI 风格接口:可替换 API Base URL、Endpoint、Model。
- 支持 Conventional Commits:默认提示词引导生成 `(): ` 格式。
- 覆盖完整 Git 上下文:支持 staged、unstaged,以及可选 untracked 文件。
- 自动写入提交框:生成后可直接填入 VS Code Source Control 输入框。
- 自动复制到剪贴板:即使未写入提交框,也能快速粘贴使用。
- 可视化设置页:API Key、模型、提示词、请求头、请求体都能在界面中配置。
- SecretStorage 存储密钥:通过插件设置页保存的 API Key 不会明文写入配置文件。
## 快速开始
1. 安装插件后,打开命令面板。
2. 执行 `waxy-rice ai git commit: Open Settings`。
3. 填入 API Key,按需调整模型与提示词。
4. 修改代码后,打开 Source Control 面板。
5. 点击插件按钮,或执行 `waxy-rice ai git commit: Generate Commit Message`。
6. 检查生成结果,直接提交。
## 适合这些场景
- 想让提交历史更统一、更像一个专业项目。
- 不想每次都手写 `feat`、`fix`、`refactor` 这些提交类型。
- 团队要求 Conventional Commits,但成员习惯不完全一致。
- 经常需要根据较长 diff 总结提交意图。
- 使用 DeepSeek、OpenAI 兼容网关、自建模型服务或公司内部代理。
## 默认生成风格
插件默认会要求模型:
- 使用你配置的输出语言。
- 首行简洁明确,建议不超过 72 个字符。
- 复杂变更可以追加简短正文。
- 只输出 commit message 本身,不输出解释、Markdown 或代码块。
- 使用 Conventional Commits 规范。
示例:
```text
feat(settings): mask configured API key in settings view
Show a placeholder when an API key is already stored and avoid
overwriting the saved secret when the placeholder is submitted.
```
## 主要配置
| 配置项 | 默认值 | 说明 |
| --- | --- | --- |
| `aiGitCommit.apiBaseUrl` | `https://api.deepseek.com/v1` | OpenAI 兼容 API 地址 |
| `aiGitCommit.endpointPath` | `/chat/completions` | Chat Completions 接口路径 |
| `aiGitCommit.model` | `deepseek-v4-flash` | 请求使用的模型 |
| `aiGitCommit.outputLanguage` | `zh-CN` | 生成提交信息的语言提示 |
| `aiGitCommit.prompt` | 内置中文模板 | 自定义提交信息提示词 |
| `aiGitCommit.includeUntracked` | `true` | 是否读取未跟踪文件预览 |
| `aiGitCommit.updateScmInput` | `true` | 是否写入 Source Control 输入框 |
| `aiGitCommit.customHeaders` | `{}` | 附加请求头 |
| `aiGitCommit.customBody` | `{}` | 附加请求体,可覆盖默认参数 |
## API Key 与安全
推荐通过 `waxy-rice ai git commit: Open Settings` 填写 API Key。插件会使用 VS Code SecretStorage 保存密钥。
如果已经配置过 API Key,设置页会显示 `************************`,不会把真实密钥回显到界面中。需要替换密钥时,点击输入框并输入新值即可。
## 命令
| 命令 | 作用 |
| --- | --- |
| `waxy-rice ai git commit: Open Settings` | 打开插件设置页 |
| `waxy-rice ai git commit: Generate Commit Message` | 根据当前 Git 变更生成提交信息 |
## 更多
```bash
npm install
npm run compile
npx @vscode/vsce package
```
Press `F5` in VS Code to launch an Extension Development Host, then run:
- `waxy-rice ai git commit: Open Settings`
- `waxy-rice ai git commit: Generate Commit Message`