Wikigen: Automate GitHub Wiki Generation with a Single CLI Command
What It Does — Zero-Infrastructure Documentation Generation
Wikigen is a single Go binary that connects directly to your GitHub repositories, uses Claude Code to analyze the source code, and generates complete GitHub Wiki documentation. It works by:
- Cloning repositories via SSH or PAT
- Using Claude Code's built-in tools (Read, Grep, Glob, Bash) to analyze the codebase
- Generating GitHub Wiki-compatible Markdown files
- Outputting a directory structure ready to push to your
{repo}.wiki.gitrepository
The tool requires no Docker, Ollama, or embedding infrastructure. It's a pure CLI tool that leverages Claude Code's existing capabilities for code analysis.
Setup — Get Running in Minutes
# Prerequisites:
# - Go 1.22+
# - git with SSH key configured
# - Claude Code CLI installed and authenticated
git clone https://github.com/tomohiro-owada/wikigen.git
cd wikigen
cp .env.example .env
# Edit .env as needed
go build -o wikigen .
When To Use It — Perfect for These Scenarios
1. New Repository Onboarding
Instead of manually creating documentation for new projects, run:
./wikigen owner/new-repo
This generates a complete wiki with:
- Home.md (landing page with table of contents)
- _Sidebar.md (navigation)
- System-Architecture.md
- API-Specification.md
- Data-Model.md
2. Multi-Repository Documentation
For projects spanning multiple repos, use the multi-repo syntax:
# In repos.txt:
myproject:owner/frontend-repo
myproject:owner/backend-repo
myproject:owner/shared-repo
./wikigen -f repos.txt -p 2 -pp 5
This creates cross-repository documentation showing how services interact, with repo-level and page-level parallelism for speed.
3. Batch Updates Across Teams
# Generate wikis for all team repos
./wikigen -f all-repos.txt -model haiku -lang en
# Retry only failed pages later
./wikigen -retry
Use -model haiku for faster generation or -lang en to ensure English documentation.
Advanced Features You'll Actually Use
Dry Run Mode
Preview what will be generated without actually creating pages:
./wikigen -dry-run owner/repo
JSON Output for Automation
Get structured results for CI/CD pipelines:
./wikigen -json owner/repo
Error Handling That Doesn't Lose Work
- Auto-retry: Each page retries up to 3 times
- Incremental save: Pages saved immediately after generation
- Partial results preserved if process is interrupted
- _errors.log with timestamped details
Integration Workflow
Push generated wikis directly to GitHub:
# Generate the wiki
./wikigen owner/repo
# Clone the wiki repo
git clone git@github.com:owner/repo.wiki.git
# Copy generated content
cp -r wiki-output/repo/* repo.wiki/
# Commit and push
cd repo.wiki
git add -A && git commit -m "Update wiki" && git push
Security Considerations
Wikigen validates all repository inputs:
- Must match
owner/repoformat - Rejects path traversal (
..) - Rejects shell injection characters (
;,&,|, etc.)
All configuration can be set via .env file, with CLI flags taking precedence.
Why This Matters for Claude Code Users
This tool demonstrates a powerful pattern: using Claude Code as an analysis engine within automated workflows. Instead of manually prompting Claude to document code, Wikigen structures the entire process:
- It automatically discovers files via Glob
- Uses Grep to find patterns and relationships
- Leverages Read to understand code context
- Uses Bash for git operations
- Structures the output consistently
This is exactly the type of automation Claude Code enables when you treat it as a programmable component rather than just a chat interface.


