Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Custom AI CommitNew to Visual Studio Code? Get it now.
Custom AI Commit

Custom AI Commit

stackcn

|
3 installs
| (1) | Free
Generate editable AI commit messages from staged Git changes.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Custom AI Commit

根据 Git 变更,一键生成可编辑的 AI Commit Message。

快速开始

  1. 设置 API Key:在命令面板(Cmd/Ctrl+Shift+P)运行 AI Commit: 设置 API Key,输入你的 API Key(安全存储在 VS Code SecretStorage 中)。
  2. 配置模型:在设置中搜索 aiCommit,配置:
    • aiCommit.provider.baseUrl:OpenAI 兼容接口的 Base URL(默认 https://api.openai.com/v1)
    • aiCommit.provider.model:模型名称
  3. 生成 Commit Message:
    • 先在源代码管理中暂存(Stage)你的变更;
    • 点击源代码管理标题栏的 AI Commit 按钮,或运行 AI Commit: 生成 Commit Message。

使用

生成后会在编辑器旁打开结果面板:

  • 实时流式显示生成的 commit message;
  • 直接在面板中编辑内容;
  • 点击 ✓ 应用到提交框(或按 Ctrl/Cmd+Enter)将内容填入 Git 提交输入框;
  • 也可以 复制、↻ 重新生成、✎ 追加指令(临时加一条要求重新生成)。

如果没有暂存变更,面板会提示,可选择使用工作区(未暂存)的变更来生成。

命令

命令 说明
AI Commit: 生成 Commit Message 根据 Git 变更生成 commit message
AI Commit: 设置 API Key 设置 API Key(安全存储)
AI Commit: 打开设置 打开插件设置

常用配置

  • aiCommit.prompt.customRules:自定义提交规则,默认按中文 Conventional Commits 生成,仅返回 commit message。
  • aiCommit.commit.format:提交格式,conventional(规范格式)或 freeform(自由格式)。
  • aiCommit.provider.temperature / aiCommit.provider.maxTokens:采样温度 / 最大输出 token 数。
  • aiCommit.provider.stream:是否流式输出。
  • aiCommit.history.inferFormat:未配置自定义规则时,根据最近 Git 提交历史推断提交风格。
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft