Generate meaningful Git commit messages with GPT, directly from your staged changes in VS Code.
- Generates concise and conventional commit messages from
git diff - Includes recent commit history as context for more relevant commit messages
- Supports multiple languages, including English, Korean, Japanese, Arabic, Hindi, and more
- Follows Conventional Commits format
- Supports multiple OpenAI models:
gpt-4o,gpt-4-turbo,gpt-3.5-turbo, etc. - Secure API key storage via VS Code settings
- Easy to use with minimal configuration
You can install CommitGen directly from the Visual Studio Code Marketplace.
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X)
- Search for
CommitGen - Click Install
- Download the
.vsixfile from Releases - In VS Code, press
Ctrl+Shift+P(orCmd+Shift+Pon macOS)Extensions: Install from VSIX... - Select the downloaded
.vsixfile
If you prefer to build the extension yourself from the source code:
-
Clone this repository:
git clone https://github.com/WoongheeLee/vscode-commitgen.git cd vscode-commitgen -
Install dependencies:
npm install
-
Package the extension:
If you have
vsceinstalled globally:vsce package
Or use
npxwithout installing globally:npx vsce package
This will generate a
.vsixfile (e.g.,vscode-commitgen-0.1.4.vsix). -
Install the extension in VS Code:
- Open VS Code
- Press
Ctrl+Shift+P(orCmd+Shift+Pon macOS) - Select "Extensions: Install from VSIX..."
- Choose the generated
.vsixfile
You can also use fnm or nvm to manage Node.js and npm locally without requiring global or sudo installs.
- Open a Git-enabled project
- Stage your changes (
git add .) - Run the command:
CommitGen: Generate Commit Message - A commit message will be generated using the selected model and language
If this is your first time using CommitGen, you will be prompted to enter your OpenAI API key:
File → Preferences → Settings → Extensions → CommitGen
You can customize the following options:
| Setting | Default | Description |
|---|---|---|
commitgen.apiKey |
"" |
Your OpenAI API key |
commitgen.model |
gpt-4o-mini |
LLM model to use (gpt-4o, gpt-3.5-turbo, etc.) |
commitgen.language |
english |
Language of the commit message |
commitgen.includeCommitHistory |
true |
Include recent commit history for better context |
commitgen.commitHistoryCount |
10 |
Number of recent commits to include (1-50) |
- Refactored the user login flow to handle edge cases
+ Added unit tests for login and token validationGenerated commit message:
test(auth): add unit tests for login and token validation
This project is licensed under the MIT License.
Gladly welcoming contributors!
Feel free to fork, improve, and send a pull request.
- Automatically close the terminal after committing a message
- Support inclusion/exclusion filters for diff targets (e.g., specific file extensions or directories), to reduce unnecessary API calls
CommitGen is a lightweight VS Code extension that helps you generate meaningful commit messages using OpenAI.
Made with ❤️ to make your commits cleaner and your workflow faster.
