ConfigsJul 7, 2026·3 min read

OpenWiki — AI-Maintained Documentation CLI by LangChain

A command-line tool by LangChain that uses AI agents to automatically write and maintain documentation for your codebase.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 29/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
CLI Tool
Install
Single
Trust
Trust: Established
Entrypoint
OpenWiki Overview
Safe staging command
npx -y tokrepo@latest install 804ba131-79bd-11f1-9bc6-00163e2b0d79 --target codex

Stages files first; activation requires review of the staged README and plan.

Introduction

OpenWiki is an open-source CLI tool from LangChain that automates the creation and maintenance of codebase documentation. It analyzes your source code, generates structured documentation in Markdown, and keeps it in sync as code evolves — replacing the manual burden of writing and updating docs with an AI-driven workflow.

What OpenWiki Does

  • Scans your codebase to understand module boundaries, public APIs, and architectural patterns
  • Generates structured Markdown documentation covering modules, functions, and data flows
  • Detects code changes and incrementally updates affected documentation sections
  • Produces a navigable wiki structure suitable for GitHub wikis, MkDocs, or static site generators
  • Integrates with AI coding agents as a skill for documentation-on-demand workflows

Architecture Overview

OpenWiki is a TypeScript CLI that combines static analysis with LLM-powered content generation. It first builds a code graph by parsing source files using language-aware parsers, identifying exports, dependencies, and call relationships. This graph is then fed to an LLM as structured context, which generates documentation for each module. Incremental updates diff the current code graph against the last documented state and re-generate only changed sections.

Self-Hosting & Configuration

  • Install globally via npm or use npx for one-off runs
  • Configure documentation scope, output directory, and language in openwiki.config.json
  • Set your preferred LLM provider and API key as environment variables
  • Customize output templates for different documentation styles
  • Run in CI to automatically update docs on every push

Key Features

  • Incremental documentation updates that re-generate only what changed
  • Language-aware parsing for TypeScript, Python, Go, Rust, and more
  • Structured output compatible with GitHub wikis, MkDocs, and Docusaurus
  • Agent skill mode for on-demand documentation within coding sessions
  • Configurable depth and detail level per module or directory

Comparison with Similar Tools

  • TypeDoc / JSDoc — generate API docs from code comments; OpenWiki writes prose documentation from code structure
  • Mintlify — AI-powered docs platform (SaaS); OpenWiki is a local CLI with no vendor dependency
  • DeepWiki — turns repos into wikis; OpenWiki focuses on incremental maintenance rather than one-shot generation
  • Docusaurus — a static documentation framework; OpenWiki generates the content, Docusaurus renders it

FAQ

Q: Does OpenWiki require an LLM API key? A: Yes. It uses an LLM to generate documentation content. You configure your preferred provider (OpenAI, Anthropic, etc.) via environment variables.

Q: Can it document private/internal code? A: Yes. All analysis runs locally. Only the code context sent to the LLM leaves your machine, and you control what gets included.

Q: How does incremental update work? A: OpenWiki tracks a hash of each documented code unit. On update, it re-parses the codebase, identifies changed units, and regenerates only their documentation.

Q: Which languages are supported? A: TypeScript, JavaScript, Python, Go, Rust, and Java have first-class parser support. Other languages get basic file-level documentation.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets