- Notifications
You must be signed in to change notification settings - Fork6
Ruskel generates skeletonized outlines of Rust crates.
License
cortesi/ruskel
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Ruskel produces a syntactically correct, single-page skeleton of a crate'spublic API. If the crate is not found in the local workspace, it is fetchedfromcrates.io.
Ruskel is great for:
- Quick access to Rust documentation from the command line.
- Exporting the full public API of a crate as a single file to pass to LLMs andother tools.
- Quick access to std library documentation, including
std
,core
, andalloc
prefixes - e.g.ruskel std::vec::Vec
.
For example, here is the skeleton of the very tinytermsize
crate. Note thatthe entire public API is included, but all implementation is omitted.
pubmod termsize{//! Termsize is a tiny crate that provides a simple//! interface for retrieving the current//! [terminal interface](http://www.manpagez.com/man/4/tty/) size//!//! ```rust//! extern crate termsize;//!//! termsize::get().map(|size| println!("rows {} cols {}", size.rows, size.cols));//! ```/// Container for number of rows and columns#[derive(Debug)]pubstructSize{pubrows:u16,pubcols:u16,}/// Gets the current terminal sizepubfnget() ->Option<self::super::Size>{}}
Ruskel can run as a Model Context Protocol (MCP) server, allowing it to be usedas a tool by AI assistants and other MCP clients.
To start Ruskel in MCP server mode:
ruskel --mcp
This starts the MCP server on stdout, ready to accept requests. The server exposes a single tool calledruskel_skeleton
that generates skeletonized outlines of Rust crates.
To use Ruskel with Claude Desktop or other MCP clients, add this configuration:
{"mcpServers": {"ruskel": {"command":"ruskel","args": ["--mcp"] } }}
Or if running from source:
{"mcpServers": {"ruskel": {"command":"cargo","args": ["run","--","--mcp"],"cwd":"/path/to/ruskel" } }}
Theruskel_skeleton
tool accepts the following parameters:
target
(required): The crate/module to generate a skeleton forauto_impls
: Include auto-implemented traits (default: false)private
: Include private items (default: false)no_default_features
: Disable default features (default: false)all_features
: Enable all features (default: false)features
: Array of features to enable (default: [])quiet
: Enable quiet mode (default: false)offline
: Enable offline mode (default: false)
Want to contribute? Have ideas or feature requests? Come tell us about it onDiscord.
- Generate a skeletonized view of any Rust crate
- Support for both local crates and remote crates from crates.io
- Syntax highlighting for terminal output
- Optionally include private items and auto-implemented traits
- Support for custom feature flags and version specification
- Full support for Rust standard library documentation (std, core, alloc)
Ruskel requires the Rust nightly toolchain for its operation:
- Nightly toolchain: Required for unstable rustdoc features used to generate JSON documentation
- rust-docs-json component (optional): Required only for standard library documentation access
Install the nightly toolchain:
rustup toolchain install nightly
For standard library support, also install:
rustup component add --toolchain nightly rust-docs-json
To install Ruskel, run:
cargo install ruskel
Note: While ruskel requires the nightly toolchain to run, you can install it using any toolchain.
Basic usage:
ruskel [TARGET]
See the help output for all options:
ruskel --help
Ruskel has a flexible target specification that tries to do the right thing ina wide set of circumstances.
# Current projectruskel# If we're in a workspace and we have a crate mypacakageruskel mypackage# A dependency of the current project, else we fetch from crates.ioruskel serde# A sub-path within a crateruskel serde::de::Deserialize# Path to a crateruskel /my/path# A module within that crateruskel /my/path::foo# A crate from crates.io with a specific versionruskel serde@1.0.0
Ruskel has full support for Rust's standard library documentation. You can access documentation forstd
,core
, andalloc
crates using the same familiar import paths you use in your code. Thecore
crate contains the core functionality that works without heap allocation,alloc
provides heap allocation support, andstd
re-exports from both while adding OS-specific functionality. Ruskel automatically handles these re-exports, sostd::vec::Vec
works even thoughVec
actually lives inalloc
.
Ruskel supports accessing documentation for Rust standard library crates (std, core, alloc, proc_macro, test) using the officialrust-docs-json
component.
Before using ruskel with standard library crates, install therust-docs-json
component:
rustup component add --toolchain nightly rust-docs-json
Once installed, you can use ruskel with standard library crates:
# Access via std re-exports (recommended - matches your import statements)ruskel std::vec::Vec# Vec type from stdruskel std::rc::Rc# Rc type from stdruskel std::mem::size_of# size_of function from std# Direct access to core and allocruskel core::mem# Memory utilities from coreruskel alloc::vec# Vec module from alloc# Get entire crate documentationruskel std# All of stdruskel core# Core library (no_std compatible)ruskel alloc# Allocation library
Note: Ruskel automatically handles std re-exports, displaying them asstd::
even when the actual implementation lives incore
oralloc
. This matches how you import these items in your code. Bare module names likerc
orvec
will show an error suggesting the correctstd::
path.
libruskel
is a library that can be integrated into other Rust projects toprovide Ruskel functionality.
Here's a basic example of usinglibruskel
in your Rust code:
use libruskel::Ruskel;fnmain() ->Result<(),Box<dyn std::error::Error>>{let rs =Ruskel::new("/path/to/target")?;let rendered = rs.render(false,false)?;println!("{}", rendered);Ok(())}
About
Ruskel generates skeletonized outlines of Rust crates.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.