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
Path to the repository. Defaults to current directory’s git root.
Force full regeneration even if the wiki is up to date with the current index.
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)
LLM API base URL.Default:
https://openrouter.ai/api/v1Examples:https://api.openai.com/v1(OpenAI)http://localhost:11434/v1(Ollama)
LLM API key. Saved to
~/.gitnexus/config.json for future use.Can also be set via environment variables:GITNEXUS_API_KEYOPENAI_API_KEY
Number of parallel LLM calls.Default:
3Publish wiki as a public GitHub Gist after generation.Requires GitHub CLI (
gh) installed and authenticated.Usage Examples
Generate wiki (interactive setup)
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:- Provider selection — OpenAI, OpenRouter, or custom endpoint
- Model selection — With smart defaults per provider
- API key — Optionally reuses existing env vars
- Save to config — Stored in
~/.gitnexus/config.json
GitHub Gist Publishing
The--gist flag (or interactive prompt) publishes the wiki as a public GitHub Gist:
- GitHub CLI installed
- Authenticated with
gh auth login
Wiki Structure
Generated wiki: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:--force to regenerate anyway.
Failed Modules
If some modules fail to generate (e.g., LLM errors, rate limits), the command reports them:LLM Cost Estimate
For a typical repository with 20-30 modules:- OpenAI (gpt-4o-mini): ~1.00
- OpenRouter (minimax/minimax-m2.5): ~0.30
- Ollama (local): Free
Performance
Generation time depends on:- Number of modules (clusters)
- LLM speed
- Concurrency setting
- Small repo (5-10 modules): 10-20 seconds
- Medium repo (20-30 modules): 30-60 seconds
- Large repo (50+ modules): 2-5 minutes
Related Commands
gitnexus analyze— Index repository firstgitnexus status— Check index status