If you write code every day, you probably write Git commit messages every day too.And if you're honest… you probably don’t enjoy it.
I definitely didn’t.
So I built a small tool that fixes this tiny but annoying problem.
It’s called slothcommit , an AI-powered CLI that generates commit messages for you.
yeah so i decided to write this blog on " my first npm package" , why I built it, and what I learned along the way.
The Problem: Writing Commit Messages is Annoying
My typical workflow looked something like this:
Write some code
Stage the files
git add .
- Then get stuck writing a commit message.
Sometimes I would write something lazy like:
fix stuff
Or something even worse:
update
When I did want a good commit message, the workflow was painful:
Copy my code changes
Paste them into ChatGPT
Ask it to generate a commit message
Copy the result back
Finally run
git commit
It worked but thing is it was slow and repetitive and focus am lazy asf so i wanted a more lazier way to do this git commit message thing.
So I thought:
Why can't a CLI tool just do this automatically?
That idea became slothcommit.
The Idea Behind Slothcommit
The idea was simple.
Instead of manually writing commit messages, a CLI tool should:
Look at the git diff
Send it to an AI model
Generate a clean conventional commit message
Run the commit automatically
So the workflow becomes:
git add .
sloth
And that's it.
workflow diagram :
What Slothcommit Does (or how it works)
slothcommit is an AI-powered Git commit assistant.
It analyzes your staged changes and generates a commit message using the Conventional Commit format.
Example output:
feat(auth): add refresh token middleware
and while am writing this blog the package is now getting 100+ downloads every week, which is really encouraging to see!
If you haven’t tried it yet, check it out here:
https://www.npmjs.com/package/slothcommit
and in case you like it ? do give it a star https://github.com/anshumancodes/sloth