Skip to main content

Syntax

Description

Generates LLM-powered repository documentation from the knowledge graph. The wiki is built by analyzing clusters (functional communities) and using an LLM to describe each module’s purpose, architecture, and key components. The wiki includes:
  • Architecture overview — High-level structure and design patterns
  • Module documentation — Each functional cluster gets a dedicated page
  • Component diagrams — Auto-generated from the knowledge graph
  • Interactive viewer — Single-file HTML with search and navigation

Options

string
Path to the repository. Defaults to current directory’s git root.
boolean
Force full regeneration even if the wiki is up to date with the current index.
string
LLM model name.Default: minimax/minimax-m2.5 (via OpenRouter)Examples:
  • gpt-4o-mini (OpenAI)
  • claude-3-5-sonnet-20241022 (OpenRouter)
  • llama-3.1-70b-instruct (custom endpoint)
string
LLM API base URL.Default: https://openrouter.ai/api/v1Examples:
  • https://api.openai.com/v1 (OpenAI)
  • http://localhost:11434/v1 (Ollama)
string
LLM API key. Saved to ~/.gitnexus/config.json for future use.Can also be set via environment variables:
  • GITNEXUS_API_KEY
  • OPENAI_API_KEY
string
Number of parallel LLM calls.Default: 3
boolean
Publish wiki as a public GitHub Gist after generation.Requires GitHub CLI (gh) installed and authenticated.

Usage Examples

Generate wiki (interactive setup)

First-time usage prompts for LLM configuration:

Use OpenAI

Use custom model

Force regeneration

Publish to GitHub Gist

High concurrency for faster generation

Output Example

Interactive Setup

If no LLM configuration is found and you’re in an interactive terminal, the command walks you through setup:
  1. Provider selection — OpenAI, OpenRouter, or custom endpoint
  2. Model selection — With smart defaults per provider
  3. API key — Optionally reuses existing env vars
  4. Save to config — Stored in ~/.gitnexus/config.json
After setup, future runs skip the prompts.

GitHub Gist Publishing

The --gist flag (or interactive prompt) publishes the wiki as a public GitHub Gist:
Requirements:
  • GitHub CLI installed
  • Authenticated with gh auth login
Output:
The viewer URL uses githack.com to serve the HTML with proper content-type headers.

Wiki Structure

Generated wiki:
The viewer (index.html) is a self-contained single-file app with:
  • Sidebar navigation
  • Full-text search
  • Markdown rendering
  • Syntax highlighting

When Wiki is Up-to-Date

The wiki generator tracks the last indexed commit. If the index hasn’t changed since the last wiki generation, it skips regeneration:
Use --force to regenerate anyway.

Failed Modules

If some modules fail to generate (e.g., LLM errors, rate limits), the command reports them:
Failed modules are automatically retried on the next run.

LLM Cost Estimate

For a typical repository with 20-30 modules:
  • OpenAI (gpt-4o-mini): ~0.500.50-1.00
  • OpenRouter (minimax/minimax-m2.5): ~0.100.10-0.30
  • Ollama (local): Free

Performance

Generation time depends on:
  • Number of modules (clusters)
  • LLM speed
  • Concurrency setting
Typical times:
  • Small repo (5-10 modules): 10-20 seconds
  • Medium repo (20-30 modules): 30-60 seconds
  • Large repo (50+ modules): 2-5 minutes
Increase concurrency for faster generation: