
GitNexus CLI
FreeEfficiently manage and analyze your Git repositories.
Free · Opens the source repo
What GitNexus CLI does
GitNexus CLI is a command-line tool designed for developers who need to analyze and manage their Git repositories effectively. It allows users to run commands for indexing, checking the status of repositories, cleaning indexes, generating documentation, and listing indexed repositories without requiring a global installation. The tool operates seamlessly across various package managers, ensuring that it can be utilized in diverse environments, including those that only support Bun as a package manager.
The core functionality of GitNexus CLI revolves around its indexing capabilities. By using the analyze command, users can build or refresh the index of their codebase, creating a knowledge graph that enhances code exploration and understanding. This command can be customized with flags to force a re-index, enable embedding generation for semantic search, or build program-dependence layers for advanced analysis. The status command provides insights into the freshness of the index, helping users determine when re-indexing is necessary.
In addition to indexing, GitNexus CLI offers the ability to generate documentation through the wiki command, which utilizes a language model to create comprehensive documentation from the knowledge graph. This feature is particularly useful for teams looking to maintain up-to-date documentation that reflects the current state of their codebase. Users can also clean the index or list all indexed repositories with simple commands, streamlining repository management.
GitNexus CLI is ideal for developers and teams working with multiple repositories who require a robust tool for code analysis and documentation generation. Its ability to function without a global install makes it accessible for various development environments, enhancing productivity and collaboration.
When to use it
Use GitNexus CLI when you need to analyze a codebase, check the freshness of an index, or generate documentation for your repositories.
When not to use it
This tool is not suitable for users who do not work with Git repositories or those who prefer GUI-based tools for repository management.
What you can build with it
Initial Project Setup
Run `gitnexus analyze` to create the initial index for your new project.
Documentation Generation
Use the `wiki` command to generate up-to-date documentation from your codebase.
Index Management
Check the freshness of your index with the `status` command before making significant changes.
How to install GitNexus CLI
View source1. Install with the skills CLI
npx skills add abhigyanpatwari/gitnexus/gitnexus-cli --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by abhigyanpatwariGitNexus CLI Commands
Commands below use node .gitnexus/run.cjs <command> — the project-local runner gitnexus analyze drops next to the index. It auto-selects an available runner at call time (global gitnexus, else pnpm dlx, else bunx, else npx), so no package-manager assumption and no global install is required — including on a bun-only machine, which has no npm, npx or pnpm at all.
Not analyzed yet, or
node .gitnexus/run.cjsreportsCannot find module(the gitignored runner is absent — e.g. a fresh clone orgit clean)? (Re)generate it withnpx gitnexus analyzefrom the project root, orbunx gitnexus@latest analyzeon a bun-only machine. On npm 11.x, ifnpxcrashes during install (node.target is null), install once withnpm i -g gitnexus(thengitnexus analyze), or usebunx gitnexus@latest analyze, orpnpm --allow-build=@ladybugdb/core --allow-build=gitnexus --allow-build=tree-sitter dlx gitnexus@latest analyze. See #1939.
Commands
analyze — Build or refresh the index
node .gitnexus/run.cjs analyze
Run from the project root. This parses all source files, builds the knowledge graph, writes it to .gitnexus/, and generates CLAUDE.md / AGENTS.md context files.
| Flag | Effect |
|---|---|
--force | Force full re-index even if up to date |
--embeddings | Enable embedding generation for semantic search (off by default) |
--drop-embeddings | Drop existing embeddings on rebuild. By default, an analyze without --embeddings preserves them. |
--pdg | Build the program-dependence layers used by explain and pdg_query (taint, CDG, and REACHING_DEF). |
When to run: First time in a project, after major code changes, or when gitnexus://repo/{name}/context reports the index is stale.
status — Check index freshness
node .gitnexus/run.cjs status
Shows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.
clean — Delete the index
node .gitnexus/run.cjs clean
Deletes the .gitnexus/ directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project.
| Flag | Effect |
|---|---|
--force | Skip confirmation prompt |
--all | Clean all indexed repos, not just the current one |
wiki — Generate documentation from the graph
node .gitnexus/run.cjs wiki
Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to ~/.gitnexus/config.json on first use).
| Flag | Effect |
|---|---|
--force | Force full regeneration, also required to re-gerenate an existing wiki in a different language |
--model <model> | LLM model (default: minimax/minimax-m2.5) |
--base-url <url> | LLM API base URL |
--api-key <key> | LLM API key |
--concurrency <n> | Parallel LLM calls (default: 3) |
--gist | Publish wiki as a public GitHub Gist |
--timeout <seconds> | LLM request timeout in seconds (default: disabled) |
--retries <n> | Max LLM retry attempts per request (default: 3) |
--lang <lang> | Output language for generated documentation (e.g. english, chinese, spanish, japanese) |
list — Show all indexed repos
node .gitnexus/run.cjs list
Lists all repositories registered in ~/.gitnexus/registry.json. The MCP list_repos tool provides the same information.
After Indexing
- Read
gitnexus://repo/{name}/contextto verify the index loaded - Use the other GitNexus skills (
exploring,debugging,impact-analysis,refactoring) for your task
Troubleshooting
- "Not inside a git repository": Run from a directory inside a git repo
- Index is stale after re-analyzing: Restart Claude Code to reload the MCP server
- Embeddings slow: Omit
--embeddings(it's off by default) or setOPENAI_API_KEYfor faster API-based embedding
Frequently asked questions about GitNexus CLI
Similar skills
Markdown to HTML Conversion
Efficiently convert Markdown documents to HTML.
Code Tour
Create structured walkthroughs for codebases.
Acquire Codebase Knowledge
Streamline onboarding with comprehensive codebase documentation.
Documentation & Modernization
Streamline codebase documentation and modernization planning.
Azure Resource Visualizer
Generate architecture diagrams for Azure resources.
CLAUDE.md Improver
Optimize your CLAUDE.md files for better project context.
