1<!--
  2SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
  3
  4SPDX-License-Identifier: CC0-1.0
  5-->
  6
  7# formatted-commit
  8
  9[](https://api.reuse.software/info/git.secluded.site/formatted-commit)
 10[](https://goreportcard.com/report/git.secluded.site/formatted-commit)
 11
 12CLI tool that requires conformance with the Conventional Commits specification
 13through flags, made for LLMs and not really for humans (but I guess you can use
 14this directly if you want). Humans would likely prefer, as the author does,
 15[meteor](https://github.com/stefanlogue/meteor).
 16
 17## Installation
 18
 19```sh
 20go install git.secluded.site/formatted-commit@latest
 21```
 22
 23Copy/paste into wherever you tell your models how to write commits. I like
 24[Crush 💘](https://github.com/charmbracelet/crush) (and maintain [a
 25fork](https://git.secluded.site/crush)) and [OpenCode](https://opencode.ai/) as
 26the more-open options and [Amp](https://ampcode.com/) as the best/proprietary
 27option.
 28
 29```markdown
 30Create commits exclusively using `formatted-commit`. Try to use it normally, but if it's not in my PATH, ask me to `go install git.secluded.site/formatted-commit@latest`. It has no sub-commands and the following options:
 31<formatted-commit_flags>
 32-b --body Commit body (optional)
 33-B --breaking Mark as breaking change (optional)
 34-h --help Help for formatted-commit
 35-m --message Commit message (required)
 36-s --scope Commit scope (optional)
 37-T --trailer Trailer in 'Sentence-case-key: value' format (optional, repeatable)
 38-t --type Commit type (required)
 39-v --version Version for formatted-commit
 40</formatted-commit_flags>
 41<formatted-commit_example>
 42formatted-commit -t feat -s "web/git-bug" -m "do a fancy new thing" -T "Crush <crush@charm.land>" -b "$(cat <<'EOF'
 43Multi-line
 44
 45- Body
 46- Here
 47
 48EOF
 49)"
 50</formatted-commit_example>
 51```
 52
 53## Usage
 54
 55```text
 56$ formatted-commit -h
 57
 58  formatted-commit helps you create well-formatted Git commits that follow
 59  the Conventional Commits specification with proper subject length validation,
 60  body wrapping, and trailer formatting.
 61
 62  USAGE
 63
 64
 65    formatted-commit [--flags]
 66
 67
 68  EXAMPLES
 69
 70
 71    # With co-author
 72    formatted-commit -t feat -m "do a thing" -T "Crush <crush@charm.land>"
 73
 74    # Breaking change with longer body
 75    formatted-commit -t feat -m "do a thing that borks a thing" -B "$(cat <<'EOF'
 76    Multi-line
 77    - Body
 78    - Here
 79
 80    This is what borked because of new shiny, this is how migrate
 81    EOF
 82    )"
 83
 84    # Including scope for more precise changes
 85    formatted-commit -t refactor -s "web/git-bug" -m "fancy shmancy" \
 86      -b "Had to do a weird thing because..."
 87
 88
 89  COMMANDS
 90
 91    help [command]  Help about any command
 92
 93  FLAGS
 94
 95    -b --body       Commit body (optional)
 96    -B --breaking   Mark as breaking change (optional)
 97    -h --help       Help for formatted-commit
 98    -m --message    Commit message (required)
 99    -s --scope      Commit scope (optional)
100    -T --trailer    Trailer in 'Sentence-case-key: value' format (optional, repeatable)
101    -t --type       Commit type (required)
102    -v --version    Version for formatted-commit
103```