Stop Writing Commit Messages, Let AI Do It
We've all been there. It's the end of a long coding session, you're ready to push, and you draw a blank. "What did I even do?" You end up typing git commit -m "fix stuff" or "update" for the hundredth time. Good commit messages are crucial for a maintainable project, but in the moment, they feel like a chore.
What if you could automate that? Not with a generic template, but with an AI that actually reads your diff and writes a clear, descriptive message for you. That's exactly what Lumen does.
What It Does
Lumen is a command-line tool that automates your Git commit messages. You run it, it analyzes the staged changes in your repository (the git diff), and uses a local AI model to generate a coherent commit message. It then presents that message to you for approval, editing, or regeneration before committing. It takes the friction out of the last step before git push.
Why It's Cool
The clever part is that it runs locally. Your code diffs never leave your machine. It uses the Ollama platform to run a local Large Language Model (like Llama 3.2 or Mistral), which means you don't need an API key, there are no usage costs, and you maintain complete privacy.
It’s also simple and stays in your workflow. You don't need to change how you use Git. Instead of git commit -m "message", you just run lumen. It shows you what it thinks you did, you say yes (or tweak it), and it handles the commit. It turns a mundane task into a one-second interaction.
How to Try It
Getting started is straightforward. You'll need Ollama installed first to handle the local models.
- Install Ollama: Head to ollama.com and download it for your system.
- Pull a Model: Once Ollama is running, pull a model. The creator suggests:
ollama pull llama3.2 - Install Lumen: Use the Go package manager:
go install github.com/jnsahaj/lumen@latest - Run it: Navigate to your Git repo, stage some changes (
git add .), and run:lumen
Follow the prompts to approve or edit the suggested message. That's it.
Final Thoughts
As developers, we should automate the boring stuff. Writing good commit messages is important, but it's a perfect candidate for an AI assistant. Lumen isn't about being flashy; it's a practical, privacy-focused tool that solves a small but frequent pain point. I can see this becoming a quiet part of my daily workflow, saving mental energy for the actual code. It's definitely worth a few minutes to set up and try in your next working session.
Found an interesting tool? Let us know @githubprojects.
Repository: https://github.com/jnsahaj/lumen