Self-host CodeWiki on private code: validate the config before you spend tokens
Configure the open-source FSoft CodeWiki to generate architecture-aware docs on your own machine (so private code never leaves it), and validate the provider and model config before a full, token-spending run.
Run this workflow
CI-verified, 2/2 fixtures passing.
Build this with your agent
One copy-paste hands Claude Code, Codex, or Cursor the full recipe, steps included, nothing to fetch.
Intended Use
Anyone documenting private code without shipping it to a hosted service. CI validates the CodeWiki config: it parses, a provider is set, both the main model and the cluster model are set, and there is no raw API key in the config (keys belong in the system keychain). No install, no network, no key. The actual doc generation is fenced.
Not for
- Treating its 'beats DeepWiki' numbers as settled, ~68.8% vs 64.1% is the authors' own model-graded CodeWikiBench; their own table shows it losing to DeepWiki on C and C++
- A guaranteed product, at ~1.3k stars it is a small-userbase research artifact; validate it on your repo, do not assume
- Cheap runs, a full generation makes real LLM calls and costs tokens (or use its subscription mode routing through your local claude or codex CLI)
The Stack
Tested Against
github.com/FSoft-AI4Code/CodeWiki (2026-07)node@20Side effects & data flow
- Network
- none, local only
- Writes
- ./codewiki-config.json
- Credentials
- none required
Prerequisites
- Python 3.10+ and pip to actually run codewiki
- A model provider (or the subscription mode via a local claude/codex CLI)
Steps
- 1
Scaffold the config and validate provider + models (no key)
Set the provider and both models (CodeWiki uses a main model and a cluster model), and keep the API key out of the config, it belongs in the keychain. CI checks the config parses and the fields are set with no leaked key. Running codewiki generate on your code is fenced.
cat > codewiki-config.json <<'JSON' { "provider": "openai-compatible", "main_model": "claude-sonnet-5", "cluster_model": "claude-sonnet-5", "subscription_mode": "claude", "api_key_env": "ANTHROPIC_API_KEY" } JSON node -e ' const fs = require("fs"); const c = JSON.parse(fs.readFileSync("codewiki-config.json", "utf8")); function bad(m) { console.error("BAD: " + m); process.exit(1); } if (!c.provider) bad("no provider set"); if (!c.main_model) bad("main_model must be set (the model that writes the docs)"); if (!c.cluster_model) bad("cluster_model must be set (the model that clusters the codebase)"); if (c.api_key && String(c.api_key).length > 0) bad("do not put a raw api key in the config; keys belong in the system keychain (reference by env name)"); console.log("config OK: CodeWiki provider " + c.provider + ", main-model " + c.main_model + ", cluster-model " + c.cluster_model + "; no key in config (keychain); generation fenced"); ' - 2
Generate the docs on your code (the model step, not checked by CI)
pip install the CLI, run codewiki config validate to confirm your live config, then codewiki generate --github-pages --create-branch (or --update to regenerate only what changed). This makes real LLM calls on your code; the doc quality and cost are fenced.
Eval, 2 fixtures
Last passed: verified todayconfig-okcontainstimeout 30s · max $0Expected:
config OK: CodeWiki provider openai-compatible, main-model claude-sonnet-5, cluster-model claude-sonnet-5; no key in config (keychain); generation fencedclean-exitexit_codetimeout 30s · max $0Expected:
0
Results
CodeWiki (FSoft-AI4Code) is the open-source, run-it-yourself answer to hosted repo-wikis: a Python CLI that produces Mermaid architecture, data-flow, and sequence diagrams plus module prose across nine languages, on your machine, so it works on private repos. It is a research artifact (~1.3k stars, ACL 2026), not a hardened product, and a full run makes real LLM calls, so the doc quality is only as good as the model you point it at, and it costs tokens or a subscription.
Did this work for you?
Our CI checks the setup runs. You tell us if the whole thing worked. Tell us straight.
Related workflows
- Run GLM-5.2 for the bulk, escalate the hard turns to Opus 4.8
- codebase-memory-mcp: wire the knowledge graph, stop re-reading files
- OrcaRouter for coding: judge by passing tests, not by vibes
- Kilo Code: add an MCP tool and bind it to one mode
- Kilo Code: a mode that can only edit the files you let it
- Kilo Code: ship a big feature as isolated subtasks with Orchestrator
Liked this workflow?
Get new verified workflows in WebAfterAI, three issues a week (Tue, Thu, Sat).