OS Manuals

/usr/bin/cargo

Empowering everyone to build reliable and efficient software.

From rust-1.98 1.98.1-r3 (os), captured 2026-11-05 by running cargo --help (exit 0). permalink

Rust's package manager

Usage: cargo [OPTIONS] [COMMAND]
       cargo [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]...

Options:
  -V, --version                  Print version info and exit
      --list                     List installed commands
      --explain <CODE>           Provide a detailed explanation of a rustc error message
  -v, --verbose...               Use verbose output (-vv very verbose/build.rs output)
  -q, --quiet                    Do not print cargo log messages
      --color <WHEN>             Coloring [possible values: auto, always, never]
  -C <DIRECTORY>                 Change to DIRECTORY before doing anything (nightly-only)
      --locked                   Assert that `Cargo.lock` will remain unchanged
      --offline                  Run without accessing the network
      --frozen                   Equivalent to specifying both --locked and --offline
      --config <KEY=VALUE|PATH>  Override a configuration value
  -Z <FLAG>                      Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
                                 details
  -h, --help                     Print help

Commands:
    build, b    Compile the current package
    check, c    Analyze the current package and report errors, but don't build object files
    clean       Remove the target directory
    doc, d      Build this package's and its dependencies' documentation
    new         Create a new cargo package
    init        Create a new cargo package in an existing directory
    add         Add dependencies to a manifest file
    remove      Remove dependencies from a manifest file
    run, r      Run a binary or example of the local package
    test, t     Run the tests
    bench       Run the benchmarks
    update      Update dependencies listed in Cargo.lock
    search      Search registry for crates
    publish     Package and upload this package to the registry
    install     Install a Rust binary
    uninstall   Uninstall a Rust binary
    ...         See all commands with --list

See 'cargo help <command>' for more information on a specific command.
Options (13)
OptionDescriptionSource
-V, --versionPrint version info and exit.help + man
--listList all installed Cargo subcommands.help + man
--explain CODERun rustc --explain CODE which will print out a detailed explanation of an error message (for example, E0004).help + man
-v, --verboseUse verbose output (-vv very verbose/build.rs output)help + man
-q, --quietDo not print cargo log messages.help + man
--color WHENColoring [possible values: auto, always, never]help + man
-C DIRECTORYChanges the current working directory before executing any specified operations.help + man
--lockedAsserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated.help + man
--offlinePrevents Cargo from accessing the network for any reason.help + man
--frozenEquivalent to specifying both --locked and --offline.help + man
--config KEY=VALUE|PATHOverrides a Cargo configuration value.help + man
-Z FLAGUnstable (nightly-only) flags to Cargo, see 'cargo -Z help' for detailshelp + man
-h, --helpPrints help information.help + man
Examples (6) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.