An intelligent Python script that generates commit messages using AI models. This tool streamlines your Git workflow by suggesting contextually relevant commit messages based on your staged changes.
- 🧠 Uses OpenAI's GPT models and Google's Gemini model
- 🔄 Supports multiple AI models (GPT-3.5, GPT-4, Gemini)
- 📊 Generates multiple commit message suggestions
- 🖥️ Interactive CLI for selecting or customizing commit messages
- 🔒 Secure API key management
- 📝 Logging for requests and responses
- Python 3.6+
- Git
- API keys for OpenAI and/or Google Gemini
-
Clone the repository:
git clone https://github.com/yourusername/ai-git-commit-message.git
cd ai-git-commit-message
python -m venv venv .\venv\Scripts\activate
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt pip list pip install package_name pip freeze > requirements.txt pip install --upgrade -r requirements.txt pip list --outdated pip install requests pip install --upgrade requests pip freeze > requirements.txt requests>=2.31.0 python-dotenv>=1.0.0 # (optional, for future env file support)
- Go to the Google AI Studio.
- # with your Google account.
- Click on "Create API Key" to generate a new API key.
- Save the API key in
~/.ssh/gemini-api-key
.
- # for an OpenAI account at OpenAI.
- Navigate to the API section and create a new API key.
- Save the API key in
~/.ssh/openai-api-key
.
Note: OpenAI's API is a paid service. Ensure you understand their # before using it.
Run the script in your Git repository:
Follow the prompts to select or customize your commit message.
We're constantly working to improve and expand this tool. Here are some features we're planning to add:
- Integration with more Git operations (e.g., pull requests, merge commit messages)
- Support for additional free and paid AI tools
- Customizable commit message templates
- Integration with popular Git GUIs and IDEs
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for their GPT models
- Google for the Gemini API
- All contributors and users of this project