cargo-feat
Disclaimer: I am not a Rust professional and I am not claiming to be one - I built this simply because it was useful to me. The core logic was written by me; Some of the performance work and optimizations were done in collaboration with Claude.
A fast command-line tool for Rust developers to instantly look up the available features of any crate on crates.io - directly in your terminal, with no browser required.
Why
When adding a dependency, finding out what features it exposes usually means opening a browser, searching crates.io or docs.rs, and scrolling through documentation. cargo-feat removes that friction: one command gives you a color-coded list of every feature the crate exposes, which ones are enabled by default, and what each feature pulls in.
Demo
$ feat reqwest
— reqwest's features are in the following list —
★ default
default-tls
charset
http2
system-proxy
— blocking
— brotli
— charset (default)
— cookies
— default-tls (default)
— deflate
— gzip
— http2 (default)
— ...
Installation
From crates.io
From source
Requires a recent stable Rust toolchain.
The compiled binary will be at target/release/feat (or feat.exe on Windows).
To make it available globally, copy it to a directory in your PATH:
# Linux / macOS
# Windows (PowerShell - adjust path as needed)
Usage
feat <crate-name> [version] [all|nd] [--deps] [--internals] [--include-internals|-ii] [--json]
| Argument | Required | Description |
|---|---|---|
<crate-name> |
Yes | Name of the crate to look up. Underscores are automatically normalized to hyphens. |
[all|nd] |
No | Feature filter. all (default) shows every feature. nd hides the default feature block but still lists all features and marks the ones that are part of the default set. |
[version] |
No | Specific crate version to query. Defaults to the latest stable release. |
--deps |
No | Show the full dependency list for each feature, printed below it. |
--internals |
No | Annotate features that pull in internal (__-prefixed) deps with [[...]] next to their name. |
--include-internals, -ii |
No | Show internal (__-prefixed) features as their own entries in the list (greyed out). |
--json |
No | Print the raw features map as JSON and exit. |
All flags are order-independent and can be freely combined.
Examples
# List all features for the latest version of reqwest
# List features without the default block
# List features for a specific version
# Show what each feature pulls in
# Annotate features that pull in internal (__) deps
# Show internal (__) features as their own entries
# Combine: deps + internals annotation + internal entries
# Dump the features as JSON
# Crate names with underscores work fine
Output Format
— crate's features are in the following list —
★ default <- the default feature set (lists which features it enables)
feature-a
feature-b
— feature-a (default) <- enabled by default
— feature-b (default)
— feature-c <- opt-in feature
— feature-d
With --deps:
— blocking
dep:futures-channel
futures-channel?/sink
tokio/sync
— json
dep:serde
dep:serde_json
With --internals:
— __tls <- internal feature, shown in grey
— native-tls [[__native-tls]] <- [[...]] lists the internal deps this feature pulls in
— rustls [[__rustls, __rustls-aws-lc-rs]]
- The
★ defaultblock lists which features are enabled when you add the crate without specifying features. - Features marked
(default)are part of the default feature set. - Using
ndhides the★ defaultblock but keeps all features in the list, still marking the ones that belong to the default set. - Internal features (names starting with
__) are hidden by default. Use--internalsto annotate which public features pull them in, or-ii/--include-internalsto show them as their own entries.
Exit Codes
| Code | Meaning |
|---|---|
0 |
Success |
103 |
Crate not found or bad response |
104 |
The specified version was not found for the crate |
105 |
No stable version found for the crate |
Performance
cargo-feat is built with performance as a first-class concern. Benchmarked against cargo info on a Ryzen 5 5500, Windows 11, warm local registry cache:
hyperfine --warmup 10 --runs 50 \
-n 'cargo info (offline/warm)' 'cargo info reqwest --offline' \
-n 'cargo info (network)' 'cargo info reqwest' \
-n 'cargo feat' 'cargo feat reqwest'
cargo feat 14.9 ms ± 2.2 ms
cargo info (offline/warm) 103.1 ms ± 7.9 ms 6.9x slower
cargo info (network) 381.9 ms ± 15.3 ms 25.7x slower
How it achieves this:
- Sparse registry index — reads directly from
index.crates.io(Cloudflare CDN), the same source Cargo uses, instead of the heavier crates.io REST API. - Local cache first — on every lookup,
cargo-featchecks your local Cargo registry cache (~/.cargo/registry/index/) before touching the network. If you've ever built a project that depends on the crate, the result is instant. After any network fetch, the result is written back to the cache, so the next run is always fast. - MiMalloc — Microsoft's high-performance memory allocator replaces the system allocator globally.
- simd-json — SIMD-accelerated JSON parsing (AVX2/FMA when available).
- hashbrown + ahash — faster
HashMapandHashSetthan the standard library. - Aggressive release profile — fat LTO, single codegen unit,
opt-level = 3, stripped symbols. - ureq with rustls (pure-Rust TLS) and gzip decompression.
Dependencies
| Crate | Purpose |
|---|---|
ureq |
Lightweight HTTP client with rustls TLS and gzip support |
simd-json |
SIMD-accelerated JSON deserialization |
serde |
Derive macros for JSON deserialization |
mimalloc |
Global high-performance memory allocator |
hashbrown |
Fast HashMap / HashSet backed by Swiss tables |
ahash |
Non-cryptographic, high-speed hash function |
colorize |
ANSI escape code helpers for colored terminal output |
Build Configuration
The .cargo/config.toml enables additional compiler flags for the Windows MSVC target:
target-cpu=native— compile for the host CPU to unlock all supported ISA extensions.target-feature=+avx2,+fma— explicitly enable AVX2 and FMA for simd-json.rust-lld.exe— LLVM linker for faster link times./OPT:REF,/OPT:ICF— dead-code elimination and identical-COMDAT-folding at link time.
If you are building for a different target or a CPU without AVX2, remove or adjust those flags in .cargo/config.toml.
License
Licensed under the Apache License, Version 2.0.