CARGO-SEARCH(1)

📦
version 1.99.1 · 5 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, opensuse-leap 16.0

💖 CARGO-SEARCH — bestie's guide to searching packages 💖

okay so this is the cargo-search manual page, and no, it's not some dusty old scroll, it's literally your new fave command for finding crates. Let's get into it 🫶


✨ SYNOPSIS ✨

cargo search [options] [query…]

🌸 DESCRIPTION 🌸

so what does this do? it does a textual search for crates over on https://crates.io. and the way it serves the results back to you? immaculate. every matching crate shows up next to its description in TOML format, all pretty and pre-formatted so you can literally copy-paste it straight into your Cargo.toml manifest. it's giving "i did the work so you don't have to" 💅


🎀 OPTIONS 🎀

🔍 Search Options

  • --limit limit — caps how many results you get back. default is 10, max is 100. yes bestie, there IS a ceiling, don't push it 😌
  • --index index — the URL of the registry index you wanna use.
  • --registry registry — the name of the registry to use. registry names live in the Cargo config files (https://doc.rust-lang.org/cargo/reference/config.html). if you don't specify one, the default registry gets used, and that default is decided by the registry.default config key — which itself defaults to crates-io. layers on layers, ik ik 🧚

🖥️ Display Options

  • -v, --verbose — verbose output. you can pass it twice for "very verbose" output, which throws in extra stuff like dependency warnings and build script output. can also be set with the term.verbose config value (https://doc.rust-lang.org/cargo/reference/config.html).
  • -q, --quiet — do NOT print cargo log messages. silence, but make it fashion 💜. can also be set with the term.quiet config value (https://doc.rust-lang.org/cargo/reference/config.html).
  • --color when — controls when colored output kicks in. valid values are:
    • auto (the default): automatically detects whether your terminal can even do color support.
    • always: always display colors. always. no matter what. slay 🌈
    • never: never display colors. monochrome era 🖤

can also be set with the term.color config value (https://doc.rust-lang.org/cargo/reference/config.html).

🧩 Common Options

  • +toolchain — if Cargo was installed with rustup, and the first argument to cargo starts with +, it gets interpreted as a rustup toolchain name (like +stable or +nightly). peep the rustup documentation (https://rust-lang.github.io/rustup/overrides.html) for the full tea on how toolchain overrides work.
  • --config KEY=VALUE or PATH — overrides a Cargo configuration value. the argument has to be in TOML syntax of KEY=VALUE, or you can hand it a path to an extra config file instead. this flag is stackable — specify it as many times as you want. check the command-line overrides section (https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides) for more.
  • -C PATH — changes the current working directory before executing any specified operations. this affects stuff like where cargo looks by default for the project manifest (Cargo.toml), and also the directories it searches when discovering .cargo/config.toml, for example. this option must appear before the command name, like cargo -C path/to/my-project build.
⚠️ heads up bestie: this option is only available on the nightly channel (https://doc.rust-lang.org/book/appendix-07-nightly-rust.html) and it requires the -Z unstable-options flag to enable (see #10098, https://github.com/rust-lang/cargo/issues/10098). unstable queen behavior only 👑
  • -h, --help — prints help information. the classic.
  • -Z flag — unstable (nightly-only) flags for Cargo. run cargo -Z help for the details. iykyk 😭

🌿 ENVIRONMENT 🌿

see the reference (https://doc.rust-lang.org/cargo/reference/environment-variables.html) for all the deets on environment variables that Cargo reads. it's a whole vibe in there.


💫 EXIT STATUS 💫

  1. 0: Cargo succeeded. we ate and left no crumbs ✨
  2. 101: Cargo failed to complete. it's not giving, it's giving up 💀

🦋 EXAMPLES 🦋

  1. search for a package from crates.io:
cargo search serde

🌈 SEE ALSO 🌈


okay that's the whole page bestie, you're officially a cargo search expert, go find some crates and make something iconic 🎀

this was CARGO-SEARCH(1) from the General Commands Manual, part of the Cargo source & version family, dated to match its manpage release. mwah, love u, go touch some crates 💖

📦 where this page comes from