Skip to main content
OpenWiki is a CLI that writes and maintains a Markdown wiki for your codebase or personal knowledge. Coding agents use that wiki as durable context, so they spend less time and fewer tokens rediscovering architecture, integrations, and other repository details. Humans can read the same docs, but agents are the primary audience. This guide covers installation, provider setup, and your first documentation run. For a feature overview, see OpenWiki overview.

Install and generate repository docs

Install the CLI

On Windows, prefer 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
OpenWiki saves its configuration and secrets to ~/.openwiki/.env.

Review the generated wiki

OpenWiki writes documentation to 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.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:
This opens a local interactive node graph with a side-by-side Markdown reader. See Visualize your wiki.

Keep docs up to date

Refresh documentation after code changes:
For automated updates in CI, see Automate updates.

Personal wiki (optional)

To initialize a local personal brain instead of repository docs:
Personal mode writes to ~/.openwiki/wiki and can ingest configured connectors such as local git repositories, Gmail, Notion, web search, Hacker News, and X/Twitter. See Personal mode.

Interactive and one-shot runs

Bare openwiki opens an interactive session in code mode for the current repository. Pass a message to start with a request:
Use -p / --print for a one-shot non-interactive run that prints the final assistant output and exits:
In chat, use /api-key to update the current provider API key and /langsmith-key to update or clear LangSmith tracing credentials.

Trace with LangSmith

During onboarding, provide a LangSmith API key to trace OpenWiki runs to a LangSmith project named openwiki. You can also set these values in ~/.openwiki/.env or the process environment:

Next steps