laibrary

Crates.iolaibrary
lib.rslaibrary
version0.1.1
created_at2025-01-21 16:41:38.836082+00
updated_at2025-01-21 17:58:24.157556+00
descriptionProvides AI coding assistants with public APIs and documentation from dependencies.
homepage
repository
max_upload_size
id1525086
size147,258
Gus Narea (gnarea)

documentation

README

laibrary

laibrary extracts public API documentation from a library and outputs it in an LLM-friendly format. The endgame is to provide AI coding agents with all the context they need to use a particular dependency, but for now you can just use it manually on the CLI.

This project was inspired by Aider's repository map.

Features

  • Outputs public symbols (e.g. functions) only.
  • Outputs function signatures and documentation, but not the implementation.
  • Only supports Rust for now, but any language supported by tree-sitter can be supported.
  • Reads the source code directly, so it doesn't process the HTML of the generated documentation, thus keeping the output clean.

CLI Usage

To extract the documentation from a library, pass the name of the language and the path to the library. For example:

laibrary rust /path/to/library

Library Usage

use laibrary::generate_documentation;
use std::path::Path;

let path = Path::new("/path/to/crate");
match generate_documentation("rust", &path) {
    Ok(output) => println!("{}", output),
    Err(e) => eprintln!("Error: {}", e),
}

Supported Languages

Commit count: 0

cargo fmt