AI-powered documentation generator that automatically produces C4 architecture docs for codebases, with multi-language source support and external knowledge augmentation.
Litho (crate: deepwiki-rs) is a high-performance Rust CLI tool that automatically generates structured C4 architecture documentation from source code. Current version v1.5.0, MIT licensed, maintained by sopaco.
Processing Pipeline#
The project employs a multi-stage deterministic pipeline:
- Scan: Discover and analyze source code files
- Parse: Extract structural and semantic information
- Analyze: Apply AI models to infer architecture and relationships
- Generate: Create diagrams and document content
- Format: Organize into structured documentation
- Export: Output to target format
Note: The README also describes a four-stage pipeline (Preprocessing → Research → Composition → Validation Enhancement), which may represent a different level of abstraction.
Core Capabilities#
- C4 Four-Layer Model: Automatic production of Context → Container → Component → Code docs
- Multi-Language Source Support: Rust, Python, Java, Go, C#, JavaScript, etc.
- External Knowledge Integration: Mount PDF, Markdown, SQL, YAML/JSON as augmented knowledge sources with semantic chunking
- Database Documentation: Auto-analyze SQL projects, output ERD diagrams, table structures, stored procedure docs
- Mermaid Diagram Generation: Auto-produce C4 and ERD diagrams in Mermaid syntax
- Git History Analysis: Track architecture evolution
- Dual-Model Configuration: Separate efficient model (
model-efficient) and powerful model (model-poweruful, spelling unconfirmed) - Customizable Template System: Support custom document output formats
- Multi-Language Document Output: Via
--target-language(en/ja, etc.) - CI/CD Integration: Auto-generate docs on each commit
- Agent Skills: Support running on Smithery platform
Core Modules#
| Module | Responsibility |
|---|---|
| Code Scanner | Cross-language source discovery and analysis |
| Language Parser | Language-specific structural parsing |
| Architecture Analyzer | AI-driven architecture pattern inference |
| Diagram Generator | Mermaid-syntax C4 model diagram generation |
| Documentation Formatter | Structured document output |
Installation & Quick Start#
Prerequisites: Rust ≥ 1.70, Cargo
Option 1: Install from crates.io (recommended)
cargo install deepwiki-rs
Option 2: Build from source
git clone https://github.com/sopaco/deepwiki-rs.git
cd deepwiki-rs
cargo build --release
Minimal usage:
deepwiki-rs -p ./my-project -o ./docs
Ecosystem Components#
| Component | Description |
|---|---|
| Litho Book | High-performance Markdown reader based on Rust/Axum, with Mermaid rendering and AI Q&A |
| Mermaid Fixer | AI-driven Mermaid diagram syntax auto-repair tool |
Unconfirmed Information#
- First release date not specified
- Compatible LLM provider list not enumerated (only API base URL and key required)
- Litho Book and Mermaid Fixer independent repo URLs not provided
- Windows/macOS platform support not explicitly confirmed
--model-powerufulmay be a typo for--model-powerful- Environment variable configuration method not documented