A CLI that writes and maintains agent documentation for your codebase. Built in Rust.
Inspired by OpenWiki.
- Agent-driven documentation — LLM explores your codebase, reads files, searches for patterns, and writes structured docs
- Multiple providers — OpenAI, Anthropic, DeepSeek, OpenRouter, or local
opencode(no API key needed) - Tool-calling agent loop —
list_files,read_file,search,write_doc - Incremental updates —
--updaterefreshes only what changed - AGENTS.md integration — appends a reference block so coding agents know where the docs live
- Heuristic scan mode —
--scangenerates instant, zero-LLM documentation by parsing source code directly - GitHub Actions ready — one-shot
-pmode works in CI
# npm (Node.js 16+)
npm install -g wakawiki
# or cargo
cargo install wakawikiOr build from source:
git clone https://github.com/sonyarianto/wakawiki.git
cd wakawiki
cargo build --release# Configure your LLM provider
wakawiki --init
# Generate documentation (interactive)
wakawiki
# One-shot non-interactive
wakawiki -p "Summarize the architecture of this project"
# Update existing documentation
wakawiki --updatewakawiki [OPTIONS] [PROMPT]
Options:
--init Configure provider, API key, and model
-p, --print Non-interactive one-shot mode
--scan Heuristic scan (no LLM) — instant, deterministic
--update Refresh existing wakawiki/ docs
--version Print version
-h, --help Show help
| Provider | API Key Required | Notes |
|---|---|---|
| OpenAI | Yes | GPT-4, GPT-4o |
| Anthropic | Yes | Claude Sonnet |
| DeepSeek | Yes | OpenAI-compatible API |
| OpenRouter | Yes | Unified API gateway |
| opencode | No | Uses local opencode CLI |
| Custom | Yes | Any OpenAI-compatible endpoint |
If you already use opencode, you can run wakawiki with zero API keys:
wakawiki --init # select "opencode"
wakawiki # uses your existing opencode setupwakawiki/
├── index.md # Project overview
├── architecture.md # High-level architecture
├── ... # Additional module docs
└── .wakawiki.json # Metadata for incremental updates
An AGENTS.md file is created (or appended) with a reference block pointing agents to wakawiki/.
Add this workflow to auto-update docs daily via PR:
name: wakawiki update
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo install --git https://github.com/sonyarianto/wakawiki.git
- run: wakawiki --update
env:
WAKAWIKI_PROVIDER: ${{ secrets.WAKAWIKI_PROVIDER }}
WAKAWIKI_API_KEY: ${{ secrets.WAKAWIKI_API_KEY }}
WAKAWIKI_MODEL: ${{ secrets.WAKAWIKI_MODEL }}
- uses: peter-evans/create-pull-request@v6
with:
title: 'docs: update wakawiki documentation'
branch: wakawiki-updateConfig is stored in ~/.wakawiki/.env:
WAKAWIKI_PROVIDER=openai
WAKAWIKI_API_KEY=sk-...
WAKAWIKI_MODEL=gpt-4o
WAKAWIKI_BASE_URL=https://api.openai.com/v1
You can also set these as environment variables directly.
MIT — see LICENSE.