{"id":47261679,"url":"https://github.com/tomohiro-owada/wikigen","last_synced_at":"2026-04-01T20:33:29.737Z","repository":{"id":344476559,"uuid":"1181922317","full_name":"tomohiro-owada/wikigen","owner":"tomohiro-owada","description":"Generate GitHub Wiki from source code using Claude Code. Single Go binary, no Docker needed.","archived":false,"fork":false,"pushed_at":"2026-03-15T00:07:09.000Z","size":162,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-15T07:21:21.262Z","etag":null,"topics":["ai","anthropic","claude","claude-code","cli","code-documentation","developer-tools","documentation","github-wiki","golang","llm","wiki-generator"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomohiro-owada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-14T20:05:37.000Z","updated_at":"2026-03-15T02:21:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tomohiro-owada/wikigen","commit_stats":null,"previous_names":["tomohiro-owada/wikigen"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tomohiro-owada/wikigen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fwikigen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fwikigen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fwikigen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fwikigen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomohiro-owada","download_url":"https://codeload.github.com/tomohiro-owada/wikigen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fwikigen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anthropic","claude","claude-code","cli","code-documentation","developer-tools","documentation","github-wiki","golang","llm","wiki-generator"],"created_at":"2026-03-14T23:29:40.199Z","updated_at":"2026-04-01T20:33:29.730Z","avatar_url":"https://github.com/tomohiro-owada.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wikigen\n\nA single Go binary CLI that generates GitHub Wiki from source code using Claude Code.\n\nClaude Code (`claude -p`) reads the repository code directly — using Read, Grep, Glob, and Bash tools — and writes GitHub Wiki-compatible Markdown files.\n\n**[See generated wiki example](https://github.com/tomohiro-owada/wikigen/wiki)** — this wiki was generated by wikigen itself.\n\n---\n\n**[English](#english)** | **[日本語](#日本語)**\n\n---\n\n## English\n\n### Architecture\n\n```\nwikigen → git clone (SSH) → claude -p --add-dir ./repo\n                                 │\n                                 ├── Read (source code)\n                                 ├── Grep (pattern search)\n                                 ├── Glob (file discovery)\n                                 ├── Bash (git log, etc.)\n                                 └── Write (.md files directly)\n```\n\nNo Docker, Ollama, or embedding required. Single binary, zero infrastructure.\n\n### Installation\n\n**Download binary** (recommended):\n\n```bash\n# Download the latest release for your platform\n# https://github.com/tomohiro-owada/wikigen/releases\ncurl -L https://github.com/tomohiro-owada/wikigen/releases/latest/download/wikigen-$(uname -s | tr A-Z a-z)-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') -o wikigen\nchmod +x wikigen\nsudo mv wikigen /usr/local/bin/\n```\n\n**Or build from source**:\n\n```bash\ngit clone https://github.com/tomohiro-owada/wikigen.git\ncd wikigen\ngo build -o wikigen .\n```\n\n### Prerequisites\n\n- git (SSH key configured, or PAT)\n- `claude` CLI installed and authenticated (`claude -p \"hello\"` should work)\n\n### Quick Start\n\n```bash\n# Preview structure without generating (dry run)\n./wikigen -dry-run owner/repo\n\n# Generate wiki\n./wikigen owner/repo\n\n# Local directory (no clone needed)\n./wikigen /path/to/local/repo\n\n# Batch from file with parallelism\n./wikigen -f repos.txt -p 2 -pp 5\n\n# Retry only failed pages\n./wikigen -retry\n\n# Get JSON results\n./wikigen -json owner/repo\n```\n\n### Usage\n\n```bash\n# Single repository\n./wikigen owner/repo\n\n# Local directory\n./wikigen /path/to/local/repo\n./wikigen .\n\n# Multiple repositories (remote and local can be mixed)\n./wikigen owner/repo1 /path/to/local/repo\n\n# Batch from file\n./wikigen -f repos.txt\n\n# Repo-level + page-level parallelism\n./wikigen -f repos.txt -p 2 -pp 5\n\n# Specify model\n./wikigen -f repos.txt -model haiku\n\n# Generate in English\n./wikigen -f repos.txt -lang en\n\n# Dry run (structure only, no page generation)\n./wikigen -dry-run -f repos.txt\n\n# JSON output (structured results to stdout)\n./wikigen -json -f repos.txt\n\n# Retry failed pages only\n./wikigen -retry\n```\n\n### repos.txt Format\n\n```\n# GitHub repos (cloned automatically)\nowner/repo1\nowner/repo2\n\n# Local directories (no clone needed)\n/path/to/local/repo\n./relative/path\n\n# Multi-repo wiki (multiple repos merged into one wiki)\nmyproject:owner/frontend-repo\nmyproject:owner/backend-repo\nmyproject:/path/to/local/repo    # local dirs can be grouped too\n```\n\nMulti-repo wikis generate cross-repository documentation — architecture pages that span all repos, showing how services interact.\n\n### Output Format\n\nOutputs GitHub Wiki-compatible directory structure. Push directly to `{repo}.wiki.git`.\n\n```\nwiki-output/{project}/\n  Home.md              # Landing page with table of contents\n  _Sidebar.md          # Navigation sidebar\n  System-Architecture.md\n  API-Specification.md\n  Data-Model.md\n  ...\n  _errors.log          # Created only if errors occurred\n```\n\n#### Push to GitHub Wiki\n\n```bash\ngit clone git@github.com:owner/repo.wiki.git\ncp -r wiki-output/repo/* repo.wiki/\ncd repo.wiki\ngit add -A \u0026\u0026 git commit -m \"Update wiki\" \u0026\u0026 git push\n```\n\n### Options\n\nAll options can be set via `.env` file. CLI flags take precedence over env vars.\n\n| Flag | Env Var | Default | Description |\n|---|---|---|---|\n| `-f` | - | - | Repository list file |\n| `-r` | - | - | Comma-separated repos |\n| `-token` | `GITHUB_TOKEN` | (empty=SSH) | GitHub PAT. If empty, SSH is used |\n| `-model` | `CLAUDE_MODEL` | - | Claude model (haiku, sonnet, opus) |\n| `-o` | `WIKI_OUTPUT_DIR` | `./wiki-output` | Output directory |\n| `-local` | - | - | Local directory (skip clone) |\n| `-clone-dir` | `WIKI_CLONE_DIR` | `./.repos` | Clone directory |\n| `-p` | `WIKI_PARALLEL` | `1` | Parallel repos |\n| `-pp` | `WIKI_PAGE_PARALLEL` | `3` | Parallel pages per repo |\n| `-lang` | `WIKI_LANGUAGE` | `ja` | Output language |\n| `-log` | - | stderr | Log file path |\n| `-retry` | - | false | Retry failed pages only |\n| `-dry-run` | - | false | Determine structure only |\n| `-json` | - | false | Output results as JSON to stdout |\n\n### Authentication\n\n| Method | Config | Use Case |\n|---|---|---|\n| SSH | SSH key registered with GitHub | Default. No PAT needed |\n| PAT | Set `GITHUB_TOKEN` in `.env` | For environments without SSH |\n\n### Input Validation\n\nwikigen validates all repository inputs:\n- Remote repos must match `owner/repo` format\n- Local paths must point to existing directories\n- Rejects path traversal (`..`) in remote repo names\n- Rejects shell injection characters (`;`, `\u0026`, `|`, etc.)\n\n### Error Handling \u0026 Retry\n\n1. **Auto-retry**: Each page is retried up to 3 times automatically\n2. **`-retry` flag**: Scans `wiki-output/` for failed pages and regenerates only those\n3. **`_errors.log`**: Timestamped error details per project\n4. **Incremental save**: Each page is saved immediately after generation — partial results are preserved if the process is interrupted\n\n### Progress Display\n\nReal-time progress with percentage:\n\n```\n── Progress: 1/3 wikis (33%) ──\n  dala-delivery  📝 5/20 (25%) API-Specification\n  gmn            📝 12/15 (80%) Tool-System\n```\n\n### JSON Output\n\nUse `-json` for structured output (useful for scripting):\n\n```bash\n./wikigen -json owner/repo 2\u003e/dev/null | jq '.[] | .project, .total_pages, .status'\n```\n\n### Documentation Policy\n\nGenerates documentation from the following categories based on actual source code.\nPage count is dynamically determined based on repository complexity.\n\n#### A. Factual (directly from code)\n- System overview, architecture, API specs, data models\n- Routing, state management, component catalog\n- Config, build/deploy, testing, auth, error handling, integrations\n\n#### B. High-confidence inference (from code patterns)\n- Processing flows, security design, performance considerations\n\nNothing is generated without code evidence. No speculation.\n\n### GitHub Actions — Auto-update Wiki on Push\n\nAutomatically regenerate your GitHub Wiki whenever source code changes.\n\n#### Setup\n\n1. **Enable Wiki** in your repository settings (Settings → Features → Wiki)\n2. **Create an initial Wiki page** via the Wiki tab (this initializes `.wiki.git`)\n3. **Generate an OAuth token**:\n   ```bash\n   claude setup-token\n   ```\n4. **Add the token to Secrets**: Settings → Secrets → Actions → `CLAUDE_CODE_OAUTH_TOKEN`\n5. **Add the workflow** `.github/workflows/wiki.yml`:\n\n```yaml\nname: Generate Wiki\n\non:\n  workflow_dispatch:\n  push:\n    branches: [main]\n    paths:\n      - '*.go'        # Adjust to your source files\n      - 'go.mod'\n\npermissions:\n  contents: write\n\njobs:\n  wiki:\n    runs-on: ubuntu-latest\n    timeout-minutes: 60\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: actions/setup-go@v5\n        with:\n          go-version: '1.22'\n\n      - name: Build wikigen\n        run: go build -o wikigen .\n\n      - uses: actions/setup-node@v4\n        with:\n          node-version: '20'\n\n      - name: Install Claude CLI\n        run: npm install -g @anthropic-ai/claude-code\n\n      - name: Generate wiki\n        env:\n          CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}\n        run: ./wikigen -lang en -pp 3 -model haiku -token \"${{ secrets.GITHUB_TOKEN }}\" owner/repo\n\n      - name: Push to wiki\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        run: |\n          git clone https://x-access-token:${GITHUB_TOKEN}@github.com/owner/repo.wiki.git wiki-repo\n          cp -r wiki-output/repo/* wiki-repo/\n          cd wiki-repo\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n          git add -A\n          git diff --staged --quiet || (git commit -m \"Update wiki\" \u0026\u0026 git push)\n```\n\nReplace `owner/repo` with your repository. The wiki auto-updates on every push to `main` that changes source files, or can be triggered manually from the Actions tab.\n\n\u003e **Note**: The OAuth token expires after approximately 1 year. Use `claude setup-token` to regenerate when needed. Alternatively, use `ANTHROPIC_API_KEY` for stable long-term usage (API billing applies).\n\n### Acknowledgements\n\nThis project was inspired by [DeepWiki-Open](https://github.com/AsyncFuncAI/deepwiki-open), an AI-powered wiki generator that uses RAG and embedding for documentation generation. wikigen takes a different approach — replacing the RAG/embedding pipeline with Claude Code's native tool use (Read, Grep, Glob, Bash) for direct source code access, eliminating the need for Docker, Ollama, or any embedding infrastructure.\n\n### Claude Code Integration\n\nwikigen includes a `.claude/skills/wikigen/SKILL.md` skill file. When working in the wikigen directory, Claude Code can reference usage patterns and best practices automatically.\n\n---\n\n## 日本語\n\n### アーキテクチャ\n\n```\nwikigen → git clone (SSH) → claude -p --add-dir ./repo\n                                 │\n                                 ├── Read (ソースコード読み取り)\n                                 ├── Grep (パターン検索)\n                                 ├── Glob (ファイル探索)\n                                 ├── Bash (git log 等)\n                                 └── Write (.md ファイル直接書き出し)\n```\n\nDocker、Ollama、embedding 一切不要。ワンバイナリ、インフラ不要。\n\n### インストール\n\n**バイナリをダウンロード**（推奨）:\n\n```bash\n# 最新リリースをダウンロード\n# https://github.com/tomohiro-owada/wikigen/releases\ncurl -L https://github.com/tomohiro-owada/wikigen/releases/latest/download/wikigen-$(uname -s | tr A-Z a-z)-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') -o wikigen\nchmod +x wikigen\nsudo mv wikigen /usr/local/bin/\n```\n\n**ソースからビルド**:\n\n```bash\ngit clone https://github.com/tomohiro-owada/wikigen.git\ncd wikigen\ngo build -o wikigen .\n```\n\n### 前提条件\n\n- git（SSH認証設定済み、または PAT）\n- `claude` CLI がインストール・認証済み（`claude -p \"hello\"` が動くこと）\n\n### クイックスタート\n\n```bash\n# 構造のプレビュー（dry run）\n./wikigen -dry-run owner/repo\n\n# wiki 生成\n./wikigen owner/repo\n\n# ローカルディレクトリ（clone不要）\n./wikigen /path/to/local/repo\n\n# 一括生成（並列）\n./wikigen -f repos.txt -p 2 -pp 5\n\n# 失敗ページのリトライ\n./wikigen -retry\n\n# JSON で結果取得\n./wikigen -json owner/repo\n```\n\n### 使い方\n\n```bash\n# 単一リポジトリ\n./wikigen owner/repo\n\n# ローカルディレクトリ\n./wikigen /path/to/local/repo\n./wikigen .\n\n# 複数（リモートとローカル混在OK）\n./wikigen owner/repo1 /path/to/local/repo\n\n# ファイルから一括\n./wikigen -f repos.txt\n\n# リポジトリ並列 + ページ並列\n./wikigen -f repos.txt -p 2 -pp 5\n\n# モデル指定\n./wikigen -f repos.txt -model haiku\n\n# 英語で生成\n./wikigen -f repos.txt -lang en\n\n# Dry run（構造決定のみ）\n./wikigen -dry-run -f repos.txt\n\n# JSON 出力\n./wikigen -json -f repos.txt\n\n# 失敗ページのリトライ\n./wikigen -retry\n```\n\n### repos.txt の書式\n\n```\n# GitHub リポジトリ（自動clone）\nowner/repo1\nowner/repo2\n\n# ローカルディレクトリ（clone不要）\n/path/to/local/repo\n./relative/path\n\n# マルチリポwiki（複数リポジトリを1つのwikiにまとめる）\nmyproject:owner/frontend-repo\nmyproject:owner/backend-repo\nmyproject:/path/to/local/repo    # ローカルもグループ化可能\n```\n\nマルチリポwikiではリポジトリ間の連携を含む横断的なドキュメントが生成されます。\n\n### 出力形式\n\nGitHub Wiki 互換のディレクトリ構成で出力。`{repo}.wiki.git` にそのまま push 可能。\n\n```\nwiki-output/{project}/\n  Home.md              ← トップページ（目次）\n  _Sidebar.md          ← ナビゲーション\n  System-Architecture.md\n  API-Specification.md\n  Data-Model.md\n  ...\n  _errors.log          ← エラーがあった場合のみ作成\n```\n\n#### GitHub Wiki への push\n\n```bash\ngit clone git@github.com:owner/repo.wiki.git\ncp -r wiki-output/repo/* repo.wiki/\ncd repo.wiki\ngit add -A \u0026\u0026 git commit -m \"Update wiki\" \u0026\u0026 git push\n```\n\n### オプション\n\n全てのオプションは `.env` でも設定可能。コマンドラインフラグが優先。\n\n| フラグ | 環境変数 | デフォルト | 説明 |\n|---|---|---|---|\n| `-f` | - | - | リポジトリリストファイル |\n| `-r` | - | - | カンマ区切りリポジトリ |\n| `-token` | `GITHUB_TOKEN` | (空=SSH) | GitHub PAT。未設定時はSSHでclone |\n| `-model` | `CLAUDE_MODEL` | - | Claude モデル (haiku, sonnet, opus) |\n| `-o` | `WIKI_OUTPUT_DIR` | `./wiki-output` | 出力ディレクトリ |\n| `-local` | - | - | ローカルディレクトリ（clone不要） |\n| `-clone-dir` | `WIKI_CLONE_DIR` | `./.repos` | clone先ディレクトリ |\n| `-p` | `WIKI_PARALLEL` | `1` | リポジトリ並列数 |\n| `-pp` | `WIKI_PAGE_PARALLEL` | `3` | ページ並列数（リポジトリごと） |\n| `-lang` | `WIKI_LANGUAGE` | `ja` | 出力言語 |\n| `-log` | - | stderr | ログファイルパス |\n| `-retry` | - | false | 失敗ページのみ再生成 |\n| `-dry-run` | - | false | 構造決定のみ |\n| `-json` | - | false | 結果をJSONでstdoutに出力 |\n\n### 認証\n\n| 方式 | 設定 | 用途 |\n|---|---|---|\n| SSH | `git` のSSH鍵設定済み | デフォルト。PAT不要 |\n| PAT | `.env` に `GITHUB_TOKEN` を設定 | SSH未設定の環境向け |\n\n### 入力バリデーション\n\n全てのリポジトリ入力を検証：\n- リモートリポは `owner/repo` 形式のみ受け付け\n- ローカルパスは既存ディレクトリであることを確認\n- パストラバーサル（`..`）を拒否（リモートリポ名）\n- シェルインジェクション文字（`;`, `\u0026`, `|` 等）を拒否\n\n### エラー処理とリトライ\n\n1. **自動リトライ**: 各ページは最大3回自動リトライ\n2. **`-retry` フラグ**: `wiki-output/` 内の失敗ページのみを再生成\n3. **`_errors.log`**: プロジェクトごとにタイムスタンプ付きエラー詳細を記録\n4. **即時保存**: 各ページは生成完了時点で保存 — プロセスが中断されても生成済みページは保持\n\n### 進捗表示\n\nパーセント付きリアルタイム進捗：\n\n```\n── Progress: 1/3 wikis (33%) ──\n  dala-delivery  📝 5/20 (25%) API-Specification\n  gmn            📝 12/15 (80%) ツールシステム\n```\n\n### JSON 出力\n\n`-json` でスクリプト連携に便利な構造化出力：\n\n```bash\n./wikigen -json owner/repo 2\u003e/dev/null | jq '.[] | .project, .total_pages, .status'\n```\n\n### ドキュメント生成方針\n\nコードベースから以下のカテゴリのドキュメントを自動生成。\nページ数はリポジトリの規模に応じて動的に決定。\n\n#### A. コードから確実に生成（事実ベース）\n- システム概要、アーキテクチャ、API仕様、データモデル\n- ルーティング、状態管理、コンポーネント一覧\n- 設定・環境変数、ビルド・デプロイ、テスト構成\n- 認証・認可、エラーハンドリング、外部連携\n\n#### B. コードパターンからの推論（高い確度）\n- 処理フロー、セキュリティ設計、パフォーマンス考慮\n\nコードに根拠がないものは生成しません。推測は一切行いません。\n\n### GitHub Actions — Push 時に Wiki を自動更新\n\nソースコード変更時に GitHub Wiki を自動再生成できます。\n\n#### セットアップ\n\n1. **Wiki を有効化** — リポジトリの Settings → Features → Wiki\n2. **初期ページを作成** — Wiki タブから手動で1ページ作成（`.wiki.git` の初期化に必要）\n3. **OAuth トークンを生成**:\n   ```bash\n   claude setup-token\n   ```\n4. **Secrets にトークンを追加** — Settings → Secrets → Actions → `CLAUDE_CODE_OAUTH_TOKEN`\n5. **ワークフロー `.github/workflows/wiki.yml` を追加**（英語セクションの YAML 例を参照）\n\nPush 時に自動実行、または Actions タブから手動実行できます。\n\n\u003e **注意**: OAuth トークンの有効期限は約1年です。`claude setup-token` で再生成してください。安定運用には `ANTHROPIC_API_KEY`（API課金）も使用できます。\n\n### 謝辞\n\n本プロジェクトは [DeepWiki-Open](https://github.com/AsyncFuncAI/deepwiki-open)（RAG と embedding を用いた AI Wiki ジェネレーター）にインスパイアされて開発しました。wikigen は RAG/embedding パイプラインを Claude Code のネイティブツール（Read, Grep, Glob, Bash）による直接的なソースコードアクセスに置き換えることで、Docker・Ollama・embedding インフラを不要にしています。\n\n### Claude Code 連携\n\n`.claude/skills/wikigen/SKILL.md` スキルファイルを同梱。wikigen ディレクトリで作業中の Claude Code が使い方とベストプラクティスを自動参照できます。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomohiro-owada%2Fwikigen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomohiro-owada%2Fwikigen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomohiro-owada%2Fwikigen/lists"}