CLI that turns LLM input into well-formatted Conventional Commits

Files
README.md

git-format #

Go module documentation REUSE status AGPL-3.0-or-later license Liberapay donation status

Open an issue on Tangled Open a pull request on Tangled

CLI tool that produces commits following the Conventional Commits specification through flags, made for LLMs and not really their operators (but I guess you can use this directly if you want). Operators would likely prefer, as the author does, meteor.

I've found that LLMs consistently fail to

  • Format trailers correctly: they add too many newlines between trailers, which breaks tools like git interpret-trailers
  • Include proper scope notation
  • Follow the loose 50/72 subject/body standard held by projects like the Linux kernel. I try to stick to it, but LLMs writing badly-formatted commit messages means rewording work for me once they're done.

git-format enforces all of this. Where possible, we "correct" the model's input. Where that's less possible, we error. For example, instead of requiring the model wrap body text at 72 columns, we let it write whatever body it wants and wrap it ourselves. We can't really fix the subject, so git-format emits an error when the subject is too long with clear indication of where the 50-character cut-off is.

Installation #

You need both the binary and the skill.

The binary #

Pre-built binaries are available at the Tangled releases page.

  • Using mise (recommended), copy the snippet from the Tangled releases page into your mise.toml or global ~/.config/mise/config.toml to automate updates.
  • Without mise, or a similar tool, download the binary for your platform from the releases page and place it somewhere in your $PATH.

You can also install the latest release directly from the Go module:

go install secluded.site/git-format@latest

Then run git-format install to create symlinks so you can invoke it as git formatted-commit and git formatted-tag.


Some other tools if this one interested you

  • garble - transform stdin with an LLM (fix typos, translate, reformat)