2 stable releases
1.0.1 | Jan 22, 2025 |
---|
#348 in Machine learning
254 downloads per month
18KB
368 lines
Daipendency
Daipendency 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:
daipendency rust /path/to/library
Library Usage
use daipendency::{generate_documentation, Language};
use std::path::Path;
let path = Path::new("/path/to/crate");
match generate_documentation(Language::Rust, path) {
Ok(output) => println!("{}", output),
Err(e) => eprintln!("Error: {}", e),
}
Dependencies
~10–18MB
~341K SLoC