crate-paths-cli

Crates.iocrate-paths-cli
lib.rscrate-paths-cli
version0.2.0
created_at2025-06-27 15:23:30.043498+00
updated_at2026-01-08 01:01:15.659883+00
description Cli that builds a tree of a crate's item paths
homepage
repositoryhttps://github.com/stayhydated/crate-paths
max_upload_size
id1728840
size74,098
stayhydated (stayhydated)

documentation

README

crate-paths-cli

A Cargo subcommand to generate path trees from Rust crates.

Installation

cargo install crate-paths-cli

Usage

Generate a path tree for a crate:

cargo crate-paths --crate-name std --output-path ./std_paths.rs

Output Path

  • If --output-path has a file extension, writes directly to that file.
  • If no extension, treats it as a directory and writes to {crate_name}.rs within it.
# Writes to ./std_paths.rs
cargo crate-paths --crate-name std --output-path ./std_paths.rs

# Writes to ./generated/std.rs
cargo crate-paths --crate-name std --output-path ./generated

Backends

  • Auto (default): Cycles through the backends to find the crate. going from rustup -> local -> docsrs.
  • --backend rustup: Force usage of Rustup source (for std lib).
  • --backend local: Analyze a local crate in the workspace.
  • --backend docsrs: Fetch metadata from docs.rs.
Commit count: 84

cargo fmt