, 1 min read
Commit messages were always the part I rushed
After a long session my history read like 'fix', 'fix again', 'update'. CommitGen reads the staged diff and writes the message, and it never sends a secret to do it.
- Open source
- Go
- LLM
I care about readable code, and then I'd finish a feature at 2am and type git commit -m "update". My history had more 'fix' commits than I'd like to admit.
CommitGen is a small Go CLI that reads the staged diff and writes a Conventional Commits message for it. I wanted it to work offline first, so it runs on a local model through Ollama, LM Studio or llama.cpp. If you'd rather use a hosted model, any OpenAI-compatible API or Anthropic works too.
Two things I wasn't willing to skip
- Secret masking. API keys, tokens and private keys are redacted before the diff leaves your machine. A commit tool should never be how a key leaks.
- Smart trimming. Lockfiles and build output are skipped, but every file header stays, so the model still knows what changed even in a huge diff.
From there it grew the features I kept wanting: a git hook so it runs on every commit, a one-commit-per-file mode for messy working trees, several candidate messages to pick from, and a per-repo config.
GoReleaser ships it as one static binary for Windows, macOS and Linux. No runtime to install, just download it and commit.