| Crates.io | whatthecommitcli |
| lib.rs | whatthecommitcli |
| version | 0.1.3 |
| created_at | 2025-10-23 14:32:29.251531+00 |
| updated_at | 2025-10-23 15:37:52.642596+00 |
| description | Generate commit messages from your terminal, inspired by whatthecommit.com |
| homepage | https://github.com/keongalvin/whatthecommit-cli |
| repository | https://github.com/keongalvin/whatthecommit-cli |
| max_upload_size | |
| id | 1897191 |
| size | 68,562 |
whatthecommit.com but local.
cargo install whatthecommitcli
Generate a random commit message using built-in defaults:
whatthecommitcli
Use it directly with git:
git commit -m "$(whatthecommitcli)"
Usage: whatthecommitcli [OPTIONS]
Options:
-n, --names <FILE> Optional path to a custom names file
-c, --commit-messages-template <FILE> Optional path to a custom commit messages template file
-h, --help Print help
-V, --version Print version
The commit message templates support various placeholders that get replaced with dynamic values:
Names are randomly selected from the names file and substituted in three formats:
XNAMEX - Replaces with the name as-is (e.g., "John")XLOWERNAMEX - Replaces with lowercase version (e.g., "john")XUPPERNAMEX - Replaces with uppercase version (e.g., "JOHN")Generate random numbers within specified ranges. The parser supports multiple formats:
XNUMX - Random number from 1 to 999 (default)XNUM10X - Random number from 1 to 10XNUM100X - Random number from 1 to 100XNUM1000X - Random number from 1 to 1000Commas are used to specify custom ranges:
XNUM1,5X - Random number from 1 to 5XNUM,5X - Random number from 1 to 5 (start defaults to 1)XNUM5,X - Random number from 5 to 999 (end defaults to 999)XNUM10,20X - Random number from 10 to 20Note: If start > end in a range, the end is automatically adjusted to start × 2.
Template strings can combine multiple placeholders:
"XNAMEX fixed XNUM50X bugs" → "Alice fixed 7 bugs"
"blame it on XLOWERNAMEX" → "blame it on john"
"XUPPERNAMEX BROKE THE BUILD AGAIN" → "BOB BROKE THE BUILD AGAIN"
"Improved performance by XNUMX%" → "Improved performance by 42%"
"XNAMEX deleted XNUM1000X lines" → "Sarah deleted 834 lines"
"Fixed XNUM1,5X critical issues" → "Fixed 3 critical issues"
You can create your own template files with one template per line:
Create a file with commit message templates (one per line):
# my-commits.txt
XNAMEX made things XNUM10X% better
Fixed XNUM1,100X bugs that XLOWERNAMEX introduced
XUPPERNAMEX DEMANDS THIS COMMIT
Reverted XNAMEX's last XNUM5X commits
Made the code XNUM42,X% more readable
Use it with:
whatthecommitcli -c my-commits.txt
Create a file with names (one per line):
# my-names.txt
Alice
Bob
Charlie
Diana
Eve
Use it with:
whatthecommitcli -n my-names.txt
whatthecommitcli -n my-names.txt -c my-commits.txt
Dual-licensed under Apache 2.0 or MIT.
The default commit messages and names are sourced from https://github.com/ngerakines/commitment.