DEV Community

Cover image for Commit Messages on Autopilot: How I Built an AI-Powered Tool to Save Time and Sanity
Denilson
Denilson

Posted on

1

Commit Messages on Autopilot: How I Built an AI-Powered Tool to Save Time and Sanity

The Problem: Writing Commit Messages Sucks

If you've ever worked on a project with frequent commits, you know the pain of writing commit messages. In the past year alone, I've made over 2,500 commits—and I had to write every single message.

Some were clear and meaningful. Others? Not so much. I’d often type something generic like fix stuff or small changes just to move on. But when I needed to revisit those changes, I had zero context on what actually happened in those commits.

Wouldn't it be great if something could just write the commit messages for me?

The Idea: Let AI Do the Heavy Lifting

That's when I decided to build Cortex CLI, an AI-powered commit message generator. The idea was simple:

  1. Read my code changes
  2. Pass them to an AI
  3. Get a meaningful commit message in return

I started this as a quick side project, but it quickly became indispensable. Now, I use it every single day, and some of my friends do too.

Last month alone, three of us generated over 700 commit messages using Cortex. The time savings have been massive, and my commit history has never been this clean.

How It Works

The CLI: Your Terminal's Best Friend

Cortex CLI is a command-line tool that integrates seamlessly into your workflow. After installing it and setting your API token, you can generate commit messages like magic:

cortex commit-message --commitStaged
Enter fullscreen mode Exit fullscreen mode

Boom! AI-generated commit messages, no thinking required. You just review the output and move on.

Want to integrate it deeper? You can create a .cortexrc file in your projects to customize how the AI generates messages. One of my favorite features is the --preScript flag, which runs unit tests and linting before committing. No more broken commits!

👉 Check out the CLI Docs


The Web App: A Command Center for Your Commits

While the CLI is great for quick commits, I also wanted a UI where I could manage everything—so I built one in Meteor, React, and MongoDB.

🔗 Check it out here

What can you do in the UI?

✅ View all AI-generated commit messages\
✅ Create templates to fine-tune how messages are generated\
✅ Set up daily commit reports summarizing your work\
✅ Organize and filter your commits with tags (coming soon!)

And of course, the API lives here as well, powering both the CLI and the web app.


Challenges & Solutions

1. Getting AI to Write Good Commit Messages

At first, I struggled to get consistently useful commit messages. The AI would sometimes produce vague or unhelpful descriptions. The problem? The prompt mattered way more than I expected.

So, instead of fighting it, I built a template system that lets users customize exactly how they want their commit messages structured. Now, you can use template strings and create AI prompts that match your team's style.

🔗 Check out the Templates Docs

2. Keeping Code Secure

I knew that people would be worried about sending their code to an AI. That’s why Cortex never stores or shares your source code. It only processes the diffs of your changes and deletes everything afterward.

Security-first design. No storing, no tracking.

🔗 More on security in the FAQ


How We’re Using It

Everyone in my circle uses Cortex the same way:

  • Create a .cortexrc file in each project to customize AI behavior
  • Run cortex commit-message whenever committing changes
  • (Optional) Use --preScript to run tests before committing

This setup has saved us tons of time. No more pausing coding sessions just to think about commit messages. We just review, approve, and move on.


What’s Next?

This is just the beginning! Here’s what’s coming:

🚀 JetBrains & VS Code extensions – No need to run commands, just click a button!\
🤖 AI-powered code reviews – Before committing, get suggestions on how to improve your code.\
🏷️ Better filters & tags – Make the UI even more powerful.

I’m also open to feedback! If you try it out and have ideas, let me know.

👉 Get started here: https://commits.denyhs.com/docs?section=getting-started


Let’s Automate Commit Messages Forever

Building Cortex has been a game-changer for me and my workflow. If you’re tired of writing commit messages, give it a try!

Would love to hear your thoughts. What features would you like to see next? Let’s make commit messages effortless for everyone! 🚀

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more