GeminiCommit is a Visual Studio Code extension that automatically generates meaningful commit messages using Google's Gemini AI. This extension simplifies the process of writing clear and descriptive commit messages, saving time and improving the quality of your version control history.
Features
- Automatically generate commit messages based on your staged changes
- Uses Google's Gemini AI for intelligent and context-aware message generation
- Easy-to-use button in the Source Control view
- Customizable API key for Google AI integration
- Supports both English and Russian languages for commit messages
- Choose between short, long, and custom commit message styles
- Select from different Gemini AI models for message generation
Installation
Installing from VS Code Marketplace
The easiest way to install GeminiCommit is directly from the Visual Studio Code Marketplace:
- Open Visual Studio Code
- Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on macOS)
- Search for "GeminiCommit"
- Click on the "Install" button for the GeminiCommit extension by VizzleTF
Alternatively, you can visit the marketplace page directly:
https://marketplace.visualstudio.com/items?itemName=VizzleTF.geminicommit
Installing from VSIX
If you prefer to install from a VSIX file:
- Download the
.vsix
file from the latest release.
- Open Visual Studio Code.
- Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on macOS).
- Click on the "..." menu in the top-right corner of the Extensions view.
- Select "Install from VSIX..." and choose the downloaded
.vsix
file.
Building from Source
If you want to build the extension from source, follow these steps:
Clone the repository:
git clone https://github.com/VizzleTF/GeminiCommit.git
cd GeminiCommit
Install dependencies:
npm install
Compile the extension:
npm run compile
Package the extension:
npm install -g @vscode/vsce
vsce package
This will create a .vsix
file in your project directory.
Install the extension in VS Code:
- Follow steps 2-5 from the "Installing from VSIX" section above, using the
.vsix
file you just created.
Configuration
Before using the extension, you need to set up your Google AI API key and configure your preferences:
- Get your Google AI API key from: https://aistudio.google.com/app/apikey
- Open VS Code settings (File > Preferences > Settings).
- Search for "GeminiCommit" in the settings search bar.
- Enter your Google AI API key in the "Gemini Commit: Google Api Key" field.
- (Optional) Choose your preferred language for commit messages in the "Gemini Commit: Commit Language" dropdown.
- (Optional) Select your preferred commit message length in the "Gemini Commit: Commit Message Length" dropdown.
- (Optional) Choose your preferred Gemini AI model in the "Gemini Commit: Gemini Model" dropdown.
Available Settings
- Gemini Commit: Google Api Key: Your Google AI API key for accessing the Gemini AI service.
- Gemini Commit: Commit Language: Choose between "english" and "russian" for the language of generated commit messages.
- Gemini Commit: Commit Message Length: Choose between "short", "long", and "custom" for the style of generated commit messages.
- Short: Concise, single-line commit messages (up to 50 characters).
- Long: More detailed commit messages with up to 3 lines, providing more context about the changes.
- Custom: Use your own custom instructions for generating commit messages.
- Gemini Commit: Gemini Model: Select the Gemini AI model to use for generating commit messages. Options include "gemini-1.0-pro", "gemini-1.5-pro", and "gemini-1.5-flash".
- Gemini Commit: Custom Instructions: If you selected "custom" for the commit message length, you can provide your own instructions here for generating commit messages.
Usage
- Stage your changes in Git as you normally would.
- In the Source Control view, look for the "GeminiCommit" section.
- Click on the "Generate Commit Message" button (now using the git-commit icon).
- The extension will analyze your staged changes and generate a commit message.
- The generated message will be automatically inserted into the commit message input box.
- Review and edit the message if needed, then commit as usual.
Requirements
- Visual Studio Code version 1.80.0 or higher (>=1.26.0 reqiure VSCode version 1.93.0 or higher
- Git installed and configured in your workspace
- Active Google AI API key
- For building from source:
- Node.js and npm installed on your system
- Basic knowledge of TypeScript and VS Code extension development
Known Issues
- If you encounter a 403 error, it may be due to API key issues or rate limiting. The extension now provides more detailed error information to help troubleshoot these issues.
- Some users may experience network-related errors (like ECONNRESET). The extension now includes a retry mechanism to handle temporary network issues.
Please report any issues or suggest improvements on our GitHub Issues page.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
)
- Commit your changes (
git commit -m 'Add some AmazingFeature'
)
- Push to the branch (
git push origin feature/AmazingFeature
)
- Open a Pull Request
License
This project is licensed under the MIT License.
Acknowledgments
- Thanks to Google for providing the Gemini AI API
- Inspired by the need for quick and meaningful commit messages in development workflows
Support
If you encounter any problems or have any questions, please open an issue on the GitHub repository.
Краткая инструкция по установке (на русском)
- Установите расширение GeminiCommit из Visual Studio Code Marketplace.
- Получите API ключ Google AI на странице: https://aistudio.google.com/app/apikey
- Откройте настройки VS Code (Файл > Параметры > Настройки).
- Найдите "GeminiCommit" в строке поиска настроек.
- Введите ваш API ключ Google AI в поле "Gemini Commit: Google Api Key".
- (Опционально) Выберите предпочитаемый язык для сообщений коммитов в выпадающем списке "Gemini Commit: Commit Language".
- (Опционально) Выберите предпочитаемую длину сообщений коммитов в выпадающем списке "Gemini Commit: Commit Message Length".
- (Опционально) Выберите предпочитаемую модель Gemini AI в выпадающем списке "Gemini Commit: Gemini Model".
- (Опционально) Если вы выбрали "custom" для длины сообщения коммита, введите ваши собственные инструкции в поле "Gemini Commit: Custom Instructions".
Enjoy using GeminiCommit! We hope it enhances your development workflow and improves your commit message quality.