๐ฆ koji
An interactive CLI for creating conventional commits, built on cocogitto and inspired by cz-cli.
Features
- Create conventional commits with ease & help contributors do the same without them having to know how to write one
- A single binary so you don't need to bring along a whole other ecosystem to your project
- Use emoji ๐
- Autocomplete for scope
- Run as a git hook
- Use custom commit types
Installation
Check the releases page to download koji for your platform.
This will soon enough be made easier with webinstall.dev.
Usage
Using koji
# Do some work
cd dev/work-stuff
git add .env.production
# Create a conventional commit
koji
With emoji
Passing -e
or --emoji
to koji
will prepend your commit message
with an emoji related to the commit type. The default emoji can be seen
here.
You can also use shortcodes (:pinched_fingers:
) in the scope, summary, or body.
Autocomplete
Passing -a
or --autocomplete
to koji
will enable autocomplete for the scope
prompt. This scans your commit history to collect previous scopes, so it does slow
down the startup a bit.
For reference, ran inside the angular repo with 22k commits:
koji 0.00s
koji -a 0.40s
As a git hook
If you're using rusty-hook, set this
in your .rusty-hook.toml
file.
prepare-commit-msg = "koji --hook"
Similar should work for any hook runner, just make sure you're using
it with the prepare-commit-msg
hook as it writes the commit
message to COMMIT_EDITMSG
.
Use custom commit types
You can add custom commit types via a koji.toml
file in the working directory.
Some examples can be found here.