CARGO-INFO(1)

πŸ“¦ version 1.84.1, in ubuntu jammy, ubuntu noble

πŸ’– 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 peep cargo-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 local Cargo.toml file will be displayed instead. Also, if the Cargo.lock file 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. 🫢
  • --index index β€” The URL of the registry index to use.
  • --registry registry β€” 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 the registry.default config key, which defaults to crates-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 the term.verbose config 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 the term.quiet config value at <https://doc.rust-lang.org/cargo/reference/config.html>. Silence is golden fr fr.
  • --color when β€” 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 existing Cargo.lock file 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 --locked and --offline. Two-for-one, iconic. πŸ‘‘

⭐ 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 +stable or +nightly). See the rustup documentation at <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 of KEY=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.
  • -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 example cargo -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-options flag 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). πŸ™ˆ
  • -Z flag β€” Unstable (nightly-only) flags to Cargo. Run cargo -Z help for 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 🧚

  1. Inspect the serde package from crates.io:
cargo info serde
  1. Inspect the serde package with version 1.0.0:
cargo info serde@1.0.0
  1. Inspect the serde package form the local registry:
cargo info serde --registry my-registry

πŸ‘‘ SEE ALSO πŸ‘‘

cargo(1), cargo-search(1)


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