Rust Tools



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.

πŸ‘οΈ The cargo Book

🌞 rustc

The Rust compiler. It is usually invoked through cargo.

πŸ‘οΈ The rustc Book

🌞 rustup

The Rust toolchain installer and version manager.

πŸ‘οΈ The rustup Book

🌞 rustfmt

A tool for formatting Rust code. Included with Rust toolchains.

rustup component add rustfmt

πŸ‘οΈ The rustfmt Book

🌞 clippy

A collection of lints to catch common mistakes and improve your Rust code.

rustup component add clippy

πŸ‘οΈ The clippy Book

🌞 rustdoc

The Rust documentation generator. Usually invoked through cargo doc.

πŸ‘οΈ The rustdoc Book

🌞 mdbook

A utility to create modern online books from Markdown files.

cargo install mdbook

🌞 crates.io Page
πŸ‘οΈ The mdBook Book

🌞 bindgen

Automatically generates Rust FFI bindings to C libraries.

cargo install bindgen-cli

🌞 crates.io Page
πŸ‘οΈ The bindgen User Guide

🌞 miri

An interpreter for Rust’s mid-level intermediate representation. Useful for detecting undefined behavior.

rustup component add miri

πŸ‘οΈ Source Repository

Cargo plugins

🌞 cargo-edit

Extra cargo subcommands for editing Cargo.toml.

cargo install cargo-edit

🌞 crates.io Page
πŸ‘οΈ Source Repository


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

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 cargo-deny

Cargo plugin for linting your dependencies. Checks for security vulnerabilities, licenses, and more.

cargo install cargo-deny

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 cargo-license

Displays the license of dependencies.

cargo install cargo-license

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 cargo-audit

Audit Cargo.lock files for known security vulnerabilities.

cargo install cargo-audit

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 cargo-generate

Generate a new Rust project from a template.

cargo install cargo-generate

🌞 crates.io Page
πŸ‘οΈ Source Repository

More Rust tools

🌞 clippy-control

Temporarily allow/deny clippy lints from the command line.

cargo install clippy-control

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 wasm-bindgen

Generates the JavaScript glue that loads a wasm32-unknown-unknown module built with the wasm-bindgen crate, and rewrites the module to match. Its version must exactly match the version of the wasm-bindgen crate in the project’s Cargo.lock. wasm-pack and trunk run it as part of their builds.

rustmax install-tool wasm-bindgen

🌞 crates.io Page
πŸ‘οΈ The wasm-bindgen Guide

Non-Rust tools for Rust

🌞 mold

A high-performance linker that significantly speeds up Rust builds on Linux.

rustmax install-tool mold

πŸ‘οΈ Source Repository


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

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 just

A simple and suprisingly useful command runner with make-like syntax.

cargo install just

🌞 crates.io Page
πŸ‘οΈ Source Repository


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
    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

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 basic-http-server

A simple HTTP server for serving static files.

cargo install basic-http-server

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 gist

Upload code to GitHub Gist from the command line.

cargo install gist

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 jaq

A jq clone focused on correctness, speed, and simplicity.

cargo install jaq

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 jsonxf

A JSON transformer and formatter.

cargo install jsonxf

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 fd

Find files recursively. A simple, fast and user-friendly alternative to β€˜find’. Pair with sd to search and replace.

cargo install fd-find

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 sd

Intuitive find & replace CLI, sed alternative, pair with fd.

cargo install sd

🌞 crates.io Page
πŸ‘οΈ Source Repository

🌞 dust

Show disk usage. A more intuitive version of du.

cargo install du-dust

🌞 crates.io Page
πŸ‘οΈ Source Repository