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
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
43EOF
44)"
45</formatted-commit_example>
46```
47
48## Usage
49
50```text
51$ formatted-commit -h
52
53  formatted-commit helps you create well-formatted Git commits that follow
54  the Conventional Commits specification with proper subject length validation,
55  body wrapping, and trailer formatting.
56
57  USAGE
58
59
60    formatted-commit [--flags]
61
62
63  EXAMPLES
64
65
66    # With co-author
67    formatted-commit -t feat -m "do a thing" -T "Crush <crush@charm.land>"
68
69    # Breaking change with longer body
70    formatted-commit -t feat -m "do a thing that borks a thing" -B "$(cat <<'EOF'
71    Multi-line
72    - Body
73    - Here
74
75    This is what borked because of new shiny, this is how migrate
76    EOF
77    )"
78
79    # Including scope for more precise changes
80    formatted-commit -t refactor -s "web/git-bug" -m "fancy shmancy" \
81      -b "Had to do a weird thing because..."
82
83
84  COMMANDS
85
86    help [command]  Help about any command
87
88  FLAGS
89
90    -b --body       Commit body (optional)
91    -B --breaking   Mark as breaking change (optional)
92    -h --help       Help for formatted-commit
93    -m --message    Commit message (required)
94    -s --scope      Commit scope (optional)
95    -T --trailer    Trailer in 'Sentence-case-key: value' format (optional, repeatable)
96    -t --type       Commit type (required)
97    -v --version    Version for formatted-commit
98```