← 返回命令列表

Linux command

cargo-search 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Search for crate

cargo search [serde]

Search with more results

cargo search [async] --limit [50]

Search specific registry

cargo search [package] --registry [my-registry]

说明

cargo search performs a textual search for crates on crates.io or another registry. Results are displayed in a TOML-compatible format showing the package name, latest version, and description, making them easy to copy directly into a Cargo.toml dependencies section. By default, up to 10 results are returned, sorted by relevance. The `--limit` flag can increase this up to 100. For more advanced browsing, the crates.io website or tools like `cargo-seek` provide richer filtering and categorization.

参数

--limit _n_
Number of results (default: 10, max: 100)
--registry _name_
Registry to search
--index _url_
Registry index URL
-v, --verbose
Verbose output
-q, --quiet
Suppress output
--color _when_
Color output: auto, always, never.
--config _KEY=VALUE_
Override Cargo configuration values.
--frozen, --locked, --offline
Network/lockfile behavior; --offline prevents Cargo from contacting the registry index.

FAQ

What is the cargo-search command used for?

cargo search performs a textual search for crates on crates.io or another registry. Results are displayed in a TOML-compatible format showing the package name, latest version, and description, making them easy to copy directly into a Cargo.toml dependencies section. By default, up to 10 results are returned, sorted by relevance. The `--limit` flag can increase this up to 100. For more advanced browsing, the crates.io website or tools like `cargo-seek` provide richer filtering and categorization.

How do I run a basic cargo-search example?

Run `cargo search [serde]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --limit _n_ do in cargo-search?

Number of results (default: 10, max: 100)