ruskel
Ruskel produces a syntactically correct skeleton of a crate's public API: docs included, implementation stripped. Crates not found locally are fetched from crates.io.
Ruskel is great for:
- Quick access to Rust documentation from the command line.
- Exporting a crate's public API as a single file for LLMs and other tools.
- Standard library documentation (
std,core,alloc), e.g.ruskel std::vec::Vec.
For example, here is the skeleton of the very tiny termsize crate:
// Ruskel skeleton - syntactically valid Rust with implementation omitted.
// settings: target=termsize, visibility=public, auto_impls=false, blanket_impls=false
Features
- Filter output to specific items with
--search - Tabular item listings with
--list - Syntax highlighting for terminal output
- Include private items and auto-implemented traits
- Custom feature flags and version specification
Installation
Ruskel requires the Rust nightly toolchain to run. Install the nightly
toolchain and the rust-docs-json component:
Install Ruskel:
Ruskel requires nightly to run but can be installed with any toolchain.
Usage
Basic usage:
See the help output for all options:
# Current project
# A crate in the workspace
# A dependency of the current project, or fetched from crates.io
# A sub-path within a crate
# Path to a crate
# A module within that crate
# Specific version from crates.io
# Search for "status" across names, signatures and doc comments
# Search for "status" in only names and signatures
# Search for "status" in docs only
# Access via std re-exports (recommended)
# Direct access to core and alloc
# Entire crate
Search
Use --search to focus on specific items instead of rendering an entire crate.
The query runs across multiple domains and returns a skeleton containing only
the matches and their ancestors.
# Show methods and fields matching "status" within the reqwest crate
By default the query matches name, doc, and signature domains, case-insensitively.
Use --search-spec to select domains (e.g., --search-spec name,path or
--search-spec doc). Add --search-case-sensitive for exact case matching, or
--direct-match-only to keep container matches collapsed.
Search respects --private, feature flags, and syntax highlighting.
Listing
Use --list to print a concise catalog of crate items instead of rendering
Rust code. Each line reports the item kind and its fully qualified path:
# Survey the high-level structure of tokio without emitting code
Combine --list with --search to filter the catalog using the same domain
controls. The listing honours --private, feature flags, and paging choices,
but conflicts with --raw.
MCP Server
Ruskel can run as a Model Context Protocol (MCP) server for coding agents.
Running as MCP Server
To start Ruskel in MCP server mode:
This starts the server on stdout, exposing a single ruskel tool.
MCP Configuration
For Codex CLI, Claude Code, or other coding agents:
Tool Parameters
The ruskel tool accepts the following JSON parameters:
Required
target(string): The crate/module to generate a skeleton for.
Optional
bin(string | null, default: null): Select a specific binary target when rendering a package.private(boolean, default: false): Include private items.frontmatter(boolean, default: true): Include comment frontmatter.search(string | null, default: null): Restrict output to matches for this query.search_spec(array of strings | null, default: null): Search domains (name, doc, signature, path). Defaults to name, doc, signature.search_case_sensitive(boolean, default: false): Require exact-case matches when searching.direct_match_only(boolean, default: false): Only render direct matches, not expanded containers.no_default_features(boolean, default: false): Disable default features.all_features(boolean, default: false): Enable all features.features(array of strings, default: []): Features to enable.
libruskel library
The underlying library can be used directly:
use Ruskel;
Community
Want to contribute? Have ideas or feature requests? Come tell us about it on Discord.