Commit Wizard is a Visual Studio Code extension designed to streamline your Git workflow by automating the commit process with AI-generated messages. Powered by the Gemini API, Commit Wizard ensures your commit messages are concise, meaningful, and adhere to the Conventional Commit standard—all while intelligently grouping related changes into logical commits.
Smart Commit Grouping: Instead of processing changes based solely on individual files, Commit Wizard sends a unified diff to the Gemini API. Gemini then analyzes and groups related changes together, returning a JSON array with file groups and their corresponding commit messages.
Streamlined Git Workflow: Automates staging, generating commit messages, and committing files—either grouped by Gemini’s analysis or on a per-file basis.
Customization: Configure your Gemini API key and default behaviors (such as auto-confirmation and commit grouping) via VS Code settings.
Requirements
Git: Installed and properly configured on your system.
Gemini API Key: Obtain your API key from the Gemini API Portal to enable AI-powered commit messages.
Extension Settings
Commit Wizard introduces the following settings in VS Code:
commitWizard.apiKey: Your Gemini API key for generating AI-powered commit messages.
commitWizard.defaultPrefix: The fallback Conventional Commit prefix to use if the AI response is missing or invalid (default: refactor).
commitWizard.groupCommits: When enabled, all changes are sent as a unified diff to Gemini for logical grouping into commits.
commitWizard.autoConfirmCommit: When enabled, the AI-generated commit messages are used automatically without prompting for user confirmation.
Installation
Install from Marketplace: Search for "Commit Wizard" in the VS Code Marketplace and install it.
Manual Installation: Download the .vsix package and install it manually:
Open the Extensions view (Ctrl+Shift+X / Cmd+Shift+X).
Click the ... (More Actions) menu and select Install from VSIX.
Choose the downloaded .vsix file.
Usage
Open a Git Repository: Ensure your project is a Git repository opened in VS Code.
Configure API Key: Set your commitWizard.apiKey via the Set Gemini API Key command.
Run Commands: Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and use one of the following commands:
Commit All Changes Individually / Grouped:
Run Commit Wizard: Commit All Changes to commit all detected changes.
If groupCommits is enabled, the extension will send the unified diff to Gemini, receive commit groups (each with a list of files and a message), and commit each group accordingly.
Otherwise, each file is processed individually.
Commit Staged Changes:
Run Commit Wizard: Commit Staged Changes to commit all staged changes in a single commit, with an AI-generated message.
Workflow Example
Modify Files: Edit, add, or delete files in your project.
Run Command: Use Commit Wizard: Commit All Changes.
AI-Powered Commit Grouping:
Gemini analyzes your unified diff and groups related changes. For example:
The extension stages each group and commits them with the suggested messages, optionally allowing you to review and edit each commit message if autoConfirmCommit is disabled.
Commands
Command
Description
Set Gemini API Key
Configure your Gemini API key for generating commit messages.
Commit All Changes
Analyze all changes in the repository and commit them either individually or in groups.
Commit Staged Changes
Commit all staged changes with a single AI-generated message.
Contributing
Contributions are welcome! To contribute:
Fork the repository.
Create a new branch for your feature or bugfix.
Submit a pull request with a detailed description of your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you encounter any issues or have suggestions for improvements, please open an issue on GitHub.
Acknowledgments
Gemini API: For providing the AI-powered text generation capabilities.
VS Code: For the extensible platform that makes this extension possible.
Enjoy using Commit Wizard to simplify and enhance your Git workflow! 🚀