Skip to content

MaxQian888/RepoWiki

 
 

Repository files navigation

RepoWiki

Open-source DeepWiki alternative — generate comprehensive wiki documentation for any codebase from your terminal or browser.

PyPI Python License: MIT

中文文档

Why RepoWiki?

DeepWiki deepwiki-open RepoWiki
Deploy SaaS only Docker Compose pip install repowiki
Local repos No No Yes
CLI No No Yes
Web UI Yes Yes Yes
Export Web only Web only Markdown / JSON / HTML
Reading guide No No PageRank + guided path
Terminal Q&A No No repowiki chat
Dependencies N/A Docker + FAISS + Node Python + SQLite

Quick Start

pip install repowiki

# set your API key (DeepSeek, OpenAI, Anthropic, etc.)
export DEEPSEEK_API_KEY=sk-xxx
# or
repowiki config set api_key sk-xxx

# scan a local project
repowiki scan ./my-project

# scan a GitHub repo
repowiki scan https://github.com/pallets/flask

# generate self-contained HTML
repowiki scan ./my-project --format html --open

# start the web interface
pip install repowiki[web]
repowiki serve

Features

Wiki Generation

Automatically generates structured documentation for any codebase:

  • Project overview — what it does, tech stack, setup instructions
  • Module documentation — purpose, key files, relationships, important functions
  • Architecture diagrams — auto-detected architecture type with Mermaid visualizations
  • Reading guide — "start here" path based on PageRank file importance ranking
  • Bundle-aware scanner — skips minified JS/CSS and generated frontend chunks before they burn LLM context

Multiple Output Formats

  • Markdown — directory of .md files, ready to commit to your repo
  • JSON — structured data for API consumption or custom rendering
  • HTML — self-contained single file, share with anyone (Mermaid diagrams included)

Web Interface

Three-column wiki viewer with sidebar navigation, Mermaid diagram rendering, and an AI-powered Q&A chat about the codebase.

CLI-First Design

Everything works from the terminal. No Docker, no database server, no web browser required.

repowiki scan .                    # generate wiki
repowiki scan . -f html --open     # open in browser
repowiki scan . -l zh              # Chinese output
repowiki scan . --since main       # incremental: only re-analyse changed modules
repowiki scan . -c 2               # cap parallel LLM calls (rate-limit-friendly)
repowiki chat .                    # terminal Q&A with TF-IDF retrieval
repowiki config list               # show configuration

Supported Languages

Python, JavaScript, TypeScript, Go, Rust, Java, Kotlin, C/C++, C#, Ruby, PHP, Swift, Dart, Vue, Svelte, and 30+ more.

Supported LLM Providers

Powered by litellm, RepoWiki works with 100+ LLM providers:

Provider Model Alias
Anthropic Claude Opus 4.5 opus
Anthropic Claude Sonnet 4.5 claude
Anthropic Claude Haiku 4.5 haiku
OpenAI GPT-4o gpt
OpenAI GPT-4o Mini gpt-mini
Google Gemini 1.5 Pro gemini
Google Gemini 1.5 Flash gemini-flash
DeepSeek DeepSeek Chat deepseek
DeepSeek DeepSeek Coder deepseek-coder
Alibaba Qwen 2.5 72B qwen
Moonshot Kimi 128k kimi
Zhipu GLM-4 Plus glm

Aliases map to litellm model IDs — set MODEL_ALIASES in config.py or pass any litellm-supported string directly with -m.

repowiki config set model deepseek    # use alias
repowiki scan . -m gpt                # or pass directly

Configuration

RepoWiki looks for config in this order:

  1. CLI flags (-m, -l, -o)
  2. Environment variables (REPOWIKI_MODEL, REPOWIKI_API_KEY)
  3. Config file (~/.repowiki/config.json)
  4. Provider-specific env vars (DEEPSEEK_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY)

Project Structure

RepoWiki/
├── src/repowiki/
│   ├── cli.py              # Click CLI with scan/serve/chat/config commands
│   ├── config.py           # Configuration management
│   ├── core/
│   │   ├── scanner.py      # File scanning with language detection
│   │   ├── analyzer.py     # Multi-step LLM analysis pipeline
│   │   ├── graph.py        # Dependency graph + PageRank
│   │   ├── wiki_builder.py # Wiki page assembly
│   │   ├── rag.py          # TF-IDF retrieval for Q&A
│   │   └── cache.py        # SQLite caching
│   ├── llm/
│   │   ├── client.py       # litellm async wrapper
│   │   └── prompts.py      # Structured prompt templates
│   ├── ingest/
│   │   ├── local.py        # Local directory ingestion
│   │   └── github.py       # Git clone with caching
│   ├── export/
│   │   ├── markdown.py     # Markdown directory export
│   │   ├── json_export.py  # JSON export
│   │   └── html.py         # Self-contained HTML export
│   └── server/             # FastAPI web backend
├── frontend/               # React + Vite + TailwindCSS
├── pyproject.toml
└── LICENSE

How It Works

  1. Scan — Walk the directory tree, filter out binaries, generated bundles, and oversized files, detect languages and entry points
  2. Graph — Parse import statements across 6 languages, build a dependency graph, run PageRank to rank file importance
  3. Analyze — Send file tree + key files to LLM in 4 structured passes (overview, modules, architecture, reading guide)
  4. Cache — Store results in SQLite keyed by content hash, skip unchanged files on re-scan
  5. Export — Assemble wiki pages with Mermaid diagrams and source links, output in chosen format

Development

git clone https://github.com/he-yufeng/RepoWiki.git
cd RepoWiki

# backend
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,web]"

# frontend
cd frontend && npm install && npm run dev

# run backend
repowiki serve --port 8000

GitHub Action

Run RepoWiki on every PR and commit the regenerated wiki back automatically:

# .github/workflows/wiki.yml
on:
  pull_request:
    types: [opened, synchronize]

permissions:
  contents: write

jobs:
  update-wiki:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with: { fetch-depth: 0 }
      - uses: he-yufeng/RepoWiki/.github/actions/repowiki-scan@main
        with:
          output: docs/wiki
          since: origin/${{ github.event.pull_request.base.ref }}
          api-key: ${{ secrets.DEEPSEEK_API_KEY }}

Inputs: path, output, format (markdown/json/html), language, model, api-key (required), since (incremental ref), concurrency, max-context-tokens, python-version, repowiki-version. See .github/actions/repowiki-scan/action.yml and the example .github/workflows/wiki-on-pr.yml for a complete PR-bot recipe.

Related Projects

  • CodeJoust — once RepoWiki tells you how the repo works, CodeJoust helps you change it: race Claude Code, aider, Codex, and Gemini on the same bug in parallel git worktrees, auto-score by tests/cost/diff/time, merge the winner. pip install codejoust.
  • LiteBench — one-command LLM/agent benchmark. HumanEval/GSM8K/MMLU/MATH-500 built in, plus YAML-defined custom tasks and a single-file HTML dashboard.
  • CoreCoder — Claude Code's architecture distilled to ~1,400 lines of Python, with 7 deep-dive architecture articles.
  • AnyCoder — practical terminal AI coding agent, 100+ model support via litellm.

License

MIT

About

Open-source DeepWiki alternative — generate comprehensive wiki documentation for any codebase from terminal or browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 81.3%
  • TypeScript 18.6%
  • Other 0.1%