Use Azure/OpenAI API to review Git changes, generate conventional commit messages that meet the conventions, simplify the commit process, and keep the commit conventions consistent.
English · 简体中文 · Report Bug · Request Feature
- 🤯 Support generating commit messages based on git diffs using ChatGPT / Azure API.
- 🗺️ Support multi-language commit messages.
- 😜 Support adding Gitmoji.
- 📝 Support Conventional Commits specification.
- Search for "AI Commit" in VSCode and click the "Install" button.
- Install it directly from the Visual Studio Code Marketplace.
Note
Make sure your node version >= 16
- Ensure that you have installed and enabled the "AI Commit" extension.
- In VSCode settings, locate the "ai-commit" configuration options and configure them as needed.
- Make changes in your project and add the changes to the staging area (git add).
- Next to the commit message input box in the "Source Control" panel, click the "AI Commit" icon button. After clicking, the extension will generate a commit message and populate it in the input box.
- Review the generated commit message, and if you are satisfied, proceed to commit your changes.
Note
If the code exceeds the maximum token length, consider adding it to the staging area in batches.
In the VSCode settings, locate the "ai-commit" configuration options and configure them as needed:
Configuration | Type | Default | Required | Notes |
---|---|---|---|---|
OPENAI_API_KEY | string | None | Yes | OpenAI token |
OPENAI_BASE_URL | string | None | No | If using Azure, use: https://{resource}.openai.azure.com/openai/deployments/{model} |
OPENAI_MODEL | string | gpt-3.5-turbo | Yes | OpenAI MODEL |
AZURE_API_VERSION | string | None | No | AZURE_API_VERSION |
AI_COMMIT_LANGUAGE | string | en | Yes | Supports 19 languages |
EMOJI_ENABLED | boolean | true | Yes | Enable or disable Emoji |
FULL_GITMOJI_SPEC | boolean | false | No | Enable the complete GitEmoji specification, see https://gitmoji.dev/ |
You can use Github Codespaces for online development:
Alternatively, you can clone the repository and run the following commands for local development:
$ git clone https://github.com/sitoi/ai-commit.git
$ cd ai-commit
$ npm install
Open the project folder in VSCode. Press F5 to run the project. This will open a new Extension Development Host window and launch the plugin within it.
Contributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub Issues to get stuck in to show us what you’re made of.
- auto-commit - https://github.com/lynxife/auto-commit
- opencommit - https://github.com/di-sukharev/opencommit
This project is MIT licensed.