OpenWiki is a CLI tool from LangChain for writing and continuously maintaining "agent documentation" for codebases. It turns a codebase and knowledge sources into a self-owned, interlinked Markdown wiki for coding agents to understand the repository, answer questions, and find context across related projects; humans can also read the same pages directly or browse them as an interactive graph.
Purpose
OpenWiki primarily serves coding agents: enabling agents to quickly understand a codebase, answer questions related to that repository, and find context across related projects. For repository wikis, OpenWiki traces every fact back to source evidence, so updates can focus on what has actually changed. It can be launched from within the coding agent you are already using, or used as a standalone CLI for repository documentation, personal knowledge bases, and scheduled updates.
Key capabilities
- Generate and maintain a linked wiki: Turn a codebase and knowledge sources into a Markdown wiki, with the written documentation located under the
openwiki/directory, and save progress. - Source-evidence-based fact tracing: Every fact in a repository wiki can be traced back to source evidence, so updates only handle what has changed; versioned source evidence can identify facts that need attention (grounded Claims).
- Resumable updates: Completed pages are preserved after an interruption, forming durably resumable units.
- Linked wiki workspaces: Use
openwiki linkto group existing wikis of related repositories (such as control plane, data plane, infrastructure) into a named workspace, after which agents can search across the entire service scope and read relevant sections of any member wiki. Repositories keep their own wikis, can belong to multiple workspaces at the same time, and do not need to share a parent directory. - MCP search and read:
openwiki_searchreturns compact ranked results,openwiki_readreads the full sections selected by the agent. These tools are local, read-only, and do not use models; they do not start generation runs or initiate model calls on their own.openwiki_list_workspacesandopenwiki_list_wikisare used for discovery when a repository is already linked. - Interactive graph browsing: Turn any wiki into an interactive node graph, paired with a side-by-side Markdown reader; the graph updates as you edit the wiki.
- Static visualization export: Export a static directory (including
index.html、client.js、client-lib.js、styles.css、graph.json) to publish alongside the generated documentation, hostable on GitHub Pages, MkDocs, or any static hosting. - Scheduled updates: Open documentation PRs when the wiki changes via scheduled CI jobs, with examples covering GitHub Actions, GitLab CI, and Bitbucket Pipelines.
- Parallel page workers: Native CLI init and update runs can record multiple pages at the same time, with concurrency defaulting to 1 and settable from 1 to 8.
How to use
The simplest way is to launch it from within the coding agent you are already using: OpenWiki uses that agent's already-authenticated model session and repository tools, so no separate model provider configuration is needed.
- Install OpenWiki: requires Node.js 22.22.0 or newer. If using Pi, install it via Pi in step 2; no separate global OpenWiki installation is needed.
- Connect a coding agent: choose the integration method for the corresponding agent.
- Create a wiki: restart the coding agent, open a repository and ask a question; the agent will research the repository and write a linked wiki in
openwiki/; OpenWiki traces its source evidence and saves progress as each page is completed.
All integrations are installed at the user level by default, so a single installation can be used in any Git repository. Use openwiki integrations list to view installation status, or use openwiki integrations uninstall <host> Safely remove the integration; add --project [path] can perform list, install, or uninstall on repository-level state, and the project path resolves to its Git repository root.
You can also run OpenWiki's built-in Deep Agents documentation agent directly, including for scheduled runs and personal wikis. After installing the CLI, initialize the repository wiki; the first run will guide you through selecting a provider, credentials, and a model, then write to the openwiki/ directory. OpenWiki supports fourteen model providers, including hosted models and local OpenAI-compatible endpoints. When updating an existing wiki, it updates based on repository changes since the last successful run as well as stale Claims.
There are two run modes: bare openwiki、openwiki --init、openwiki --update defaults to code mode; adding the personal positional argument (or --mode personal) switches to personal knowledge base mode. By default, the CLI stays open after the run ends so you can continue sending follow-up messages; adding -p / --print performs a one-off non-interactive run, printing the final output and then exiting.
The MCP generation lifecycle is openwiki_begin → openwiki_submit_plan → openwiki_next_page → openwiki_submit_page → … → openwiki_finish, with an additional optional on-demand openwiki_inspect_page_claims.
By default, OpenWiki stores local credentials, personal wikis, connector data, conversation history, and skills under ~/.openwiki . Before startup, you can use OPENWIKI_CONFIG_DIR to specify another writable directory (for example, a mounted container volume). This variable only selects a separate state directory; OpenWiki will not move or delete an existing ~/.openwiki directory.
Use cases
- Generate and maintain documentation for repositories inside coding agents, helping agents understand the codebase and answer questions.
- When serving across multiple repositories (control plane, data plane, infrastructure), group their wikis into a workspace and search across repositories.
- Automatically keep documentation up to date with scheduled CI tasks, and open documentation PRs when there are changes.
- Build a personal knowledge base (personal brain).
- Browse and publish wikis as interactive graphs or static visualizations.
Limitations and caveats
- Requires Node.js 22.22.0 or newer.
- On Windows, install using a Node.js package manager (
npm install -g openwikiorpnpm add -g openwiki); installing with bun may fall back to compilingbetter-sqlite3native dependencies, requiring Visual Studio Build Tools with the "Desktop development with C++" workload. - Host-driven runs currently support repository code wikis, not personal knowledge bases; they use repository source and tests, and do not yet support context from connector sources (including LangSmith).
- Visualization pages load graph, Markdown, and chart libraries from public CDNs, so both local and static viewers require an internet connection.
- The visualization service binds only to the local loopback address (
127.0.0.1, and is not exposed to the network). --exportcannot be used together with--portor--no-open.- Auto-merge is repository infrastructure rather than an OpenWiki runtime feature; it requires enabling Allow auto-merge, configuring branch protection or rulesets, creating a fine-grained personal access token or GitHub App token with access only to the target repository and Contents read/write and Pull requests read/write permissions, and saving it as
OPENWIKI_PR_TOKEN. - Running
openwiki --initagain will replace the existing generated repository wiki and Claims with a completely new generation, while preserving user-writtenopenwiki/INSTRUCTIONS.mddescriptions. - Transient CI runners restart after a failure unless their workspace is preserved.