Skip to main content

Prerequisites

Before installing Dirty, ensure you have the Rust toolchain installed on your system. If you don’t have Rust installed, visit rustup.rs to install it.
Dirty requires Rust to compile from source. The installation process will handle compilation automatically.

Install Dirty

1

Install via Cargo

Run the following command to install Dirty directly from the GitHub repository:
cargo install --git https://github.com/iamkaf/dirty
This will download the source code, compile the binary with optimizations, and install it to your Cargo bin directory (usually ~/.cargo/bin).
2

Verify the installation

Confirm that Dirty is installed correctly by checking the help output:
dirty --help
You should see output similar to:
List git repos, their dirty status, and whether they're local-only

Usage: dirty [OPTIONS] <PATH>

Arguments:
  <PATH>  Directory to scan

Options:
  -L <DEPTH>           Max depth to search for repos [default: 3]
  -d, --dirty          Only show dirty repos
  -l, --local          Only show local-only repos (no remotes)
  -u, --include-unpushed  Include unpushed commit info (ahead of upstream)
  -r, --raw            Raw output for piping (one path per line)
  -h, --help           Print help
3

Add to PATH (if needed)

If the dirty command is not found, ensure that ~/.cargo/bin is in your PATH:
export PATH="$HOME/.cargo/bin:$PATH"
Add this line to your shell configuration file (~/.bashrc, ~/.zshrc, etc.) to make it permanent.
The compiled binary includes link-time optimization (LTO) and is stripped for minimal size and maximum performance.

Next steps

Now that you have Dirty installed, head over to the Quickstart guide to learn how to use it.

Build docs developers (and LLMs) love