Skip to main content
GitNexus provides a powerful command-line interface for indexing repositories, managing the knowledge graph, and serving data to AI tools.

Quick Start

# Index your repository
npx gitnexus analyze

# Configure MCP for your editor (one-time)
npx gitnexus setup

# Start the local server for web UI
npx gitnexus serve

Available Commands

Core Commands

CommandDescription
analyze [path]Index a repository into the knowledge graph
setupConfigure MCP integration for supported editors
serveStart local HTTP server for web UI connection
cleanDelete GitNexus index for current or all repos
wiki [path]Generate LLM-powered documentation from the knowledge graph

Repository Management

CommandDescription
listList all indexed repositories
statusShow index status for current repository

MCP Server

CommandDescription
mcpStart MCP server (stdio) — serves all indexed repos

Direct Tool Access

These commands bypass MCP overhead and invoke the knowledge graph directly:
CommandDescription
query <search>Search for execution flows related to a concept
context [name]Get 360-degree view of a code symbol
impact <target>Blast radius analysis for a symbol
cypher <query>Execute raw Cypher queries against the graph

Advanced Commands

CommandDescription
augment <pattern>Augment search patterns with graph context (used by hooks)
eval-serverStart HTTP server for benchmark evaluation

Global vs Repository-Specific

Global Commands

These commands work from any directory:
  • setup — Configures MCP globally for all projects
  • list — Shows all indexed repositories
  • serve — Serves all indexed repositories
  • mcp — Serves all indexed repositories via MCP

Repository-Specific Commands

These commands must be run from within a git repository:
  • analyze — Indexes the current repository
  • status — Shows index status for current repository
  • clean — Removes index for current repository
  • wiki — Generates documentation for current repository
  • query, context, impact, cypher — Query the knowledge graph

Storage Architecture

Local Repository Storage (.gitnexus/)

Each indexed repository gets a .gitnexus/ directory at its root:
my-repo/
├── .gitnexus/
│   ├── db/              # KuzuDB graph database
│   ├── wiki/            # Generated documentation (if using wiki command)
│   └── meta.json        # Index metadata (commit hash, stats, timestamp)
├── AGENTS.md            # Agent context file (auto-generated)
└── CLAUDE.md            # Claude Code context file (auto-generated)
The .gitnexus/ directory is automatically added to .gitignore.

Global Registry (~/.gitnexus/)

GitNexus maintains a global registry of all indexed repositories:
~/.gitnexus/
├── registry.json        # Paths to all indexed repositories
├── config.json          # CLI configuration (LLM API keys, etc.)
└── skills/              # Global agent skills (if using setup command)
Purpose:
  • MCP server discovers and serves all indexed repos automatically
  • Multi-repo workflows without re-indexing
  • Centralized configuration for LLM providers

Command Options

Most commands support:
  • -h, --help — Show help for the command
  • -V, --version — Show GitNexus version

Memory Management

GitNexus automatically allocates up to 8GB of heap memory for large repositories (e.g., Linux kernel). If you need to customize this:
NODE_OPTIONS="--max-old-space-size=16384" npx gitnexus analyze

Next Steps

Index Repository

Learn how to index your first repository

Setup Editors

Configure MCP for your AI editor

Generate Wiki

Create LLM-powered documentation

Start Server

Run the local HTTP server

Build docs developers (and LLMs) love