Mettā

decentralized internets

Useful cargo commands

Some additional cargo commands exist to provide unprecedented level of support and extensibility to regular cargo. Here's a list of commands I use (will be updated over time, last update 2025-01-12):

Commands that run via cargo

Sorted alphabetically:

πŸ“¦ cargo-aoc crates.io - Advent of Code helper.

πŸ“¦ cargo-audit crates.io - audit Cargo.lock for security vulnerabilities.

πŸ“¦ cargo-binutils crates.io - proxy for LLVM tools like llvm-nm, llvm-objdump and llvm-size. Beware of nasty LLVM bugs like this one.

πŸ“¦ cargo-bloat crates.io - find out what takes most of the space in your executable.

πŸ“¦ cargo-bundle crates.io - create OS-specific app bundles from rust binaries.

πŸ“¦ cargo-cache crates.io - manage and clean cargo cache.

πŸ“¦ cargo-clippy crates.io - over 300 lints to make your Rust code tidy.

πŸ“¦ cargo-deny crates.io - manage large dependency graphs, check licenses, security advisories or outright ban certain packages.

πŸ“¦ cargo-dfu crates.io - flash embedded firmware using DFU.

πŸ“¦ cargo-edit crates.io - cargo add, cargo rm, and cargo upgrade Cargo.toml dependencies.

πŸ“¦ cargo-expand crates.io - show result of macro expansion and #[derive] expansion.

πŸ“¦ cargo-fix crates.io - automatically apply fix-it suggestions from rustc and clippy to entire project. For better effect, run cargo clean first, then cargo fix --clippy.

πŸ“¦ cargo-fmt crates.io - format Rust code, applies rustfmt to entire crate.

πŸ“¦ cargo-fuzz crates.io - use libFuzzer to fuzz your code easily.

πŸ“¦ cargo-geiger crates.io - count number of unsafe operations in crate and its dependencies.

πŸ“¦ cargo-generate crates.io - generate cargo project from a given template.

πŸ“¦ cargo-graph crates.io - create GraphViz DOT files and dependency graphs.

πŸ“¦ cargo-insta crates.io - snapshot testing using insta.

πŸ“¦ cargo-make crates.io - a decent replacement for make.

πŸ“¦ cargo-outdated crates.io - display out-of-date dependencies.

πŸ“¦ cargo-play crates.io - instant playground. Run your code from single .rs file like if it was a full rust project.

πŸ“¦ cargo-release crates.io - for when you're ready to share your crate with the world, automates mundane release tasks - bumping versions, tagging repo, updating docs, etc.

πŸ“¦ cargo-show-asm crates.io - see the assembly (with cargo asm --asm) or llvm-ir (with cargo asm --llvm or --llvm-input) generated for Rust code. This is an updated version of the unmaintained cargo-asm crate. Install with cargo install --locked --all-features cargo-show-asm.

πŸ“¦ cargo-src crates.io - detailed rust source code browser with semantic details.

πŸ“¦ cargo-sweep crates.io - clean unused build files.

πŸ“¦ cargo-testify crates.io - show popup notifications about testing results.

πŸ“¦ cargo-tree crates.io - visualise crate dependencies as a tree.

πŸ“¦ cargo-update crates.io - add cargo install-update command to upgrade already installed binaries.

πŸ“¦ cargo-vendor crates.io - vendor dependencies into a local directory.

πŸ“¦ cargo-watch crates.io - add a cargo watch command to monitor and rebuild source in case of changes.

πŸ“¦ cargo-web crates.io - automatically build and run web projects (use with parcel for amazing results).

Standalone commands

Sorted alphabetically:

πŸ“¦ aarch64-esr-decoder crates.io - decode aarch64 Exception Syndrome Register values quickly.

πŸ“¦ bandwhich crates.io - a CLI network monitor.

πŸ“¦ bat crates.io - cat with wings. Replace your cat command with a nicer one by doing "alias cat bat".

πŸ“¦ bingrep crates.io - cross-platform binary parser and colorizer. See binary file headers in a nice way.

πŸ“¦ biodiff crates.io - compare binary files using sequence alignment. Makes it easier to see diffs in files that are aaaalmost the same.

πŸ“¦ bootimage crates.io - create a bootable OS image from a kernel binary. Integrates with cargo.

πŸ“¦ broot crates.io - a CLI file manager with nice tree navigation.

πŸ“¦ cc-cli crates.io - git hook for conventional commits - "git commit" and pick details using a CLI.

πŸ“¦ clog-cli crates.io - conventional commits changelog generator. Old.

πŸ“¦ cocogitto crates.io - conventional commits swiss army knife. Does everything.

πŸ“¦ commit-emoji crates.io - git hook to add emoji to your conventional commits. Disclosure: This is my crate.

πŸ“¦ convco crates.io - conventional commits tooling, similar to cocogitto.

πŸ“¦ dirstat-rs crates.io - graphical (CLI) directory tree size statistics. Really nice and fast.

πŸ“¦ dts_viewer crates.io - a CLI viewer for device tree files (DTS, source).

πŸ“¦ du-dust crates.io - graphical (CLI) disk usage statistics. Pretty and fast.

πŸ“¦ dua-cli crates.io - Disk Usage Analyzer. Graphical (CLI) disk usage statistics.

πŸ“¦ elfcat crates.io - generates a cross-referenced HTML file with contents of an input ELF binary.

πŸ“¦ erdtree crates.io - a nicely looking file tree. Be sure to set up one of Nerd Fonts in your terminal.

πŸ“¦ eza crates.io - a modern ls replacement. Do alias ls eza.

πŸ“¦ fd-find crates.io - super fast and simple alternative to find. Do alias find fd for your interactive sessions (the CLI is not compatible with find so keep the scripts happy).

πŸ“¦ fdtdump crates.io - dump device tree files (DTB, compiled).

πŸ“¦ just crates.io - a quick and easy tool runner, useful for automating repeated tasks.

πŸ“¦ version-sync crates.io - keep your version number in documentation and elsewhere in sync with version specified in Cargo.toml

Building WASM with Rust home Reboot to Rust