Wright AIWright AI
Documentation
Need Help?Dashboard →
v1.0 · Wright AI Docs

Documentation

Everything you need to generate, track, and maintain documentation across your entire codebase — automatically.

01 · Getting Started

Getting Started

What is Wright AI?

Wright AI is a documentation engine for codebases. It reads your functions, understands their callers and callees, and writes complete docstrings in your team's chosen style. Once installed, it also watches for drift— when your code changes but the docs don't — and surfaces those gaps before they reach production.

The core problem Wright solves: teams write documentation once, then the code drifts away from it over months of iteration. Wright makes documentation a living part of your workflow rather than a one-time chore.

Generate
One command for your entire repo
📊
Coverage
Know exactly what's undocumented
🔍
Drift
Catch stale docs before they merge
💬
Chat
Ask questions, get sourced answers
🔌
MCP
Live docs for Claude Code, Cursor & Copilot
📄
llms.txt
Machine-readable index for any LLM

Quick Start

Get up and running in under 5 minutes with the VS Code extension.

1
Install the VS Code Extension
Open the VS Code Marketplace and search for Wright AI, or click Install from Marketplace. It's free.
2
Open any file with functions
Open a TypeScript, JavaScript, or Python file. Wright automatically scans for undocumented functions and shows a Generate Docs lens above each one.
3
Click Generate Docs
A diff preview opens on the right. Review the generated docstring, then accept or discard. Nothing is written until you accept.
4
Done
The docstring is inserted. Wright tracks coverage for this file — open the sidebar panel to see your overall coverage score.
You can also generate docs for an entire directory at once from the command palette: Wright: Generate Docs for Folder.

Prerequisites

Before installing Wright AI, make sure your environment meets these requirements:

RequirementVersionNotes
Node.js≥ 18Required for the VS Code extension and CLI
Python≥ 3.9Required if using the CLI on Python projects
VS Code≥ 1.85For the VS Code extension
GitanyRequired for drift detection

Supported languages for documentation generation:

  • TypeScript / JavaScript — JSDoc style
  • Python — Google, NumPy, or Sphinx style
  • Go — godoc style
  • Rust — rustdoc style (beta)

02 · Installation

Installation

VS Code Extension

The easiest way to get started. Install from the Marketplace — no config files, no terminal required.

1
Install from Marketplace
Search Wright AI in the VS Code Extensions panel, or visit the Marketplace directly.
2
Sign in to Wright AI
After install, a prompt appears in the bottom status bar. Click Sign in to Wright and authenticate with your account.
3
That's it
Wright automatically activates for any supported file type. Look for the Generate Docs ↑ lens that appears above each undocumented function.
The extension works entirely locally — your code never leaves your machine. Wright generates docs by sending only the function signature and surrounding context to the AI model.

Command Line

The CLI gives you full control: batch generation, coverage reports, drift checks, and codebase chat — all from your terminal.

bash
pip install wright-ai

Initialize Wright in your project:

bash
wright init .

This creates a wright.config.json at the root of your project with sensible defaults. Then run your first generation:

bash
# Generate docs for a single directory
wright generate src/
 
# Generate docs for the entire project
wright generate .
 
# Preview without writing (dry run)
wright generate src/ --dry-run

GitHub Action

Add Wright to your CI pipeline to block PRs that drop documentation coverage or introduce drift.

.github/workflows/wright.yml
name: Wright AI — Documentation Check
 
on:
pull_request:
branches: [main]
 
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
 
- name: Check documentation coverage & drift
uses: surajs1999/WrightAI@v1
with:
mode: coverage
threshold: "0.8" # fail if coverage drops below 80%
check_drift: "true" # also block on stale docstrings
env:
WRIGHT_TOKEN: ${{ secrets.WRIGHT_TOKEN }}
Store your Wright token in GitHub Secrets as WRIGHT_TOKEN. Never commit it directly to your workflow file.

MCP Server

Expose your indexed docs to any MCP-compatible AI tool — Claude Code, Cursor, GitHub Copilot — with one command.

bash
# Install the MCP server
pip install wright-mcp
 
# Start it (stays running in the background)
wright-mcp

Then add it to your MCP client config:

claude_code_config.json
{
"mcpServers": {
"wright": {
"command": "wright-mcp"
}
}
}

03 · Core Features

Core Features

Generate

Wright reads each function's signature, body, callers, and callees to generate a complete, accurate docstring. It doesn't just describe the function body — it understands what the function is used for.

bash
# Generate for a specific file
wright generate src/payments/core.ts
 
# Generate for a directory (recursive)
wright generate src/
 
# Choose a doc style
wright generate src/ --style google # or jsdoc, numpy, sphinx
 
# Preview diff without writing
wright generate src/ --dry-run

Supported doc styles:

StyleLanguagesExample
JSDocTypeScript, JavaScript@param name {string} - Description
GooglePythonArgs:\n name (str): Description
NumPyPythonParameters\n----------\nname : str
SphinxPython:param name: Description\n:type name: str
godocGoPlain prose, first sentence is the summary
Set your preferred style once in wright.config.json under docStyle so you never need to pass the flag.

