Rustmax: Tools
- Standard Rust tools:
cargorustcrustuprustdocrustfmtclippyjustmdbookbindgenmiri - Cargo plugins:
cargo-editcargo-clean-allcargo-denycargo-licensecargo-auditcargo-generate - More Rust tools:
clippy-control - Non-Rust tools for Rust:
mold - More general developer tools:
ripgreptokeibasic-http-servergistjaqjsonxffdsddust
Standard Rust tools
🌞 cargo
The Rust build and packaging tool.
It is the central tool in most Rust development workflows.
It is part of every Rust toolchain,
usually managed by rustup.
🌞 rustc
The Rust compiler.
It is usually invoked through cargo.
🌞 rustup
The Rust toolchain installer and version manager.
🌞 rustfmt
A tool for formatting Rust code. Included with Rust toolchains.
rustup component add rustfmt
🌞 clippy
A collection of lints to catch common mistakes and improve your Rust code.
rustup component add clippy
🌞 rustdoc
The Rust documentation generator.
Usually invoked through cargo doc.
🌞 mdbook
A utility to create modern online books from Markdown files.
cargo install mdbook
🌞 bindgen
Automatically generates Rust FFI bindings to C libraries.
cargo install bindgen-cli
🌞 miri
An interpreter for Rust's mid-level intermediate representation. Useful for detecting undefined behavior.
rustup component add miri
Cargo plugins
🌞 cargo-edit
Extra cargo subcommands for editing Cargo.toml.
cargo install cargo-edit
Installing cargo-edit provides two cargo subcommands:
cargo add
was once provided by cargo-edit but since Rust 1.62.0
is built into cargo itself.
🌞 cargo-clean-all
Recursively clean all Cargo projects in a directory tree.
cargo install cargo-clean-all
🌞 cargo-deny
Cargo plugin for linting your dependencies. Checks for security vulnerabilities, licenses, and more.
cargo install cargo-deny
🌞 cargo-license
Displays the license of dependencies.
cargo install cargo-license
🌞 cargo-audit
Audit Cargo.lock files for known security vulnerabilities.
cargo install cargo-audit
🌞 cargo-generate
Generate a new Rust project from a template.
cargo install cargo-generate
More Rust tools
🌞 clippy-control
Temporarily allow/deny clippy lints from the command line.
cargo install clippy-control
Non-Rust tools for Rust
🌞 mold
A high-performance linker that significantly speeds up Rust builds on Linux.
rustmax install-tool mold
Linking is one of the most time-consuming stages of a Rust build,
and it has to be redone every time you test your program.
On Linux the mold linker is faster than the default linker.
Setting up mold manually requires configuring .cargo/config.toml
and ensuring the linker is properly installed,
but the Rustmax CLI tool handles this setup automatically.
More general developer tools
🌞 ripgrep
A line-oriented search tool that recursively searches your current directory for a regex pattern. Faster than grep and respects gitignore.
Documented in the legendary blog post, "ripgrep is faster than ...".
cargo install ripgrep
🌞 just
A simple and suprisingly useful command runner with make-like syntax.
cargo install just
Almost every project has a handful of commands the developer(s)
uses frequently. Put these in a justfile so the menu of
commands for this project is always obvious, which
can be extra helpful after years away from a project.
just runs commands listed in a file named justfile.
The justfile lives your project's root directory,
and is configured with a make-like syntax:
default:
just --list
install-tools:
cargo install mdbook
cargo install mdbook-yapp
clean: doc-clean
cargo clean
doc-clean:
rm -rf out
It's a simple idea, but suprisingly useful. And don't worry that it looks like
a Makefile — it is much more fun and sensible in use than make.
When you come back to a project and see there's a justfile you
know to run just --list and you'll immediately see what
was on the previous maintainer's mind.
$ just --list
Available recipes:
build
check
clean
default
doc-book
doc-build
doc-clean
doc-crates
install-tools
lint
maint-audit
maint-duplicates
maint-lock-minimum-versions # useful prior to running `cargo audit`
maint-outdated
maint-upgrade
prebuild
publish
publish-dry
replace-version old new
test
test-min-version-build
$ just build
Compiling rustmax-cli v0.0.5 (…/rustmax/crates/rustmax-cli)
…
🌞 tokei
A program for counting lines of code quickly.
cargo install tokei
🌞 basic-http-server
A simple HTTP server for serving static files.
cargo install basic-http-server
🌞 gist
Upload code to GitHub Gist from the command line.
cargo install gist
🌞 jaq
A jq clone focused on correctness, speed, and simplicity.
cargo install jaq
🌞 jsonxf
A JSON transformer and formatter.
cargo install jsonxf
🌞 fd
Find files recursively. A simple, fast and user-friendly alternative to 'find'.
Pair with sd to search and replace.
cargo install fd-find
🌞 sd
Intuitive find & replace CLI, sed alternative,
pair with fd.
cargo install sd
🌞 dust
Show disk usage. A more intuitive version of du.
cargo install du-dust