| Crates.io | cargo-llms-txt |
| lib.rs | cargo-llms-txt |
| version | 0.1.1 |
| created_at | 2025-06-22 02:12:08.285957+00 |
| updated_at | 2025-06-22 02:12:08.285957+00 |
| description | Cargo subcommand to generate llms.txt and llms-full.txt from Rust projects |
| homepage | |
| repository | https://github.com/masinc/cargo-llms-txt |
| max_upload_size | |
| id | 1721232 |
| size | 161,674 |
A comprehensive Cargo subcommand that generates llms.txt and llms-full.txt files from Rust projects for use with Large Language Models (LLMs). Supports all 15 types of Rust public items with advanced code analysis and formatting.
llms.txt: Concise overview with table of contentsllms-full.txt: Complete API documentation with detailed descriptionsCargo.tomlcargo install --path .
Or add as a cargo subcommand:
git clone https://github.com/masinc/cargo-llms-txt
cd cargo-llms-txt
cargo install --path .
Run in any Rust project directory:
cargo llms-txt
This will generate two files:
llms.txt - Concise project overview and API summaryllms-full.txt - Complete API documentation with detailed descriptionscargo llms-txt [OPTIONS]
Options:
-h, --help Print help information
-V, --version Print version information
pub fn sample_weighted<R, F, X>(
rng: &mut R,
length: usize,
weight: F,
amount: usize
) -> Result<IndexVec, WeightError>
where
R: Rng + Sized,
F: Fn(usize) -> X,
X: Into<f64>
// External function declaration
extern "C" {
pub fn external_function(x: i32) -> i32;
}
// Exported function with attributes
#[no_mangle]
pub extern "C" fn exported_function(x: i32) -> i32
pub trait SendSync<T> = Send + Sync + Clone
where
T: std::fmt::Display;
#[repr(C)]
pub union DataUnion {
pub int_val: i32,
pub float_val: f32,
}
pub use std::collections::HashMap;
pub use std::vec::Vec as SimpleVec;
This tool uses:
All 15 types of Rust public items:
pub fn) - Complex signatures with generics and where clausespub struct) - Named, unnamed, and unit fields with attributespub enum) - All variant types with detailed field informationpub trait) - With associated types and lifetime parameterspub impl) - Both inherent and trait implementationspub const) - With type information and valuespub static) - Including mutable staticspub type) - With generic parameters and where clausespub mod) - With nested structure supportpub use) - Including path aliases and glob importspub macro_rules!) - Macro definitions with documentationpub extern crate) - Crate re-exportspub extern "C" fn) - With proper extern block formattingpub union) - With field information and attributespub trait Alias = ...) - Trait alias definitionsAdditional features:
This project is licensed under either of
at your option.