| Crates.io | koji |
| lib.rs | koji |
| version | 3.3.1 |
| created_at | 2022-05-01 07:37:18.539833+00 |
| updated_at | 2025-11-30 16:19:32.504911+00 |
| description | An interactive CLI for creating conventional commits. |
| homepage | |
| repository | https://github.com/cococonscious/koji |
| max_upload_size | |
| id | 578510 |
| size | 667,194 |
An interactive CLI for creating conventional commits, built on cocogitto and inspired by cz-cli.
curl -sS https://webinstall.dev/koji | bash
cargo install --locked koji
Be sure to have git installed first.
The basic way to use koji is as a replacement for git commit,
enforcing the conventional commit
standard by writing your commit through an interactive prompt.
# Do some work
cd dev/koji
git add README.md
# Commit your work
koji
See koji --help for more options.
Use koji completions <SHELL> to generate completion scripts for your shell.
An alternative way to use koji is as a git hook,
running it any time you run git commit.
Update .git/hooks/prepare-commit-msg with the following code:
#!/bin/bash
exec < /dev/tty && koji --hook || true
npx husky add .husky/prepare-commit-msg "exec < /dev/tty && koji --hook || true
Add the prepare-commit-msg hook type and the koji hook to .pre-commit-config.yaml:
default_install_hook_types: [prepare-commit-msg, ...]
repos:
- repo: local
hooks:
- id: prepare-msg
name: prepare commit message
entry: bash -c "exec < /dev/tty && koji --hook || true"
language: system
stages: [prepare-commit-msg]
Similar should work for any hook runner, just make sure you're using
it with the prepare-commit-msg hook.
When using it as a hook, any message passed to git commit -m will be used
for the commit summary. Writing your commit as a conventional commit,
e.g. git commit -m "feat(space): delete some stars", will bypass
koji altogether.
Config values are prioritized in the following order:
koji --help)--config.koji.toml in the working directory$XDG_CONFIG_HOME/koji/config.toml~/.config/koji/config.toml%USERPROFILE%\AppData\Roaming\koji\config.tomlautocompletebooltrueautocomplete = true
breaking-changesbooltruebreaking_changes = true
commit-typesVec<CommitType>true[[commit_types]]
name = "feat"
emoji = "✨"
description = "A new feature"
emojibooltrueemoji = true
issuesbooltrueissues = true