Files
jj-cz/README.md

96 lines
2.5 KiB
Markdown
Raw Normal View History

2026-02-05 16:25:14 +01:00
# jj-cz: Conventional Commits for Jujutsu
2026-03-23 13:36:45 +01:00
An interactive CLI tool that guides Jujutsu users through creating
[conventional commit](https://www.conventionalcommits.org/) messages.
## Features
- Interactive prompts for type, scope, and description
- All 11 commit types with descriptions (feat, fix, docs, style,
refactor, perf, test, build, ci, chore, revert)
- Optional scope with validation
- 72-character first-line limit enforcement
- Preview before applying
- Clean cancellation with Ctrl+C
## Usage
No fancy tricks, just run `jj-cz`.
```sh
jj-cz
```
The tool detects whether you're in a Jujutsu repository, guides you
through the commit message, and applies it to your current change.
You can also set the revision message of a few revisions at once, or
target a single revision other than the current one.
```sh
jj-cz @- xs develop
```
No explicit revision is simply the equivalent of `jj-cz @`, like
`jj desc`.
2026-03-23 13:36:45 +01:00
## Requirements
- A Jujutsu repository
- An interactive terminal
You dont need `jj` itself to be installed at all, though Im not sure
what `jj-cz` alone would be good for without `jj`.
## Exit Codes
| Code | Meaning |
|------|------------------------------------------------------|
| 0 | Success or clean cancellation |
| 1 | Error (invalid input, repository issues, jj failure) |
| 130 | Interrupted |
## Installation
### From crates.io
Simply run the following command:
```
cargo install jj-cz
```
Done! `jj-cz` is now available!
### With Nix Flakes
Notice how theres a `flake.nix` file? This means you can run the
project using this repository as one of your flakes inputs. In fact,
thats how I install it in my own NixOS configuration! Add this
repository to your configuration:
```nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
jj-cz = {
url = "git+https://labs.phundrak.com/phundrak/jj-cz";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
```
And tadah! you can now install
`inputs.jj-cz.packages.${pkgs.stdenv.hostPlatform.system}.default`
among your other packages. Take a look at my
[`jujutsu.nix`](https://labs.phundrak.com/phundrak/nix-config/src/branch/main/users/modules/dev/vcs/jujutsu.nix)
module if you need some inspiration.
### From source
2026-03-23 13:36:45 +01:00
You can also install `jj-cz` with Cargo by building it from source.
Just make sure Rust is available on your machine (duh!).
2026-03-23 13:36:45 +01:00
```sh
cargo install --path .
```