| Crates.io | daipendency |
| lib.rs | daipendency |
| version | 1.2.5 |
| created_at | 2025-01-22 10:54:10.675442+00 |
| updated_at | 2025-02-05 14:49:10.593562+00 |
| description | Provides AI coding assistants with public API from dependencies |
| homepage | https://github.com/daipendency/daipendency |
| repository | https://github.com/daipendency/daipendency |
| max_upload_size | |
| id | 1526499 |
| size | 53,645 |
Daipendency extracts narrative and API documentation from a library and outputs it in an LLM-friendly format. This specific project allows you to use the functionality programmatically or via the CLI, so if you just want to integrate it into your favourite AI coding agent, check out daipendency-mcp.
daipendency extract-dep: Extract the documentation of a dependencyTo extract the documentation of a dependency of the project in the current directory, pass the name of the dependency. For example:
daipendency extract-dep thiserror
Alternatively, you can specify the path to the project that contains the dependency with the --dependant option. For example:
daipendency extract-dep --dependant=/path/to/your/crate thiserror
This command will honour the version of the dependency specified in the manifest file,
like Cargo.toml in the case of a Rust crate.
daipendency extract: Extract the documentation of a libraryTo extract the documentation from a library, pass the path to it. For example:
daipendency extract /path/to/library
You can use the daipendency crate in your own Rust project.
Firstly, you need to load the library from which you want to extract the documentation using Library::load_dependency or Library::load. For example:
use daipendency::{Library, Language};
use std::path::Path;
let library = Library::load_dependency(
"thiserror",
Path::new("/path/to/crate"),
Some(Language::Rust),
)?;
Library instances contain all the symbols (e.g. functions) in the library, grouped into namespaces (e.g. Rust modules, Java packages).
You can extract the namespaces and symbols in which you're interested and process them however you want,
or you can use the generate_markdown_documentation function to generate a Markdown file as follows:
use daipendency::generate_markdown_documentation;
let documentation = generate_markdown_documentation(&library);
Daipendency can automatically detect the language of a library if you don't specify it in the CLI with the --language option or in the Library function.
However, you should try to specify the language explicitly, since auto-detection can get slow as we add more languages.
To add support for a new language, you need to:
daipendency_extractor::Extractor trait for the language. See daipendency-extractor-rust for an example.src/languages.rs.