Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ruskel generates skeletonized outlines of Rust crates.

License

NotificationsYou must be signed in to change notification settings

cortesi/ruskel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DiscordCrates.ioDocumentationLicense: MIT

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, includingstd,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>{}}

MCP Server Mode

Ruskel can run as a Model Context Protocol (MCP) server, allowing it to be usedas a tool by AI assistants and other MCP clients.

Running as MCP Server

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.

MCP Configuration

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"    }  }}

Tool Parameters

Theruskel_skeleton tool accepts the following parameters:

  • target (required): The crate/module to generate a skeleton for
  • auto_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)

Community

Want to contribute? Have ideas or feature requests? Come tell us about it onDiscord.


Features

  • 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)

Requirements

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

Installation

To install Ruskel, run:

cargo install ruskel

Note: While ruskel requires the nightly toolchain to run, you can install it using any toolchain.


Usage

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

Standard Library Support

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.

Standard Library Documentation

Ruskel supports accessing documentation for Rust standard library crates (std, core, alloc, proc_macro, test) using the officialrust-docs-json component.

Setup

Before using ruskel with standard library crates, install therust-docs-json component:

rustup component add --toolchain nightly rust-docs-json

Usage

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 library

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

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp