README.md

 1<!--
 2SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
 3
 4SPDX-License-Identifier: CC0-1.0
 5-->
 6
 7# formatted-commit
 8
 9[![REUSE status](https://api.reuse.software/badge/git.secluded.site/formatted-commit)](https://api.reuse.software/info/git.secluded.site/formatted-commit)
10[![Go Report Card](https://goreportcard.com/badge/git.secluded.site/formatted-commit)](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 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:
24<formatted-commit_flags>
25-b --body Commit body (optional)
26-B --breaking Mark as breaking change (optional)
27-h --help Help for formatted-commit
28-m --message Commit message (required)
29-s --scope Commit scope (optional)
30-T --trailer Trailer in 'Sentence-case-key: value' format (optional, repeatable)
31-t --type Commit type (required)
32-v --version Version for formatted-commit
33</formatted-commit_flags>
34<formatted-commit_example>
35formatted-commit -t feat -s "web/git-bug" -m "do a fancy new thing" -T "Crush <crush@charm.land>" -b "$(cat <<'EOF'
36Multi-line
37
38- Body
39- Here
40
41EOF
42)"
43</formatted-commit_example>
44```
45
46## Usage
47
48```text
49$ formatted-commit -h
50
51  formatted-commit helps you create well-formatted Git commits that follow
52  the Conventional Commits specification with proper subject length validation,
53  body wrapping, and trailer formatting.
54
55  USAGE
56
57
58    formatted-commit [--flags]
59
60
61  EXAMPLES
62
63
64    # With co-author
65    formatted-commit -t feat -m "do a thing" -T "Crush <crush@charm.land>"
66
67    # Breaking change with longer body
68    formatted-commit -t feat -m "do a thing that borks a thing" -B "$(cat <<'EOF'
69    Multi-line
70    - Body
71    - Here
72
73    This is what borked because of new shiny, this is how migrate
74    EOF
75    )"
76
77    # Including scope for more precise changes
78    formatted-commit -t refactor -s "web/git-bug" -m "fancy shmancy" \
79      -b "Had to do a weird thing because..."
80
81
82  COMMANDS
83
84    help [command]  Help about any command
85
86  FLAGS
87
88    -b --body       Commit body (optional)
89    -B --breaking   Mark as breaking change (optional)
90    -h --help       Help for formatted-commit
91    -m --message    Commit message (required)
92    -s --scope      Commit scope (optional)
93    -T --trailer    Trailer in 'Sentence-case-key: value' format (optional, repeatable)
94    -t --type       Commit type (required)
95    -v --version    Version for formatted-commit
96```