
I Built a CLI Tool That Writes My Commit Messages
Hello guys! We've all been there. You just finished a feature, you're ready to commit, and then you stare at the terminal for 30 seconds trying to come up with a decent commit message. Sometimes I'd spend more time thinking about the message than writing the actual code. So I did what any developer would do. I automated it. How it started I already had Claude installed on my machine. One day I realized I could just pipe my git diff into it and ask for a commit message. So I added this little function to my .zshrc : gpm () { git diff HEAD | claude -p "propose a conventional commit message for these changes. output only the message, nothing else." } That was it. Run gpm , get a message, copy paste it. Simple. Then I wanted to go further. Why not commit directly with the proposed message? gac () { msg = $( git diff HEAD | claude -p "propose a conventional commit message for these changes, one line only. output only the message, nothing else." ) echo " \n $msg \n " read "confirm?Commit wit
Continue reading on Dev.to
Opens in a new tab



