Why I Built MateCommit: Automating My Git Workflow with AI
The 2 AM Commit Message Problem
We've all been there. It's 2 AM. You've been coding for 4 hours straight. You finally solved that nasty bug or implemented that complex feature. Your brain is fried, and you're ready to commit and go to bed.
Then you stare at the terminal:
git add .
git commit -m "???"
Your mind goes blank. You end up writing something like "fix bug", "changes", or my personal favorite: "oops".
I hated seeing my git history full of uninformative messages, but honestly, I also hated spending 5 minutes thinking of the perfect "Conventional Commit" when I was exhausted. So, I decided to automate the paperwork.
The Journey Starts (as a Go learning project)
I started the first version of this project about a year ago. To be honest, I was just starting to learn Go at the time. I’ve always been fascinated by how tools like Terraform or Docker work, and I wanted to see if I could build something similarly robust.
I built a basic version that worked, was happy with it, and actually stopped working on it for a while. But by September 2025, I noticed a frustrating pattern. My commit messages were great, but I was still losing a massive amount of time manually drafting PR descriptions and grouping commits for releases.
My brain started racing: "If the AI knows what I changed, why am I still doing the rest of the paperwork manually?"
I got completely "cebado" (an Argentinian way of saying I got over-excited and hyper-focused). What started as a small script quickly evolved into a complete Git workflow assistant.
The technical headache: From Brittle RegEx to JSON
One of the most interesting technical hurdles was parsing the AI's response. In the early days, I asked the AI for Markdown. Parsing that with RegEx was a nightmare—one extra backtick or an unexpected sentence and the tool would crash.
I eventually switched to a JSON-first approach, but LLMs love to "chat" even when you ask for raw JSON. They often wrap everything in markdown backticks (
json ...
) or add "thinking" paragraphs.
To fix this, I had to write a Lenient JSON Parser that strips away all that noise before the unmarshal step. It was a headache to debug, but it made the tool significantly more robust.
What MateCommit actually does
I've been using it for a while now, and these are the parts that save me the most time:
- Meaningful Commits: It follows Conventional Commits and looks at the whole diff. It's surprisingly good at catching why a change was made.
- PR Summaries: I hate writing PR descriptions. Now the CLI drafts the summary, test plan, and flags breaking changes for me.
- Automated Releases: It gathers changes between tags, categorizes them, and generates a SemVer-compliant release with a full changelog in seconds.
Making it feel like a professional tool
I didn't want this to be a "hacky" script. I wanted it to feel like something you'd use at work every day.
Going Global and Team Ready
When I started, the tool was entirely in Argentinian Spanish. But as the project grew, I realized that if I wanted others to use it, I had to go global. I implemented a full i18n system. Now, the tool supports both English and Spanish, making it ready for international teams while still keeping its "Mate" roots in the config.
But going global also meant respecting how teams work. I made sure the AI respects your project's GitHub or GitLab templates. Whether it's an .github/ISSUE_TEMPLATE or a PULL_REQUEST_TEMPLATE.md, the CLI reads your specific format and ensures the AI-generated content follows your house rules. No more "AI-style" summaries that don't fit your team's convention.
Caching (and saving money)
I added a local caching system because I realized I was paying for the same analysis twice when tweaking small things. If you run suggest on a diff you already analyzed, it's now instant and costs $0.
The "Doctor" command and DX
I'm obsessed with DX (Developer Experience), so I added a few things I always miss in other tools:
- Config Doctor: Run
matecommit config doctorand it will check your API keys, Git permissions, and connectivity. - Shell Autocompletion: Full support for Bash, Zsh, and Fish.
- Cost Awareness: It tracks exact token usage and calculates the actual USD cost of every call. I added a daily budget feature because I once accidentally burned $5 testing a loop... lesson learned.
How it compares to other tools
| Feature | MateCommit 🧉 | aicommits | commitizen |
|---|---|---|---|
| AI Commits | Yes | Yes | No |
| PR & Release Notes | Yes | No | No |
| Cost Tracking (USD) | Yes (Real-time) | No | N/A |
| Single Binary (Go) | Yes | No (Node) | No (Node) |
What’s Next?
The project is fully open source and I'm currently working on:
- Local LLMs (Ollama): This is my top priority for privacy.
- GitLab & Bitbucket support.
- Gemini 2.0 Thinking: Exploring how the new reasoning models can improve complex PR summaries.
Try It Yourself
If you have Go installed, you can install it directly from the source:
go install github.com/thomas-vilte/matecommit/cmd/matecommit@latest
Check the repo here: github.com/thomas-vilte/matecommit
What’s the worst commit message you’ve ever written? Mine was just a single dot . because I was too tired to type. Let me know in the comments! 👇
Built with 🧉 and passion in Argentina


Top comments (0)