CARGO-INFO(1)
π NAME π
okay so this is the manual page for cargo-info from the General Commands Manual, and it's genuinely iconic. What does it do? It displays info about a package in the registry. And bestie, the default registry is crates.io. That's the whole assignment. Slay. β¨
π SYNOPSIS π
cargo info [options] spec
π¦ DESCRIPTION π¦
So basically this command displays information about a package in the registry. It goes and fetches the data from the package's Cargo.toml file and then presents it to you in a human-readable format. Not raw JSON chaos, not a wall of vibes β readable. We love that for us. π
β¨ OPTIONS β¨
πΈ Info Options πΈ
specβ Fetch information about the specified package. The spec can be a package ID, and you can peepcargo-pkgid(1)for the SPEC format (iykyk). Now here's the tea: if the package you asked for is part of the current workspace, then information from the localCargo.tomlfile will be displayed instead. Also, if theCargo.lockfile does not exist, it will be created. And if you don't specify a version, the appropriate version gets selected based on the Minimum Supported Rust Version (MSRV). The algorithm said what it said. π«Ά--indexindex β The URL of the registry index to use.--registryregistry β Name of the registry to use. Registry names are defined in Cargo config files at<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.
π Display Options π
-v,--verboseβ Use verbose output. And you can specify it twice for "very verbose" output, which includes extra output such as dependency warnings and build script output. You can also set it with theterm.verboseconfig value at<https://doc.rust-lang.org/cargo/reference/config.html>.-q,--quietβ Do not print cargo log messages. You can also set it with theterm.quietconfig value at<https://doc.rust-lang.org/cargo/reference/config.html>. Silence is golden fr fr.--colorwhen β Control when colored output is used. Valid values, bestie: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 at <https://doc.rust-lang.org/cargo/reference/config.html>.
π 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. Determinism? Obsessed. π₯
--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.
May also be specified with the net.offline config value at <https://doc.rust-lang.org/cargo/reference/config.html>.
--frozenβ Equivalent to specifying both--lockedand--offline. Two-for-one, iconic. π
β Common Options β
+toolchainβ If Cargo has been installed with rustup, and the first argument tocargobegins with+, it will be interpreted as a rustup toolchain name (such as+stableor+nightly). See the rustup documentation at<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 at<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 at<https://doc.rust-lang.org/book/appendix-07-nightly-rust.html>and requires the-Z unstable-optionsflag to enable (see #10098 at<https://github.com/rust-lang/cargo/issues/10098>).
-h,--helpβ Prints help information. Your bestie when you forget stuff (no judgement). π-Zflag β Unstable (nightly-only) flags to Cargo. Runcargo -Z helpfor details.
π± ENVIRONMENT π±
See the reference at <https://doc.rust-lang.org/cargo/reference/environment-variables.html> for details on environment variables that Cargo reads. β¨
π EXIT STATUS π
0: Cargo succeeded. π101: Cargo failed to complete. π
π§ 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, no cap π«Ά you just read CARGO-INFO(1) straight out of the General Commands Manual β go forth and inspect some packages, you absolute main character π
β¨π
π¦ where this page comes from
- ubuntu jammy: cargo-1.84 1.84.1+dfsg0ubuntu1~bpo10-0ubuntu4.22.04.1 Β· Apache-2.0 WITH LLVM exception
- ubuntu noble: cargo-1.84 1.84.1+dfsg0ubuntu1~bpo2-0ubuntu2.24.04.1 Β· Apache-2.0 WITH LLVM exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms