-
Notifications
You must be signed in to change notification settings - Fork 0
Development Setup
To build and contribute to retch, ensure you have the following prerequisites installed on your system.
- Rust (latest stable toolchain)
- just (command runner for checking format, running tests, and compiling documentation)
-
mandown (required for generating the manual page via
just man—cargo install mandown) - hyperfine (optional, required for local CLI execution speed benchmarking)
If you use Nix, all prerequisites are provided automatically via the flake devShell:
git clone https://github.com/l1a/retch.git
cd retch
nix developThis drops you into a shell with cargo, rustc, rust-analyzer, just, mandown, hyperfine, and python3 available. Skip to Common Just Recipes once inside.
-
Clone the Repository:
git clone https://github.com/l1a/retch.git cd retch -
Run one-time repo setup (installs git hooks):
This installs the
just setup
post-mergehook that automatically uploads local benchmark results to the dashboard whenever you merge intomain. Only needs to be run once per clone. -
Build the Project:
cargo build --release
| Recipe | Description |
|---|---|
just dev |
Full development cycle: setup → fmt → lint → test → build |
just check |
Strict fmt + clippy checks (same as CI) |
just fmt |
Auto-format code with cargo fmt
|
just lint |
Run clippy with -D warnings
|
just test |
Run all tests |
just build |
Build release binary |
just clean |
Remove build artifacts |
just audit |
Run cargo audit for known security advisories |
just man |
Regenerate docs/retch.1 from docs/retch.1.md via mandown |
just install |
Build and install the binary + man page system-wide |
just install-hooks |
Install git hooks (included in just setup) |
just publish-check |
Verify packaging and dry-run publish for crates.io |
just publish |
Publish both crates to crates.io (sysinfo first, then CLI) |
just pr |
Automated Pre-PR gate — see below |
just open-pr |
Runs just pr, then gh pr create if it passes — the only sanctioned way to open a PR |
just merge-pr |
Squash-merge, switch to main, reset WIP.md — see below |
Never call gh pr create directly. Always use:
just open-pr(any args are forwarded to gh pr create). This runs the automated Pre-PR gate
(just pr) first and only calls gh pr create if it passes. gh has no hook
mechanism of its own, so this Justfile recipe is the one enforcement point that works
regardless of which tool — human shell, Claude Code, or any other agent — is driving.
just pr (run on its own before each subsequent push to an open PR, not just once)
checks you're on a feature branch (not main), that Cargo.toml's version has
been bumped past the last tag, that NOTES.md's "Current State" header matches,
regenerates and diffs the man page, verifies Cargo.lock is committed, runs
just check and cargo test, then prints a manual checklist (README, NOTES.md
release log, wiki, tldr page) that you confirm before it reports the gate passed. See
AGENTS.md in the main repo for the
full checklist this automates.
After a PR is merged, run:
just merge-prThis squash-merges via gh, switches to main, pulls (which also fires the
post-merge benchmark-upload hook — see Running Benchmarks
below), deletes the local feature branch, and resets WIP.md for the next session.
- Run Criterion micro-benchmarks:
just bench
- Benchmark the CLI execution speed:
just bench-cli
- Compare retch against other fetchers (e.g.
fastfetch,neofetch):just bench-compare
- Upload local benchmark results to the gh-pages performance dashboard:
This requires
just bench-upload
hyperfineandgh(GitHub CLI) to be authenticated. It is also run automatically after merging intomainif you have runjust setup. On Windows, run from Git Bash; native cmd/PowerShell are not supported for this recipe.