
I got tired of committing "fix: please work", so I built a Rust CLI/TUI to write Conventional Commits for me Cogit v0.1.0
Hey everyone,
Let’s be honest for a second. We’ve all seen (or written) commit histories that look something like this:
- fix: bug
- fix: actually fix the bug
- fix: forgot semicolon
- please work
- asdfghjkl
- final_final_v2_really_working
Your team lead sighs. Git blame becomes a game of Russian roulette. And when it’s time to write a release changelog, nobody has any idea what actually changed.
I got tired of staring blankly at a 500-line diff on Friday afternoon trying to craft the perfect Conventional Commit message, so I built Cogit — a lightweight CLI and TUI tool written in Rust.
What does it actually do?
You stage your files with git add, run cogit, and it inspects your staged diff to generate clean, structured Conventional Commits (feat:, fix:, refactor:, chore:, etc.).
Here’s why it’s not just another Python wrapper script:
- Dual-Pane TUI (
cogit --tui): Built withratatui. You get a syntax-highlighted diff on the left and an editable textarea on the right. You can scroll through your changes, edit the generated message in-place, press[r]to regenerate with a hint (e.g. "focus on the auth refactor"), or hit[e]to drop straight into$EDITOR. - Multi-Provider AI: Works out of the box with Google Gemini, OpenAI, Grok (xAI), Groq, or 100% locally with Ollama if you don't want your code leaving your machine.
- Lockfile & Noise Sanitization: It automatically strips
Cargo.lock,package-lock.json, and binary blobs from the diff payload before sending it to the LLM so you don't burn tokens on 15,000 lines of hash changes. - Safe by Design: It invokes
git commit -Funder the hood via a temporary buffer, meaning it preserves your existing pre-commit hooks, GPG/SSH signatures, and git config. - Detailed Mode (
-d): If you need more than a single-line summary,-dgenerates a conventional subject line along with bulleted rationale for PRs and complex reviews.
Links & Code
It's completely free and open source under the MIT license:
- GitHub: https://github.com/shadowmkj/cogit
- Crates.io: https://crates.io/crates/cogit
I’d love to hear your feedback, feature requests, or constructive roasts. Let me know what you think!
Also any contributions are welcome 🦀