Install and generate repository docs
Install the CLI
npm or pnpm. Installing with Bun can fall back to compiling the native better-sqlite3 dependency and may require Visual Studio Build Tools with the Desktop development with C++ workload.Initialize in your repository
From the repository root, run the following command:On the first interactive run, OpenWiki prompts for:
- An inference provider and model
- The provider API key (or equivalent credentials)
- An optional LangSmith API key for tracing
- LangSmith projects to enrich the wiki from runtime traces
~/.openwiki/.env.Running --init again regenerates the repository wiki and Claims from scratch while preserving openwiki/INSTRUCTIONS.md. Interrupted runs on a persistent checkout resume from openwiki/.run.json.To run OpenWiki inside Codex, Claude Code, OpenCode, or Cursor instead of a standalone model session, see Coding-agent integrations.Review the generated wiki
OpenWiki writes documentation to This opens a local interactive node graph with a side-by-side Markdown reader. See Visualize your wiki.
openwiki/ in the repository, including a quickstart entrypoint and topic pages. It also maintains an AGENTS.md and CLAUDE.md at the repository root, adding a block that instructs coding agents to consult the wiki for codebase context. Factual pages are grounded with Claims under openwiki/.claims/.Repository-specific wiki instructions live in openwiki/INSTRUCTIONS.md. OpenWiki reads this file for scope and priorities. To change it, edit the file, or ask OpenWiki in chat to change the brief (for example, openwiki "Update openwiki/INSTRUCTIONS.md to focus on the public API"). Normal --init and --update runs do not rewrite it.To explore the wiki in a browser, run:Keep docs up to date
Refresh documentation after code changes:In code mode, updates also reconcile stale Claims when source evidence changes. For automated updates in CI, see Automate updates.
Personal wiki (optional)
To initialize a local personal brain instead of repository docs:~/.openwiki/wiki and can ingest configured connectors such as local git repositories, Custom MCP, Gmail, Notion, web search, Hacker News, and X/Twitter. See Personal mode.
Interactive and one-shot runs
Bareopenwiki opens an interactive session in code mode for the current repository. Pass a message to start with a request:
-p / --print for a one-shot non-interactive run that prints the final assistant output and exits:
/api-key to update the current provider API key, /langsmith-key to update or clear LangSmith tracing credentials, and /effort to set reasoning effort for supported models.
Trace with LangSmith
During onboarding, provide a LangSmith API key to trace OpenWiki runs to a LangSmith project namedopenwiki. You can also set these values in ~/.openwiki/.env or the process environment:
Next steps
- Code mode: repository wikis, Claims, OKF output, and agent instruction files
- Coding-agent integrations: run OpenWiki inside Codex, Claude Code, OpenCode, or Cursor
- Personal mode: local brain and connectors
- Model providers: supported providers and credentials
- Automate updates: GitHub Actions, GitLab CI, and Bitbucket Pipelines
- CLI reference: commands and flags
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

