Skip to main content
The wiki command generates comprehensive documentation for a repository by analyzing the knowledge graph with an LLM.

Usage

Arguments

string
Path to the repository to document. Defaults to current directory’s git root.

Options

boolean
default:"false"
Force full regeneration even if wiki is up to date.Flag: -f, --force
string
default:"minimax/minimax-m2.5"
LLM model name. Supports OpenAI, OpenRouter, or any OpenAI-compatible API.Flag: --model <model>Examples:
  • gpt-4o-mini (OpenAI)
  • minimax/minimax-m2.5 (OpenRouter)
  • llama3 (Local via Ollama)
string
default:"https://openrouter.ai/api/v1"
LLM API base URL.Flag: --base-url <url>Providers:
  • OpenAI: https://api.openai.com/v1
  • OpenRouter: https://openrouter.ai/api/v1
  • Ollama: http://localhost:11434/v1
string
LLM API key. Saved to ~/.gitnexus/config.json for future use.Flag: --api-key <key>Alternatively, set environment variable:
  • GITNEXUS_API_KEY
  • OPENAI_API_KEY
number
default:"3"
Number of parallel LLM calls.Flag: --concurrency <n>
boolean
default:"false"
Publish the generated wiki as a public GitHub Gist for easy viewing and sharing.Flag: --gistRequires: GitHub CLI (gh) installed and authenticated

Examples

Basic Usage

Generate wiki for the current repository:
First Run (Interactive Setup):

Custom Model

Local LLM (Ollama)

Force Regeneration

Publish as Gist

Save API Key

Key is saved to ~/.gitnexus/config.json and reused for future runs.

Output

The command displays a progress bar with phase updates:

Successful Generation

Already Up to Date

Generated Files

Wiki output is saved to .gitnexus/wiki/:

Viewing the Wiki

Open index.html in your browser:

How It Works

Phase 1: Graph Analysis (0-20%)

  1. Loads the knowledge graph from .gitnexus/db
  2. Identifies functional modules (communities)
  3. Extracts entry points and execution flows (processes)

Phase 2: Module Generation (20-90%)

For each module:
  1. Query the graph for symbols, relationships, and processes
  2. Call LLM with structured context
  3. Generate documentation (purpose, components, flows)
  4. Save markdown to modules/{module}.md
Concurrency: Multiple modules are processed in parallel (default: 3).

Phase 3: Architecture Overview (90-100%)

Generates high-level architecture documentation by synthesizing module relationships.

Phase 4: HTML Viewer Generation

Compiles all markdown files into a single-file HTML viewer with:
  • Sidebar navigation
  • Full-text search
  • Syntax highlighting
  • Responsive design

LLM Configuration

Providers

Default Model

minimax/minimax-m2.5 via OpenRouter — fast, cheap, and high-quality for documentation generation.

Cost Estimates

Costs are approximate. OpenRouter’s minimax/minimax-m2.5 is optimized for cost.

GitHub Gist Publishing

The --gist flag publishes the HTML viewer to a public GitHub Gist.

Requirements

  1. GitHub CLI (gh) installed: https://cli.github.com
  2. Authenticated: gh auth login

Automatic Publishing

If --gist is omitted, you’ll be prompted after generation:

Output

Share the Viewer URL for instant access (no GitHub login required).

Caching and Incremental Updates

Wiki generation tracks the last indexed commit. If the repository hasn’t changed:
Use --force to regenerate:

Troubleshooting

”No GitNexus index found”

Run gitnexus analyze first:

“No LLM API key found”

Provide an API key:
Or set an environment variable:

LLM API Error (401 Unauthorized)

Your API key is invalid. Reconfigure:

Failed Modules

Solution:

Gist Publishing Fails

Ensure GitHub CLI is authenticated:

Performance

Increase concurrency for faster generation:
Higher concurrency = higher LLM costs and rate limit risk.

See Also