Rust-Based CLI Tools
Modern terminals mix classic Unix tools with Rust replacements: faster search, better defaults, and ergonomics that compound daily.
Recipe
# Common installs (macOS brew example)
brew install ripgrep fd bat eza starship
# Rust ecosystem via cargo
cargo install cargo-watch cargo-nextest-cli sqlx-cli --locked
cargo install cargo-binstall # faster prebuilt installsWhen to reach for this:
- Onboarding checklist for every Rust developer
- Speeding up search and file navigation
- Local dev loop (
cargo watch) matching CI
Working Example
# Dev loop
cargo watch -x 'test -p billing-api'
cargo nextest run --workspace
# DB migrations
sqlx migrate run
sqlx prepare --check
# Pretty file view with syntax
bat src/main.rs
eza -la --git-ignoreWhat this demonstrates:
cargo-watchreruns tests on savenextestparallel test runnersqlx-climatches runtime sqlx version
Deep Dive
Recommended Toolbox
| Tool | Replaces | Role |
|---|---|---|
rg | grep | Code search |
fd | find | Path discovery |
bat | cat | Syntax-highlighted view |
eza | ls | Git-aware listing |
zoxide | cd | Smart directory jump |
starship | PS1 | Rust/version in prompt |
duf | df | Disk usage overview |
bottom / btm | top | TUI metrics |
cargo-* tools
cargo-audit, cargo-deny, cargo-outdated, cargo-expand, leptosfmt (if Leptos) - add per project needs.
Gotchas
- cargo install without
--locked- surprise dependency breaks. Fix:--lockedon install. - PATH not updated -
~/.cargo/binmissing. Fix: rustup shell snippet in profile. - Duplicate tools - brew and cargo both install
rg. Fix: pick one package source. - Version skew sqlx-cli - migrate format mismatch. Fix: pin CLI version in onboarding doc.
- Heavy cargo install in CI - slow. Fix: use prebuilt binaries or cache
~/.cargo/bin.
Alternatives
| Alternative | Use When | Don't Use When |
|---|---|---|
| GNU coreutils | Minimal container | Daily dev ergonomics |
| Nix dev shell | Exact tool versions | Quick laptop setup |
| mise/asdf | Polyglot pins | rustup-only shops |
FAQs
Must everyone use eza?
No - team lists required vs optional tools in onboarding checklist.
cargo-binstall trust?
Uses project GitHub releases; verify checksums for security-sensitive orgs.
Related
Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.