Git Commit Autocomplete is a Visual Studio Code extension that helps you generate git commit messages using OpenAI's GPT-3.5-turbo. The extension analyzes your changes and suggests a commit message based on the modifications made.
- AI-powered commit message suggestions
- Seamless integration with VSCode
- User prompts for accepting or rejecting suggested commit messages
- Configurable OpenAI API key
- Error handling for rate limiting and missing API key
- Visual Studio Code
- An OpenAI API key (Sign up at OpenAI to get an API key)
- Clone the repository:
git clone https://github.com/jsambuo/git-commit-autocomplete.git
- Navigate to the extension directory:
cd git-commit-autocomplete
- Install the dependencies:
npm install
- Compile the extension:
npm run compile
- Open the extension in VSCode:
code .
- Press
F5
to open a new VSCode window with the extension loaded.
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
on macOS). - Type
Open Settings (JSON)
and select it. - Add the following configuration to set your OpenAI API key:
"gitCommitAutocomplete.apiKey": "your-openai-api-key"
Replace your-openai-api-key
with your actual OpenAI API key.
- Make some changes to your git repository.
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
on macOS). - Type
Suggest Commit Message
and select it. - If there are changes, the extension will suggest a commit message based on the modifications.
- You can accept the suggested commit message to automatically commit your changes.
- If the API key is not set, the extension will prompt you to configure it in the settings.
- If the rate limit is exceeded, a specific error message will inform you to wait before trying again.
- If there are no changes to commit, the extension will display a message and skip the API call.
To contribute or modify this extension, follow these steps:
- Clone the repository:
git clone https://github.com/jsambuo/git-commit-autocomplete.git
- Navigate to the extension directory:
cd git-commit-autocomplete
- Install the dependencies:
npm install
- Compile the extension:
npm run compile
- Open the extension in VSCode:
code .
- Press
F5
to open a new VSCode window with the extension loaded.
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing the AI models used in this extension.
- Simple-Git for simplifying git commands in Node.js.
- Axios for handling HTTP requests.
For any questions or feedback, please open an issue on the GitHub repository.