# git-format [![Go module documentation](https://secluded.site/assets/badges/go-module.svg)](https://pkg.go.dev/secluded.site/git-format) [![REUSE status](https://api.reuse.software/badge/tangled.org/secluded.site/git-format)](https://api.reuse.software/info/tangled.org/secluded.site/git-format) [![AGPL-3.0-or-later license](https://secluded.site/assets/badges/license-agpl-3.0-or-later.svg)](https://spdx.org/licenses/AGPL-3.0-or-later.html) [![Liberapay donation status](https://img.shields.io/liberapay/receives/Amolith.svg?logo=liberapay)](https://liberapay.com/Amolith/) [![Open an issue on Tangled](https://secluded.site/assets/badges/tangled-issue.svg)](https://tangled.org/secluded.site/git-format/issues/new) [![Open a pull request on Tangled](https://secluded.site/assets/badges/tangled-pr.svg)](https://tangled.org/secluded.site/git-format/pulls/new) 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](https://github.com/stefanlogue/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 skill]: https://secluded.site/agent-skills ### The binary Pre-built binaries are available at [the Tangled releases page](https://tangled.org/secluded.site/git-format/tags/latest). - Using [mise](https://mise.jdx.dev/) (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: ```sh 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](https://tangled.org/secluded.site/garble) - transform stdin with an LLM (fix typos, translate, reformat)