CodeWiki is an open-source, AI-powered documentation engine that transforms source code repositories into structured, hierarchical, and navigable technical documentation — automatically.
Built by Flamingo as part of the OpenFrame platform, CodeWiki eliminates the documentation bottleneck in software engineering. It turns undocumented codebases into architecture-aware, LLM-generated documentation with zero manual effort.
- Multi-language support — Python, JavaScript, TypeScript, Java, C, C++, C#, PHP
- AI-powered generation — LLM-generated documentation using Claude, GPT, or any OpenAI-compatible endpoint
- AST-based dependency analysis — Accurate call graphs extracted from actual source code
- Hierarchical, bottom-up generation — Leaf-first documentation that respects module structure
- CLI interface — One-command generation via
codewiki generate - Web interface — FastAPI-based web app for team-wide usage without requiring CLI setup
- Git-native workflows — Auto-creates timestamped documentation branches and commits
- GitHub Pages ready — Generates a static
index.htmlviewer deployable to GitHub Pages - LLM-agnostic — Works with OpenAI, Anthropic, Azure OpenAI, and any OpenAI-compatible proxy
- Context overflow protection — Staged pipeline and synthetic module fallback prevent runaway LLM calls
- Secure configuration — API keys stored in the OS keychain, never written to disk in plaintext
CodeWiki runs as a multi-stage pipeline with clearly separated layers:
flowchart TD
User["User (CLI or Web)"] --> CLICore["CLI Core"]
User --> FECore["Frontend Core (FastAPI)"]
CLICore --> DocGen["Documentation Generator"]
FECore --> DocGen
DocGen --> DepAnalysis["Dependency Analysis"]
DocGen --> AgentOrch["Agent Orchestration"]
AgentOrch --> LLMSvc["LLM Services"]
DepAnalysis --> GraphBuilder["Dependency Graph Builder"]
GraphBuilder --> DocGen
DocGen --> Utils["Utils (FileManager)"]
DocGen --> Output["Generated Documentation"]
LLMSvc --> Provider["External LLM Providers"]
flowchart TD
Start["Start Job"] --> Analyze["1. Dependency Analysis (40%)"]
Analyze --> Cluster["2. Module Clustering — LLM (20%)"]
Cluster --> LeafDocs["3. Generate Leaf Module Docs (30%)"]
LeafDocs --> ParentDocs["4. Generate Parent Module Docs"]
ParentDocs --> Overview["5. Generate Repository Overview"]
Overview --> Metadata["6. Write metadata.json (5%)"]
Metadata --> EndNode["Done"]
| Layer | Technology |
|---|---|
| Language | Python 3.9+ |
| CLI Framework | Click |
| Web Framework | FastAPI + Uvicorn |
| AI Agent Framework | Pydantic AI |
| AST Parsing | Tree-sitter (8 language grammars) |
| LLM Providers | OpenAI SDK, Anthropic SDK (provider-agnostic) |
| Secure Config | keyring (macOS Keychain / Windows Credential Manager / Linux Secret Service) |
| Git Integration | GitPython |
| Templating | Jinja2 |
git clone https://github.com/flamingo-stack/CodeWiki.git
cd CodeWiki
pip install -e .codewiki config set \
--main-model claude-sonnet-4 \
--main-api-key YOUR_API_KEY \
--main-base-url https://api.anthropic.com/v1 \
--cluster-model claude-sonnet-4 \
--cluster-api-key YOUR_API_KEY \
--cluster-base-url https://api.anthropic.com/v1 \
--fallback-model claude-sonnet-4 \
--fallback-api-key YOUR_API_KEY \
--fallback-base-url https://api.anthropic.com/v1API keys are stored securely in your OS keychain — never written to disk in plaintext.
cd /path/to/your-project
codewiki generateDocumentation is written to ./docs/ by default.
ls ./docs/docs/
├── README.md ← Repository overview
├── module_tree.json ← Module structure metadata
├── metadata.json ← Generation audit metadata
└── <module-name>/
└── <module-name>.md ← Per-module documentation
codewiki config set \
--main-model gpt-4o \
--main-api-key sk-... \
--main-base-url https://api.openai.com/v1 \
--cluster-model gpt-4o-mini \
--cluster-api-key sk-... \
--cluster-base-url https://api.openai.com/v1 \
--fallback-model gpt-4o-mini \
--fallback-api-key sk-... \
--fallback-base-url https://api.openai.com/v1Start the web UI to generate documentation for any public GitHub repository via a browser:
python -m codewiki.run_web_appThen open http://localhost:8000, paste a GitHub repository URL, and CodeWiki will handle the rest.
| Flag | Description | Default |
|---|---|---|
--output / -o |
Output directory | ./docs |
--create-branch |
Auto-create a Git branch | Off |
--github-pages |
Generate GitHub Pages index.html |
Off |
--include |
Glob patterns to include | All files |
--exclude |
Glob patterns to exclude | None |
--doc-type |
Style: api, architecture, user-guide, developer |
Default |
--max-depth |
Maximum module nesting depth | 2 |
codewiki generate \
--create-branch \
--github-pages \
--output ./docscodewiki generate \
--include "src/core,src/api" \
--exclude "tests/" \
--doc-type architecture| Software | Minimum Version |
|---|---|
| Python | 3.9+ |
| Git | 2.x |
| pip | 22+ |
An API key for at least one LLM provider (Anthropic, OpenAI, Azure OpenAI, or any OpenAI-compatible endpoint) is required.
📚 See the Documentation for comprehensive guides including getting started tutorials, development setup, and full architecture reference.
CodeWiki is part of the OpenMSP open-source community.
- Community Slack: OpenMSP Slack
- Community portal: openmsp.ai
- Flamingo Platform: flamingo.run
- OpenFrame: openframe.ai