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
12_Encourage LLMs towards well-formatted commits_
13
14## Installation
15
16```sh
17go install git.secluded.site/formatted-commit@latest
18```
19
20Copy/paste into wherever you tell your models how to write commits.
21
22```markdown
23Create commits exclusively using `formatted-commit`. Try to use it normally, but
24if it's not in my PATH, ask me to `go install
25git.secluded.site/formatted-commit@latest`. It has no sub-commands and the following options:
26<formatted-commit_flags>
27-b --body Commit body (optional)
28-B --breaking Mark as breaking change (optional)
29-h --help Help for formatted-commit
30-m --message Commit message (required)
31-s --scope Commit scope (optional)
32-T --trailer Trailer in 'Sentence-case-key: value' format (optional, repeatable)
33-t --type Commit type (required)
34-v --version Version for formatted-commit
35</formatted-commit_flags>
36<formatted-commit_example>
37formatted-commit -t feat -s "web/git-bug" -m "do a fancy new thing" -T "Crush <crush@charm.land>" -b "$(cat <<'EOF'
38Multi-line
39
40- Body
41- Here
42 EOF
43 )"
44</formatted-commit_example>
45```
46
47## Usage
48
49```text
50$ formatted-commit -h
51
52 formatted-commit helps you create well-formatted Git commits that follow
53 the Conventional Commits specification with proper subject length validation,
54 body wrapping, and trailer formatting.
55
56 USAGE
57
58
59 formatted-commit [--flags]
60
61
62 EXAMPLES
63
64
65 # With co-author
66 formatted-commit -t feat -m "do a thing" -T "Crush <crush@charm.land>"
67
68 # Breaking change with longer body
69 formatted-commit -t feat -m "do a thing that borks a thing" -B "$(cat <<'EOF'
70 Multi-line
71 - Body
72 - Here
73
74 This is what borked because of new shiny, this is how migrate
75 EOF
76 )"
77
78 # Including scope for more precise changes
79 formatted-commit -t refactor -s "web/git-bug" -m "fancy shmancy" \
80 -b "Had to do a weird thing because..."
81
82
83 COMMANDS
84
85 help [command] Help about any command
86
87 FLAGS
88
89 -b --body Commit body (optional)
90 -B --breaking Mark as breaking change (optional)
91 -h --help Help for formatted-commit
92 -m --message Commit message (required)
93 -s --scope Commit scope (optional)
94 -T --trailer Trailer in 'Sentence-case-key: value' format (optional, repeatable)
95 -t --type Commit type (required)
96 -v --version Version for formatted-commit
97```