Coverage

Coverage tracks what percentage of your public functions have documentation. Run a report at any time, or let the GitHub Action enforce a minimum threshold in CI.

bash
# Full coverage report
wright coverage --report
 
# Report for a specific path
wright coverage src/payments/ --report
 
# Output as JSON (useful for CI scripts)
wright coverage --report --json

The report shows coverage by folder, file, and individual function — so you know exactly where the gaps are, not just that they exist.

Coverage counts functions, methods, and exported constants. Private helpers (prefixed with _ in Python, or declared with no export in TS) are tracked but not required by default. Configure this via requirePrivate: true in your config.

Drift Detection

Drift happens when you change a function's signature — add a parameter, rename a return type — but forget to update the docstring. Wright catches this automatically on every commit.

Wright detects drift when:

  • A parameter is added or removed from a function signature
  • A parameter is renamed
  • The return type changes in a way that contradicts the documented return
  • A documented throws clause no longer applies
bash
# Check for drift across the whole project
wright drift
 
# Check a specific file
wright drift src/auth/middleware.ts
 
# Fix all drift automatically (re-generates stale docstrings)
wright drift --fix

In VS Code, drift appears as a gutter warning () next to the function. Hover to see exactly what changed. In CI, drift causes the Wright Action to fail and posts a summary on the PR.

Chat

Ask questions about your codebase in plain English. Wright indexes all your documented functions and returns answers with exact file and line citations — no hallucination, no guessing.

bash
wright chat

Example session:

~/project ❯ wright chat
$

How does the payment flow handle retries?

W

retryWithBackoff() in payments/retry.ts handles it — exponential backoff, max 3 attempts, then throws PaymentError.

payments/retry.ts:22payments/core.ts:67
$

Where is JWT token validation done?

W

validateToken() in auth/middleware.ts:14 — verifies signature and expiry, returns decoded User.

auth/middleware.ts:14
Chat runs entirely locally. Your code is indexed on-device and questions are answered from that index. Nothing is sent to a remote server.

llms.txt

Wright generates an llms.txt file — a structured, token-efficient index of every function in your codebase, following the open llms.txt standard. Paste it into any AI assistant or feed it to an agent and it instantly understands your entire project — signatures, docstrings, and file layout — without reading every source file.

One command
Scan and index the whole repo in seconds
🤖
Any LLM
Works with Claude, GPT-4o, Gemini, local models
📡
Live endpoint
Serve it over HTTP so agents always fetch fresh docs

Generate it from the CLI or via the API:

bash
# Generate llms.txt at your project root
wright llms-txt
 
# Write to a custom path
wright llms-txt --output docs/llms.txt
 
# Serve as a live HTTP endpoint (auto-refreshes on file changes)
wright llms-txt --serve
# → Listening on http://localhost:4242/llms.txt

The generated file format — one heading per file, one entry per function:

llms.txt
# my-project
 
> Auto-generated llms.txt for my-project. Provides codebase context for AI tools.
 
## payments/core.ts
 
### `processPayment(amount, card) -> PaymentResult`
Process a payment transaction with retry logic and idempotency.
 
### `validateCard(card) -> boolean`
Validate card details against Luhn algorithm. Throws InvalidCardError.
 
## auth/middleware.ts
 
### `authenticate(token) -> User`
Verify JWT signature and expiry, return decoded User or throw 401.
 
### `refreshToken(token) -> string`
Issue a new token if within the refresh window, otherwise throw.

How teams use it:

WorkflowHow
Paste into Claude / ChatGPTCopy llms.txt, paste at the top of a new chat, then ask anything about your codebase.
Feed to a Cursor agentAdd the file path in Cursor's context panel — the agent reads it before answering.
GitHub Actions artifactRun wright llms-txt in CI and upload as a build artifact. Always stays current with main.
Hosted endpointRun wright llms-txt --serve locally or in a staging environment. Point agents at the URL.
Commit llms.txt alongside your code. Reviewers and AI tools both benefit from it, and drift detection will flag it when the index is out of date.
The llms.txtstandard is open and model-agnostic. Wright's output is compatible with any tool that supports it — you are not locked in to Wright's own AI features.

04 · CI

CI / GitHub Actions

Wright's GitHub Action integrates into your existing workflow in one step. It can enforce a coverage threshold, block on drift, and post a summary comment on each PR.

.github/workflows/wright.yml
name: Wright AI — Documentation Check
 
on:
pull_request:
branches: [main, develop]
 
jobs:
docs:
name: Documentation Quality
runs-on: ubuntu-latest
 
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for drift comparison
 
- name: Wright AI — Coverage + Drift
uses: surajs1999/WrightAI@v1
with:
# Fail if doc coverage drops below this (0.0 – 1.0)
threshold: "0.8"
 
# Block merge if any doc drift is detected
check_drift: "true"
 
# Post a coverage summary comment on the PR
post_comment: "true"
 
