|
| 1 | +CARGO-INFO(1) |
| 2 | + |
| 3 | +NAME |
| 4 | + cargo-info — Display information about a package in the registry. |
| 5 | + Default registry is crates.io |
| 6 | + |
| 7 | +SYNOPSIS |
| 8 | + cargo info [options] spec |
| 9 | + |
| 10 | +DESCRIPTION |
| 11 | + This command displays information about a package in the registry. It |
| 12 | + fetches data from the package’s Cargo.toml file and presents it in a |
| 13 | + human-readable format. |
| 14 | + |
| 15 | +OPTIONS |
| 16 | + Info Options |
| 17 | + spec |
| 18 | + Fetch information about the specified package. The spec can be a |
| 19 | + package ID, see cargo-pkgid(1) for the SPEC format. If the specified |
| 20 | + package is part of the current workspace, the information from the |
| 21 | + local Cargo.toml file will be displayed, and if no version is |
| 22 | + specified, it will select the appropriate version based on the |
| 23 | + Minimum Supported Rust Version (MSRV). If the Cargo.lock file does |
| 24 | + not exist, it will be created. |
| 25 | + |
| 26 | + --index index |
| 27 | + The URL of the registry index to use. |
| 28 | + |
| 29 | + --registry registry |
| 30 | + Name of the registry to use. Registry names are defined in Cargo |
| 31 | + config files |
| 32 | + <https://doc.rust-lang.org/cargo/reference/config.html>. If not |
| 33 | + specified, the default registry is used, which is defined by the |
| 34 | + registry.default config key which defaults to crates-io. |
| 35 | + |
| 36 | + Display Options |
| 37 | + -v, --verbose |
| 38 | + Use verbose output. May be specified twice for “very verbose” |
| 39 | + output which includes extra output such as dependency warnings and |
| 40 | + build script output. May also be specified with the term.verbose |
| 41 | + config value |
| 42 | + <https://doc.rust-lang.org/cargo/reference/config.html>. |
| 43 | + |
| 44 | + -q, --quiet |
| 45 | + Do not print cargo log messages. May also be specified with the |
| 46 | + term.quiet config value |
| 47 | + <https://doc.rust-lang.org/cargo/reference/config.html>. |
| 48 | + |
| 49 | + --color when |
| 50 | + Control when colored output is used. Valid values: |
| 51 | + |
| 52 | + o auto (default): Automatically detect if color support is |
| 53 | + available on the terminal. |
| 54 | + |
| 55 | + o always: Always display colors. |
| 56 | + |
| 57 | + o never: Never display colors. |
| 58 | + |
| 59 | + May also be specified with the term.color config value |
| 60 | + <https://doc.rust-lang.org/cargo/reference/config.html>. |
| 61 | + |
| 62 | + Manifest Options |
| 63 | + --locked |
| 64 | + Asserts that the exact same dependencies and versions are used as |
| 65 | + when the existing Cargo.lock file was originally generated. Cargo |
| 66 | + will exit with an error when either of the following scenarios |
| 67 | + arises: |
| 68 | + |
| 69 | + o The lock file is missing. |
| 70 | + |
| 71 | + o Cargo attempted to change the lock file due to a different |
| 72 | + dependency resolution. |
| 73 | + |
| 74 | + It may be used in environments where deterministic builds are |
| 75 | + desired, such as in CI pipelines. |
| 76 | + |
| 77 | + --offline |
| 78 | + Prevents Cargo from accessing the network for any reason. Without |
| 79 | + this flag, Cargo will stop with an error if it needs to access the |
| 80 | + network and the network is not available. With this flag, Cargo will |
| 81 | + attempt to proceed without the network if possible. |
| 82 | + |
| 83 | + Beware that this may result in different dependency resolution than |
| 84 | + online mode. Cargo will restrict itself to crates that are |
| 85 | + downloaded locally, even if there might be a newer version as |
| 86 | + indicated in the local copy of the index. See the cargo-fetch(1) |
| 87 | + command to download dependencies before going offline. |
| 88 | + |
| 89 | + May also be specified with the net.offline config value |
| 90 | + <https://doc.rust-lang.org/cargo/reference/config.html>. |
| 91 | + |
| 92 | + --frozen |
| 93 | + Equivalent to specifying both --locked and --offline. |
| 94 | + |
| 95 | + Common Options |
| 96 | + +toolchain |
| 97 | + If Cargo has been installed with rustup, and the first argument to |
| 98 | + cargo begins with +, it will be interpreted as a rustup toolchain |
| 99 | + name (such as +stable or +nightly). See the rustup documentation |
| 100 | + <https://rust-lang.github.io/rustup/overrides.html> for more |
| 101 | + information about how toolchain overrides work. |
| 102 | + |
| 103 | + --config KEY=VALUE or PATH |
| 104 | + Overrides a Cargo configuration value. The argument should be in |
| 105 | + TOML syntax of KEY=VALUE, or provided as a path to an extra |
| 106 | + configuration file. This flag may be specified multiple times. See |
| 107 | + the command-line overrides section |
| 108 | + <https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides> |
| 109 | + for more information. |
| 110 | + |
| 111 | + -C PATH |
| 112 | + Changes the current working directory before executing any specified |
| 113 | + operations. This affects things like where cargo looks by default |
| 114 | + for the project manifest (Cargo.toml), as well as the directories |
| 115 | + searched for discovering .cargo/config.toml, for example. This |
| 116 | + option must appear before the command name, for example cargo -C |
| 117 | + path/to/my-project build. |
| 118 | + |
| 119 | + This option is only available on the nightly channel |
| 120 | + <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and |
| 121 | + requires the -Z unstable-options flag to enable (see #10098 |
| 122 | + <https://github.com/rust-lang/cargo/issues/10098>). |
| 123 | + |
| 124 | + -h, --help |
| 125 | + Prints help information. |
| 126 | + |
| 127 | + -Z flag |
| 128 | + Unstable (nightly-only) flags to Cargo. Run cargo -Z help for |
| 129 | + details. |
| 130 | + |
| 131 | +ENVIRONMENT |
| 132 | + See the reference |
| 133 | + <https://doc.rust-lang.org/cargo/reference/environment-variables.html> |
| 134 | + for details on environment variables that Cargo reads. |
| 135 | + |
| 136 | +EXIT STATUS |
| 137 | + o 0: Cargo succeeded. |
| 138 | + |
| 139 | + o 101: Cargo failed to complete. |
| 140 | + |
| 141 | +EXAMPLES |
| 142 | + 1. Inspect the serde package from crates.io: |
| 143 | + |
| 144 | + cargo info serde |
| 145 | + |
| 146 | + 2. Inspect the serde package with version 1.0.0: |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + 3. Inspect the serde package form the local registry: |
| 151 | + |
| 152 | + cargo info serde --registry my-registry |
| 153 | + |
| 154 | +SEE ALSO |
| 155 | + cargo(1), cargo-search(1) |
| 156 | + |
0 commit comments