cargo Verified current stable Not installed? Documentation

Cargo / Display General Help

Display General Help

Displays help information for the cargo command.

$
Terminal
cargo help

When To Use

When needing guidance on available commands and options in Cargo.

Pro Tip

Use 'cargo help | less' for easy navigation of large help texts.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
USAGE:
    cargo [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -V, --version     Prints version information
    -h, --help        Prints this message or the help of the given subcommand

SUBCOMMANDS:
    build        Compile the current package
    check        Analyze the current package and report warnings
    clean        Remove the target directory
    doc          Generate documentation
    new          Create a new cargo package
    run          Run a binary or example of the local package
    test         Execute tests of the local package

For more information, visit www.rust-lang.org.

Anatomy of Output

Understanding the result

Cargo help: List of commands and usage. Help Information

Notifies the user about the content of this help display.

Available commands: build, run, test, install, and more. Command List

Enumerates various functionalities provided by Cargo.

For detailed command help, use 'cargo help <subcommand>'. Subcommand Note

Guides users to additional help.

Power User Variants

Optimized versions

cargo help -v

Display help information in verbose mode.

cargo help --json

Output help in JSON format for parsing.

Troubleshooting

Common pitfalls

Error: Help documentation not found.

Solution: Reinstall or update Cargo to get the latest help documentation.

Error: Access denied to help documentation.

Solution: Run with elevated permissions.

Error: Command 'cargo help' failed.

Solution: Ensure your Cargo installation is functioning correctly.

Command Breakdown

What each part is doing

cargo
Base Command
The executable that performs this operation. Here it runs Cargo before the shell applies any redirect operators.

How To Run

Execution path

  1. Step 1

    Run `cargo help` to display the general help menu.

  2. Step 2

    Verify that the output includes commands like 'build', 'check', and 'run'.

  3. Step 3

    Consult the official documentation for detailed subcommand information.

Alternative Approaches

Comparable commands in other tools

Alternative documentation tools for the same job.