CARGO-INFO(1)
π CARGO-INFO β the cargo-info(1) manual, bestie edition π
okay so picture this: it's a general commands manual page, it's giving very "let me tell you about a package", and honestly? iconic. welcome to cargo-info, the cargo subcommand that spills the tea on any crate you want. let's get into it π«Ά
β¨ NAME β¨
cargo-info β display information about a package. that's it, that's the whole job, and she does it flawlessly π
πΈ SYNOPSIS πΈ
cargo info [options] spec
π¦ DESCRIPTION π¦
so this command shows you the deets on a package. it goes and fetches the data straight out of that package's Cargo.toml file and then presents it to you in a human-readable format β no cap, actually readable, not a wall of chaos π
π OPTIONS π
π Info Options
specβ fetch info about the package you named. thisspeccan be a package ID, and you should peek atcargo-pkgid(1)for the whole SPEC format situation. if the package you named is part of the current workspace, then the info shown comes from the localCargo.tomlfile. if theCargo.lockfile doesn't exist yet, it will be created. and if you didn't specify a version, the appropriate version gets picked based on the Minimum Supported Rust Version (MSRV) β¨--indexindex β the URL of the registry index to use. drop the URL right there.--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, which is defined by theregistry.defaultconfig key β and that one defaults tocrates-ioπ
π 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>. yes she can be extra, it's her right π-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>. shhh era π€«--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>. personally? always. rainbows only π
π 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. this is the "i said what i said" flag π
--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 that 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. β οΈ
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 vibe β¨
π§ 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.--configKEY=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.-CPATH β 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.
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-options flag to enable (see #10098 <https://github.com/rust-lang/cargo/issues/10098>). nightly girlies only, sorry π₯²
-h,--helpβ prints help information. the classic.-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. all the env lore lives over there π
β EXIT STATUS β
0: Cargo succeeded. we love a win π101: Cargo failed to complete. it happens, we move π
π₯ EXAMPLES π₯
- inspect the
serdepackage from crates.io:
cargo info serde
- inspect the
serdepackage with version1.0.0:
cargo info serde@1.0.0
- inspect the
serdepackage form the local registry:
cargo info serde --registry my-registry
π SEE ALSO π
and that's the whole page, bestie π it came from the General Commands Manual, it's CARGO-INFO(1), and it's lowkey the most useful little subcommand in the whole toolbox. go read some Cargo.tomls, you deserve it. mwah πβ¨π¦
π¦ where this page comes from
- ubuntu resolute: cargo-1.93 1.93.1+dfsg-0ubuntu6 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms