本页还没有译文
本页 29 段还没译成日本語,下面显示的是英文原文。Quickstart
还没翻译译自英文(docs.langchain.com)本页 29 段都还没译
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
OpenWiki requires Node.js 22.22.0 or later.
npm install -g openwikiOn Windows, prefer
npmorpnpm. Installing with Bun can fall back to compiling the nativebetter-sqlite3dependency 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:
openwiki --initOn 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 saves its configuration and secrets to
~/.openwiki/.env.Running
--initagain regenerates the repository wiki and Claims from scratch while preservingopenwiki/INSTRUCTIONS.md. Interrupted runs on a persistent checkout resume fromopenwiki/.run.json.To run OpenWiki inside a coding agent instead of a standalone model session, see Coding-agent integrations. After the wiki exists, you can search it or link related repositories.
-
Review the generated wiki
OpenWiki writes documentation to
openwiki/in the repository, including a quickstart entrypoint and topic pages. It creates or refreshesAGENTS.mdat the repository root with a block that instructs coding agents to consult the wiki for codebase context. WhenCLAUDE.mdalready exists, OpenWiki refreshes a managed block that imports@AGENTS.md. Factual pages are grounded with Claims underopenwiki/.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--initand--updateruns do not rewrite it.To explore the wiki in a browser, run:
openwiki visualizeThis 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:
openwiki --updateIn 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 personal --initPersonal mode writes to ~/.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
Bare openwiki opens an interactive session in code mode for the current repository. Pass a message to start with a request:
openwiki "Please generate documentation for this repository"Use -p / --print for a one-shot non-interactive run that prints the final assistant output and exits:
openwiki -p "Summarize what you can do"In chat, use /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 named openwiki. You can also set these values in ~/.openwiki/.env or the process environment:
LANGSMITH_API_KEY=your-key
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=openwikiTo enrich the repository wiki from LangSmith traces (separate from tracing OpenWiki itself), see LangSmith connector.
Next steps
- Code mode: repository wikis, Claims, OKF output, and agent instruction files
- Coding-agent integrations: run OpenWiki inside Codex, Claude Code, OpenCode, Cursor, IBM Bob, Kiro, Oh My Pi, Antigravity, or Pi
- Search and link wikis: MCP search and read, plus multi-repo workspaces
- 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