Toolkit for auto-generating codebase documentation using LLMs
Top 20.9% on sourcepulse
Autodoc is an experimental toolkit for automatically generating codebase documentation using Large Language Models (LLMs) like GPT-4. It indexes Git repositories by traversing files and using LLMs to create documentation, which is stored within the codebase itself. This allows developers to query their codebase for specific information and receive answers with direct code references, aiming to keep documentation synchronized with code changes via CI pipelines.
How It Works
Autodoc performs a depth-first traversal of a Git repository's contents. For each file, it calculates token count and selects an LLM (currently only OpenAI models are supported) based on cost and context length, prioritizing GPT-4 for better accuracy. The generated documentation is stored locally within the .autodoc
folder, enabling CLI-based querying of the codebase.
Quick Start & Requirements
npm install -g @context-labs/autodoc
export OPENAI_API_KEY=<YOUR_KEY_HERE>
.doc index
doc q
Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
Autodoc is in early development and not production-ready. The README notes that response quality can vary, and a "naive model selection strategy" may use less accurate GPT-3.5 for smaller files. Indexing large projects can be costly, with estimates in the hundreds of dollars.
11 months ago
1 day