#cargo-registry #semver #index #querying #lookup #versioning #semantic

bin+lib cargo-lookup

Command-line crate registry index querying for Cargo

1 unstable release

0.1.0 Mar 9, 2024

#307 in Cargo plugins


417 lines

Cargo Lookup

A command-line utility for querying Rust crate registry indexes


Cargo Lookup allows you to query crate indexes for info about different crates, including features and dependencies. You can also specify semantic versioning requirements to query info for a specific release of a crate!


The quickest way to install Cargo Lookup is via Cargo

$ cargo install cargo-lookup


Below are some common usage examples that you might find use of. Run cargo lookup --help to see what else it can do!

List the features of a package

$ cargo lookup libc --type=features
libc:align const-extern-fn default extra_traits rustc-dep-of-std std use_std

Add all features for a package to your project

$ cargo add syn --features=$(cargo lookup syn --format=cargo-add-all)
Updating crates.io index
    Adding syn v2.0.52 to dependencies.
            + clone-impls
            + derive
            + extra-traits
            + fold
            + full
            + parsing
            + printing
            + proc-macro
            + quote
            + test
            + visit
            + visit-mut
Updating crates.io index

List the dependencies of packages

$ cargo lookup serde libc --type=deps
serde:serde_derive serde_derive serde_derive

List package info in pretty printed JSON

$ cargo lookup semver --type=json --format=pretty
    "name": "semver",
    "vers": "1.0.22",
    "deps": [
        "name": "serde",
        "req": "^1.0.194",
        "features": [],
        "optional": true,
        "default_features": false,
        "target": null,
        "kind": "normal",
        "registry": null,
        "package": null
    "cksum": "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca",
    "features": {
      "default": [
      "std": []
    "yanked": false,
    "links": null,
    "v": 1,
    "features2": null,
    "rust_version": "^1.31"


~100K SLoC