An AI-powered Git commit assistant that not only generates commit messages, but also automatically analyzes and splits your code changes into multiple well-organized commits following best practices.
- Analyzes code changes and splits them into logical commits
- Generates descriptive commit messages for each split
- Allows specifying number of commits or letting AI decide
- Works with any git repository
Use pip to install (Python >=3.10)
pip install aicmt
or use brew to install
brew install versun/tap/aicmt
- Create configuration file
.aicmtrc
Reference the template file .aicmtrc.template
and create .aicmtrc
in your home directory.
cp .aicmtrc.template ~/.config/aicmt/.aicmtrc
You can also create .aicmtrc
in the current directory, which will override the global configuration file (~/.config/aicmt/.aicmtrc)
cd /path/to/git/repo
touch .aicmtrc
-
Add OpenAI API and other information in the configuration file.
-
Enter your git repository directory and run the
aicmt
command to automatically analyze changes and generate commit messages.
$ aicmt -h
usage: aicmt [-h] [-v] [-n N]
<<< AICMT (AI Commit) - AI-powered Git commit assistant >>>
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-n, --num-commits N Number of commits to generate (default: AI decides)
- Clone the repository:
git clone https://github.com/versun/aicmt.git
- Install dependencies:
cd aicmt
pip install -e ".[dev]"
All code in this project is AI-generated, so if you encounter any problems, please first try asking AI for solutions (preferably using the claude-3.5-sonnet model). If the issue persists, please submit an issue, and I will consult AI to resolve it.
Pull requests are welcome! Please submit an issue before submitting a pull request, to avoid duplicate submissions.
I am deeply grateful to my amazing supporters and sponsors who have made my open source journey possible.