Skip to content

Third party cargo subcommands

Martin Pool edited this page Oct 13, 2024 · 106 revisions

Third-party cargo subcommands

Cargo is designed to be extensible with new subcommands without having to modify Cargo itself. This is achieved by translating a cargo invocation of the form cargo (?<command>[^ ]+) into an invocation of an external tool cargo-${command} that then needs to be present in the ~/.cargo/bin/ or one of the user's $PATH directories.

Known third-party subcommands

Below is a list of known community-developed subcommands. Please add your own if it's intended and ready for general use.

  • cargo-audit - Audit Cargo.lock for crates with security vulnerabilities
  • cargo-auditable - Embed dependency lists into compiled binaries so you could audit them for vulnerabilities later
  • cargo-asm, cargo-llvm-ir / cargo show-asm - Shows generates assembly or LLVM IR of Rust code
  • cargo-benchcmp - Compare output of cargo bench output, both runs over time and same benchmarks in multiple modules (e.g. for comparing multiple implementations)
  • cargo-bitbake - Generate Yocto's bitbake recipes from your Cargo.toml
  • cargo-bloat - Find out what takes most of the space in your executable.
  • cargo-bundle - Wrap Rust executables in OS-specific app bundles (linux, apple, windows, etc.)
  • cargo-cache - Helps you manage the cargo cache (~/.cargo), print sizes and clear directories
  • cargo-cook - Cooks your crate (packaging & deploying).
  • cargo-clone - Fetch source code of a crate
  • cargo-deadlinks - Check your cargo doc documentation for broken links
  • cargo-deb - Generates & builds Debian packages from cargo projects.
  • cargo-deny - Lint your dependencies
  • cargo-deps - Create dependency diagrams for your Rust projects.
  • cargo-diet - Make your crate lean by computing size-optimal include directives for Cargo manifests.
  • cargo-dist - cargo build but For Building Final Distributable Artifacts and uploading them to an archive.
  • cargo-dinghy - Easier cross-compilation for phones and single boards computers.
  • cargo-do - Run multiple cargo subcommands in sequence (e.g., cargo do clean, build)
  • dors - Task runner for cargo. Deploy, load, or run other scripts from your cargo project
  • cargo-edit - A utility for adding (cargo-add), removing (cargo-rm), and upgrading (cargo-upgrade) cargo dependencies from the command line.
  • cargo-expand - Print the result of macro expansion and #[derive] expansion.
  • cargo-free - Check whether a crate name is available on crates.io.
  • cargo-function-history - search the files in your git history for fumctions with a certain name.
  • cargo-funnel - Sorts and formats your Cargo.toml
  • cargo-fuzz - Command-line wrapper for using libFuzzer
  • cargo-generate - Create a new Rust project by leveraging a pre-existing git repository as a template.
  • cargo-grammarly - Use the grammarly service for checking English grammar in your crate's documentation.
  • cargo-graph - Build GraphViz DOT files of dependency graphs. Unmaintained, consider using cargo-deps.
  • cargo-info - Get crate information and details from crates.io
  • cargo-lambda - Build and deploy AWS Lambda functions built with Rust
  • cargo-license - List licensing info for the project's dependencies.
  • cargo-linked - List Linked packages for a rust binary.
  • cargo-lipo - Automatically create universal libraries for iOS.
  • cargo-lock - List packages, show dependency trees, and translate formats for Cargo.lock files.
  • cargo-machete - Detects unused dependencies in Rust projects, in a fast (yet imprecise) way.
  • cargo-make - Rust task runner and build tool.
  • cargo-modules - List a project's modules in a tree-like format.
  • cargo-multi - Run a cargo command on multiple crates.
  • cargo-mutants - Check whether your tests catch injected synthetic bugs
  • cargo-next - Query or set the version of a crate.
  • cargo-outdated - A cargo subcommand for displaying when Rust dependencies are out of date
  • cargo-patch - Cargo Subcommand for patching dependencies using patch files.
  • cargo-pgo - Cargo subcommand for optimizing Rust binaries with PGO (profile-guided optimization) and BOLT (post-link binary optimizer).
  • cargo-pkgbuild - Generate an Arch PKGBUILD for your crate.
  • cargo-profiler - A cargo subcommand to profile your applications.
  • cargo-release - Standardizes the release process of a cargo project.
  • cargo-rpm - Build RPM releases of Rust projects using cargo.
  • cargo-sandbox - Perform Cargo builds inside of a sandboxed environment (WIP).
  • cargo-script - designed to let people quickly and easily run Rust "scripts" which can make use of Cargo's package ecosystem.
  • cargo-semver-checks - Scan your Rust crate for semver violations.
  • cargo-sort-ck - Checks that your Cargo.toml dependencies are sorted alphabetically.
  • cargo-supply-chain - Gather author, contributor and publisher data on crates in your dependency graph.
  • cargo-tarpaulin - Code coverage tool for your Rust projects
  • cargo-tomlfmt - Formatting Cargo.toml
  • cargo-trend - Generate trend graph of dependent crates
  • cargo-update - Check for cargo installed executables' newer versions and update as needed.
  • cargo-urlcrate - Adds URLs of installing/downloading crates to Cargo output
  • cargo-valgrind - Runs a binary, example, bench, ... inside valgrind to check for memory leaks. Helpful in FFI contexts.
  • cargo-watch - Watch your repo for changes and build automatically.
  • cargo-with - A cargo-subcommand making it easy to run the build artifacts produced by cargo run or cargo build through other tools such as gdb, strace, valgrind, rr, etc.
  • cargo-wix - Builds a Windows installer (msi) using the Wix Toolset based on the contents of a package's manifest (Cargo.toml)
  • cargo-workspaces - Workspace management (create, version, publish) tool.
  • cargo-x - A very simple third-party cargo subcommand to execute a custom command.