CARGO-INFO(1)
π cargo-info β the manual page, but make it cute π
okay bestie, welcome to the General Commands Manual, section 1, where we're pulling up on cargo-info(1) β the page that shows you everything about a package without you having to go dig through crates.io like it's 2014. this is giving β¨research eraβ¨ and we're obsessed.
πΈ NAME πΈ
cargo-info β display information about a package. that's it. that's the whole job. π
π¦ SYNOPSIS π¦
cargo info [options] spec
π DESCRIPTION π
so here's the vibe: this command shows you info about a package. it goes and fetches the data from the package's Cargo.toml file and then presents it to you in a human-readable format β meaning, bestie, it's actually readable, not a wall of unhinged JSON. no cap. π₯
β¨ OPTIONS β¨
π Info Options π
specβ fetch info about the package you name here. the spec can be a package ID, so go peek atcargo-pkgid(1)for the SPEC format if you need the deets. here's the tea though: if the package you're asking about is part of your current workspace, then it just shows you the info from the localCargo.tomlfile instead. also, if theCargo.lockfile doesn't exist, it will be created β surprise, you got a lock file π«Ά. and if you don't specify a version, the appropriate version gets selected based on the Minimum Supported Rust Version (MSRV). slay.--indexindex β the URL of the registry index to use.--registryregistry β name of the registry to use. registry names are defined in Cargo config files (https://doc.rust-lang.org/cargo/reference/config.html). if you don't specify one, the default registry is used β and that default is defined by theregistry.defaultconfig key, which defaults tocrates-io. the default of the default, we love to see it π
π Display Options π
-v,--verboseβ use verbose output. you can specify it twice for "very verbose" output, which includes extra output such as dependency warnings and build script output. may also be specified with theterm.verboseconfig value (https://doc.rust-lang.org/cargo/reference/config.html). double it and it gets chatty π-q,--quietβ do not print cargo log messages. may also be specified with theterm.quietconfig value (https://doc.rust-lang.org/cargo/reference/config.html).--colorwhen β control when colored output is used. valid values:auto(default): automatically detect if color support is available on the terminal.always: always display colors.never: never display colors.
may also be specified with the term.color config value (https://doc.rust-lang.org/cargo/reference/config.html). ok but always is the main character choice ngl π
π§ Manifest Options π§
--lockedβ asserts that the exact same dependencies and versions are used as when the existingCargo.lockfile was originally generated. Cargo will exit with an error when either of the following scenarios arises:- the lock file is missing.
- Cargo attempted to change the lock file due to a different dependency resolution.
it may be used in environments where deterministic builds are desired, such as in CI pipelines. periodt. deterministic or nothing. π
--offlineβ prevents Cargo from accessing the network for any reason. without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. with this flag, Cargo will attempt to proceed without the network if possible.
beware bestie π this may result in different dependency resolution than online mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. see the cargo-fetch(1) command to download dependencies before going offline. plan ahead or perish fr fr.
may also be specified with the net.offline config value (https://doc.rust-lang.org/cargo/reference/config.html).
--frozenβ equivalent to specifying both--lockedand--offline. two flags, one glow-up β¨
π Common Options π
+toolchainβ if Cargo has been installed with rustup, and the first argument to cargo begins with+, it will be interpreted as a rustup toolchain name (such as+stableor+nightly). see the rustup documentation (https://rust-lang.github.io/rustup/overrides.html) for more information about how toolchain overrides work.--config KEY=VALUE or PATHβ overrides a Cargo configuration value. the argument should be in TOML syntax ofKEY=VALUE, or provided as a path to an extra configuration file. this flag may be specified multiple times. see the command-line overrides section (https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides) for more information.-C PATHβ changes the current working directory before executing any specified operations. this affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering.cargo/config.toml, for example. this option must appear before the command name, for examplecargo -C path/to/my-project build. order matters, bestie, don't fight it π
this option is only available on the nightly channel (https://doc.rust-lang.org/book/appendix-07-nightly-rust.html) and requires the-Z unstable-optionsflag to enable (see #10098 βhttps://github.com/rust-lang/cargo/issues/10098). so likeβ¦ nightly girlies only, iykyk π
-h,--helpβ prints help information. when in doubt, ask for help. iconic behaviour.-Zflag β unstable (nightly-only) flags to Cargo. runcargo -Z helpfor details.
π ENVIRONMENT π
see the reference (https://doc.rust-lang.org/cargo/reference/environment-variables.html) for details on environment variables that Cargo reads. go read it, it's right there π«Ά
β EXIT STATUS β
0: Cargo succeeded. π101: Cargo failed to complete. π
π₯ EXAMPLES π₯
- Inspect the
serdepackage from crates.io:
cargo info serde
- Inspect the
serdepackage with version 1.0.0:
cargo info serde@1.0.0
- Inspect the
serdepackage from the local registry:
cargo info serde --registry my-registry
πΈ SEE ALSO πΈ
okay and finally, the sign-off π β this whole page is filed under the General Commands Manual as CARGO-INFO(1), and yeah, its footer is literally just CARGO-INFO(1) again, no date, no version, nothing extra. mysterious. lowkey iconic. anyway bestie, go inspect some packages, you're gonna eat π
β¨π¦
π¦ where this page comes from
- ubuntu jammy: cargo-1.85 1.85.1+dfsg0ubuntu2~bpo0-0ubuntu1.22.04.1 Β· Apache-2.0 WITH LLVM exception
- ubuntu noble: cargo-1.85 1.85.1+dfsg0ubuntu2~bpo0-0ubuntu0.24.04.2 Β· Apache-2.0 WITH LLVM exception
- ubuntu questing: cargo-1.85 1.85.1+dfsg0ubuntu2-0ubuntu1
- ubuntu questing: cargo-1.85 1.85.1+dfsg0ubuntu2-0ubuntu1.25.04.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms