LinuxCommandLibrary

cargo-help

Display Cargo subcommand help information

TLDR

Display general help

$ cargo help
copy

Display help for a subcommand
$ cargo help [subcommand]
copy

SYNOPSIS

cargo help [OPTIONS] [SUBCOMMAND]

PARAMETERS

-h, --help
    Prints help information for cargo help or the specified SUBCOMMAND

-V, --version
    Prints version information

-Z <UNSTABLE OPTIONS>...
    Comma-separated list of unstable (nightly-only) Cargo flags

[SUBCOMMAND]
    Name of the Cargo subcommand to display detailed help for (e.g., build, run)

DESCRIPTION

The cargo help command provides detailed documentation and usage information for the Cargo Rust package manager directly from the terminal. Invoked as cargo help, it outputs an overview of all available Cargo subcommands, their purposes, and global configuration options. To view help for a specific subcommand, append its name, such as cargo help build or cargo help install. This displays the subcommand's synopsis, parameters, environment variables, examples, and more in a structured, readable format.

It serves as an essential reference tool for Rust developers, eliminating the need for external documentation during command-line workflows. Help text is context-aware: top-level help lists commands like build, run, test, and publish; subcommand help includes detailed option descriptions and defaults. Supports Cargo's global flags for customization, such as verbosity or color output, though primarily focused on informational display. Ideal for quick lookups, learning new features, or troubleshooting syntax.

EXAMPLES

cargo help # Top-level overview
cargo help build # Build subcommand details
cargo help --help # Help on help itself

GLOBAL OPTIONS

Inherits Cargo globals like -v (verbose), -q (quiet), --color (when=auto|always|never)

HISTORY

Introduced with Cargo's initial stable release in 2015 as part of Rust's toolchain evolution from Mozilla's 2014 prototype. Evolved alongside Cargo (now at version 1.80+), adding support for workspace features, unstable flags, and improved formatting. Essential since Cargo CLI standardization.

SEE ALSO

cargo(1), man(1), rustup(1)

Copied to clipboard