GitMuse is an AI-powered tool that helps developers craft meaningful and descriptive Git commit messages.
Project description
GitMuse
GitMuse is an AI-powered tool that helps developers craft meaningful and descriptive Git commit messages. By analyzing your staged changes, GitMuse provides intelligent suggestions for your commit messages, making your Git history more informative and easier to navigate.
Features
- AI-Powered Commit Messages: Leverages OpenAI's GPT models or Ollama for locally hosted models to generate context-aware commit messages.
- Git Integration: Seamlessly integrates with your existing Git workflow.
- Customizable: Configure AI providers, commit message styles, and other preferences via a JSON configuration file.
- Interactive CLI: User-friendly command-line interface with rich formatting for easy interaction.
- Diff Analysis: Intelligent analysis of your staged changes to provide accurate commit message suggestions.
Installation
pip install gitmuse
Note: GitMuse requires Python 3.11 or higher.
Usage
-
Stage your changes as you normally would:
git add .
-
Instead of using
git commit
, use GitMuse:gitmuse commit
-
GitMuse will analyze your changes and suggest a commit message. You can accept, modify, or reject the suggestion.
Configuration (Optional)
GitMuse can be configured to match your preferences. Optionally, create a gitmuse.json
file in your project root or home directory to customize the settings:
{
"version": 1,
"ai": {
"provider": "ollama",
"ollama": {
"model": "llama3.1",
"url": "http://localhost:11434",
"max_tokens": 1000,
"temperature": 0.7
}
},
"commit": {
"style": "conventional",
"maxLength": 72,
"includeScope": true,
"includeBody": true,
"includeFooter": true
}
}
For more configuration options, refer to the gitmuse-schema.json
file in the repository.
FAQ
What should I do if I encounter issues during installation?
-
Upgrade pip:
python -m pip install --upgrade pip
-
Check Python version: Ensure you are using Python 3.11 or higher:
python --version
GitMuse is installed but the gitmuse
command is not found. What should I do?
-
Check PATH: Ensure that your Python
bin
directory is in your system's PATH. You can add it to your PATH by modifying your shell configuration file (e.g.,.bashrc
,.zshrc
):export PATH="$HOME/.local/bin:$PATH"
-
Reinstall GitMuse: Sometimes reinstalling the package can resolve PATH issues:
pip uninstall gitmuse pip install gitmuse
GitMuse is not generating commit messages as expected. What can I do?
-
Check configuration: Ensure your
gitmuse.json
configuration file is correctly set up if you have one. -
Update GitMuse: Make sure you have the latest version of GitMuse:
pip install --upgrade gitmuse
-
Review error messages: If there are error messages, review them for clues about what might be wrong. Ensure all dependencies are correctly installed.
Contributing
We welcome contributions! Please see our Contributing Guide for more details.
License
GitMuse is released under the MIT License. See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.