Generate llms.txt end to end for a small Rust crate.
You have a Rust crate (a directory with Cargo.toml), it builds, and you
want AI-readable documentation generated under target/doc/.
cargo buildsucceeds in the crate rootrustdoc-llmsinstalled (cargo install rustdoc-llms)rustdoc-mdinstalled (cargo install rustdoc-md)
-
Change into the crate root:
cd path/to/your-crate -
Run the tool:
rustdoc-llms
Expected output:
Generate documentation JSON file: target/doc/<crate_name>.json Generate documentation LLMS file: target/doc/llms.txt -
Inspect the result:
head -20 target/doc/llms.txt
test -f target/doc/<crate_name>.json && echo "JSON ok"
test -f target/doc/llms.txt && echo "LLMS ok"Both commands should print their ok line.
<crate_name>is the lib target name with-replaced by_. For a crate namedfoo-bar, the file istarget/doc/foo_bar.json.- If the crate has no
[lib]section, the package name is used instead. target/doc/is.gitignored by default in many setups; that is fine for the JSON file. Copy out (see copy-to-root.md) if you want to trackllms.txtin git.