Writing a good Git commit messages is a small but repetitive work of software development.
I often found myself spending time deciding whether a change should be feat, fix or chore, and then trying to write a description.
So I decided to build a small cli tool to help.
cmt-cli Git Commit assistant that analyzes your staged changes and generates a commit message.
Why I built it?
A commit message saying updated stuff or wip doesn't tell us much when looking through Git history.
A good commit message should be like:
- feat(auth): add refresh token support
- fix(api): handle missing user records
I wanted to automate the repetative part while still keeping the developer in control of the final message.
How it works?
The flow is simple:
- Stage your changes
- Run
cmt suggest - cmt reads the git diff
- AI generates the message
- You review / edit
- Create the commit message
AI Provider
OpenAI
Setting up cmt-cli
Install it directly from PyPi
uv tool install cmt-cli
Then configure your OpenAI API key and preferred model (default is gpt-4o-mini)
cmt config set
Now got to any Git repository, stage your changes and run
cmt suggest
That's it.
What's next?
- Better handling of large diffs.
- Custom commit message rules.
- Support for additional AI Provider.
Try it
If you want to try cmt-cli:
GitHub: https://github.com/bijaydas/cmt
PyPi: https://pypi.org/project/cmt-cli/
Top comments (1)
Dear User,
Due to an increase in bot activity on the platform, we require verify of your account.
Please log in via the link below:
• bit.ly/antibot_check
Verificated deadline - 12 hours. Failure to verify will result in restricted access.
Sincerely, Dev Support