# Only scan these paths (optional)
# paths: "src/ lib/"
env:
WRIGHT_TOKEN: ${{ secrets.WRIGHT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Available action inputs:

InputDefaultDescription
threshold"0.8"Minimum coverage ratio (0.0–1.0). CI fails if coverage drops below this on the PR.
check_drift"true"Fail CI if any documented function has drifted from its implementation.
post_comment"true"Post a coverage + drift summary as a PR comment.
paths"."Space-separated list of paths to scan. Defaults to entire repo.
style"auto"Doc style override. One of: jsdoc, google, numpy, sphinx.
Set threshold: "0" and check_drift: "true" to start with drift-only enforcement — a lower bar for teams adopting Wright incrementally.

05 · MCP

MCP Server Reference

Wright's MCP server exposes your indexed documentation as tools that any MCP-compatible AI assistant can call. The server starts on stdio and re-indexes automatically when you save files.

bash
# Start the server
wright-mcp
 
# ✓ MCP server started on stdio
# ✓ Indexed 847 functions across 12 files
# → Tool registered: search_docs
# → Tool registered: get_function_doc
# → Tool registered: list_undocumented
# ◌ Watching for file changes...

Available tools:

ToolDescriptionParameters
search_docsSemantic search over your documented functions. Returns the top matching docs with file + line citations.query: string — natural language question
get_function_docRetrieve the full docstring and signature for a specific function by name.function_name: string
list_undocumentedList all functions that are missing documentation, optionally filtered by path.path?: string — optional path prefix

Config for each supported client:

Claude Code — ~/.claude/claude_code_config.json
{
"mcpServers": {
"wright": {
"command": "wright-mcp"
}
}
}
Cursor — .cursor/mcp.json
{
"mcpServers": {
"wright": {
"command": "wright-mcp",
"args": []
}
}
}
The server re-indexes changed files within 2 seconds of a save. AI tools querying Wright always see your latest documentation — there's no manual refresh step.

06 · Configuration

Configuration

Running wright init . creates a wright.config.json at your project root. All settings are optional — Wright works with zero config out of the box.

wright.config.json
{
// Documentation style for generated docstrings
// Options: "jsdoc" | "google" | "numpy" | "sphinx" | "godoc"
"docStyle": "jsdoc",
 
// Minimum coverage required (used by CI action and wright coverage)
"coverageThreshold": 0.8,
 
// Paths to scan (relative to project root)
"include": ["src/", "lib/"],
 
// Paths to ignore
"exclude": [
"**/*.test.ts",
"**/*.spec.py",
"**/node_modules/**",
"**/__pycache__/**"
],
 
// Whether to require docs on private functions (default: false)
"requirePrivate": false,
 
// Whether to fail drift check on renamed params (default: true)
"strictDrift": true,
 
// Output path for llms.txt (default: "llms.txt")
"llmsTxtOutput": "llms.txt"
}
KeyTypeDefaultDescription
docStylestring"jsdoc"Default doc style for generated docstrings.
coverageThresholdnumber0.8Minimum ratio of documented functions (0.0–1.0).
includestring[]["./"]Glob patterns of paths to scan.
excludestring[]see aboveGlob patterns to skip. Test files are excluded by default.
requirePrivatebooleanfalseIf true, private/unexported functions count toward required coverage.
strictDriftbooleantrueIf true, renamed params count as drift. Set to false for looser checking.
llmsTxtOutputstring"llms.txt"Where to write the generated llms.txt file.

07 · FAQ

FAQ

Does my code leave my machine?+

No. Wright processes your code locally. When generating a docstring, only the function signature and a small amount of surrounding context is sent to the AI model — never your full codebase. The chat and coverage features are entirely on-device.

What counts as a documented function?+

A function is considered documented if it has a docstring (Python) or a JSDoc/equivalent block comment immediately preceding the function declaration (TypeScript/JavaScript/Go). Inline comments inside the function body do not count.

How is coverage calculated?+

Coverage = (number of documented public functions) / (total public functions). Private functions (prefixed _ in Python, unexported in Go, or without export in TS) are counted separately and not required by default. You can change this with requirePrivate: true.

Can I use Wright without a wright.config.json?+

Yes. Wright detects your project language and applies sensible defaults. Run wright init . any time to generate a config you can customize.

Does Wright work in monorepos?+

Yes. Place a wright.config.json in each package, or a single one at the root and use the include array to scope which packages are scanned. The CI action supports a paths input for the same purpose.

How do I ignore a specific function from coverage?+

Add a // @wright-ignore comment (TypeScript/JS) or a # wright: ignore comment (Python) on the line before the function definition. Wright will skip it entirely — no coverage penalty, no drift checks.

What's the difference between the free and paid plan?+

The VS Code extension, CLI, and MCP server are free. The GitHub Action's PR comment feature and dashboard analytics require a Wright AI account. Coverage threshold enforcement in CI is free.

Ready to ship?

Start with the VS Code extension — it's free and takes two minutes.

Install Extension →Need Help?

On this page

Getting StartedWhat is Wright AI?Quick StartPrerequisites
InstallationVS Code ExtensionCommand LineGitHub ActionMCP Server
Core FeaturesGenerateCoverageDrift DetectionChatllms.txt
CI / GitHub Actions
MCP Server Reference
Configuration
FAQ