Fills the Git commit input box (it does not run git commit)
Output language follows VS Code UI language (Japanese if vscode.env.language starts with ja, otherwise English), unless your format instruction specifies otherwise
Fully customizable output format (e.g., Conventional Commits, bullets-only, etc.)
Optional notification showing token usage and estimated cost
Requirements
VS Code (extension engine: ^1.107.0)
Built-in Git extension enabled (vscode.git)
OpenAI API key (required to generate messages)
Installation
From Marketplace (if published): search for “Git AI Message” in VS Code Extensions and install
From VSIX: Extensions view → ... → “Install from VSIX…”
Quick Start
Run Git AI Message: Set OpenAI API Key to store your API key (saved in Secret Storage).
Stage changes (git add ...).
Generate a message using either:
Command Palette: Git AI Message: Generate commit message from staged changes
The ✨ button in the Source Control view title bar
Review/edit the inserted message and commit as usual.
If there are no staged changes, the extension shows a warning (git diff --cached is empty).
Commands
Command
Description
Git AI Message: Generate commit message from staged changes
Generates a commit message and fills the commit input box
If set, the extension instructs the model to follow the format exactly (highest priority).
If empty, the default behavior is to generate a single-line subject only (no body).
Examples:
Line 1 must be type(scope): subject (<= 72 chars). Line 2 blank. Lines 3+ are "- " bullets.
English only. One line: "Summary: ...". No body.
Security / Privacy
What is sent: staged diff (git diff --cached) and a summary (git diff --cached --stat) are sent to the OpenAI API. Be careful with sensitive repositories.
API: OpenAI Responses API (POST {apiBaseUrl}/responses).
Requests include store: false (note: retention can still be affected by org/account settings).
If the diff exceeds gitAIMessage.maxDiffChars, it is truncated and a notice is appended ([...truncated to N chars...]).
Your API key is stored in VS Code Secret Storage.
Troubleshooting
“No staged changes found”: run git add first.
“Could not apply the commit message”: make sure the built-in Git extension (vscode.git) is enabled.
“OpenAI API error”: verify your API key, gitAIMessage.apiBaseUrl, model name, and network environment.