Commit Composer
A minimal VS Code extension that generates commit messages with a custom OpenAI-compatible model and a customizable prompt.
Features
- Adds a commit message button to the Source Control title bar
- Lets you edit the local model config file from the Command Palette
- Lets you edit the prompt template from the Command Palette
- Uses staged changes first and falls back to unstaged changes when needed
- Silently does nothing when the repository has no changes
- Switches the Source Control button to a loading state while generating
- Writes the generated message directly into the Git commit input box
Configuration
Run Commit Composer: Edit Model Config to open the local config file.
Default content:
{
"baseUrl": "https://api.openai.com/v1",
"apiKey": "",
"model": "gpt-4o-mini"
}
Save the file and run commit generation again to apply the changes.
Prompt Template
Run Commit Composer: Edit Prompt Template to open the template file.
Supported variables:
{{diff}}
{{gitStatus}}
{{recentCommitMessages}}
If the template does not include {{diff}}, the extension appends the selected diff automatically so the model still receives the required context.
If the template does not include {{recentCommitMessages}}, the extension appends the latest commit subjects automatically and asks the model to reference their style when appropriate.
Development
make install
make test
make compile
make package
Open the project in VS Code and press F5 to launch an Extension Development Host.
If the code CLI is available on your machine, you can also run:
make install-vsix