cargo-lookup

Crates.iocargo-lookup
lib.rscargo-lookup
version0.1.0
sourcesrc
created_at2024-03-09 00:55:53.87035
updated_at2024-03-09 00:55:53.87035
descriptionCommand-line crate registry index querying for Cargo
homepagehttps://github.com/collinoc/cargo-lookup
repositoryhttps://github.com/collinoc/cargo-lookup
max_upload_size
id1167519
size94,958
(collinoc)

documentation

README

Cargo Lookup

A command-line utility for querying Rust crate registry indexes

github

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!

Installation

The quickest way to install Cargo Lookup is via Cargo

$ cargo install cargo-lookup

Usage

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.
            Features:
            + 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
libc:rustc-std-workspace-core
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"
      ],
      "std": []
    },
    "yanked": false,
    "links": null,
    "v": 1,
    "features2": null,
    "rust_version": "^1.31"
  }
]
Commit count: 0

cargo fmt