gitnexus 1.4.1 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +215 -194
- package/dist/cli/ai-context.d.ts +2 -1
- package/dist/cli/ai-context.js +117 -90
- package/dist/cli/analyze.d.ts +2 -0
- package/dist/cli/analyze.js +57 -30
- package/dist/cli/augment.js +1 -1
- package/dist/cli/eval-server.d.ts +1 -1
- package/dist/cli/eval-server.js +1 -1
- package/dist/cli/index.js +18 -25
- package/dist/cli/lazy-action.d.ts +6 -0
- package/dist/cli/lazy-action.js +18 -0
- package/dist/cli/mcp.js +1 -1
- package/dist/cli/setup.js +42 -32
- package/dist/cli/skill-gen.d.ts +26 -0
- package/dist/cli/skill-gen.js +549 -0
- package/dist/cli/status.js +13 -4
- package/dist/cli/tool.d.ts +1 -1
- package/dist/cli/tool.js +2 -2
- package/dist/cli/wiki.js +2 -2
- package/dist/config/ignore-service.d.ts +25 -0
- package/dist/config/ignore-service.js +76 -0
- package/dist/config/supported-languages.d.ts +1 -0
- package/dist/config/supported-languages.js +1 -1
- package/dist/core/augmentation/engine.js +99 -72
- package/dist/core/embeddings/embedder.d.ts +1 -1
- package/dist/core/embeddings/embedder.js +1 -1
- package/dist/core/embeddings/embedding-pipeline.d.ts +3 -3
- package/dist/core/embeddings/embedding-pipeline.js +74 -47
- package/dist/core/embeddings/types.d.ts +1 -1
- package/dist/core/graph/types.d.ts +5 -2
- package/dist/core/ingestion/ast-cache.js +3 -2
- package/dist/core/ingestion/call-processor.d.ts +6 -7
- package/dist/core/ingestion/call-processor.js +560 -282
- package/dist/core/ingestion/call-routing.d.ts +53 -0
- package/dist/core/ingestion/call-routing.js +108 -0
- package/dist/core/ingestion/cluster-enricher.js +16 -16
- package/dist/core/ingestion/constants.d.ts +16 -0
- package/dist/core/ingestion/constants.js +16 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +2 -1
- package/dist/core/ingestion/entry-point-scoring.js +94 -24
- package/dist/core/ingestion/export-detection.d.ts +18 -0
- package/dist/core/ingestion/export-detection.js +231 -0
- package/dist/core/ingestion/filesystem-walker.js +4 -3
- package/dist/core/ingestion/framework-detection.d.ts +5 -1
- package/dist/core/ingestion/framework-detection.js +48 -8
- package/dist/core/ingestion/heritage-processor.d.ts +13 -5
- package/dist/core/ingestion/heritage-processor.js +109 -55
- package/dist/core/ingestion/import-processor.d.ts +16 -20
- package/dist/core/ingestion/import-processor.js +202 -696
- package/dist/core/ingestion/language-config.d.ts +46 -0
- package/dist/core/ingestion/language-config.js +167 -0
- package/dist/core/ingestion/mro-processor.d.ts +45 -0
- package/dist/core/ingestion/mro-processor.js +369 -0
- package/dist/core/ingestion/named-binding-extraction.d.ts +61 -0
- package/dist/core/ingestion/named-binding-extraction.js +363 -0
- package/dist/core/ingestion/parsing-processor.d.ts +3 -11
- package/dist/core/ingestion/parsing-processor.js +82 -181
- package/dist/core/ingestion/pipeline.d.ts +5 -1
- package/dist/core/ingestion/pipeline.js +192 -116
- package/dist/core/ingestion/process-processor.js +2 -1
- package/dist/core/ingestion/resolution-context.d.ts +53 -0
- package/dist/core/ingestion/resolution-context.js +132 -0
- package/dist/core/ingestion/resolvers/csharp.d.ts +22 -0
- package/dist/core/ingestion/resolvers/csharp.js +109 -0
- package/dist/core/ingestion/resolvers/go.d.ts +19 -0
- package/dist/core/ingestion/resolvers/go.js +42 -0
- package/dist/core/ingestion/resolvers/index.d.ts +18 -0
- package/dist/core/ingestion/resolvers/index.js +13 -0
- package/dist/core/ingestion/resolvers/jvm.d.ts +23 -0
- package/dist/core/ingestion/resolvers/jvm.js +87 -0
- package/dist/core/ingestion/resolvers/php.d.ts +15 -0
- package/dist/core/ingestion/resolvers/php.js +35 -0
- package/dist/core/ingestion/resolvers/python.d.ts +19 -0
- package/dist/core/ingestion/resolvers/python.js +52 -0
- package/dist/core/ingestion/resolvers/ruby.d.ts +12 -0
- package/dist/core/ingestion/resolvers/ruby.js +15 -0
- package/dist/core/ingestion/resolvers/rust.d.ts +15 -0
- package/dist/core/ingestion/resolvers/rust.js +73 -0
- package/dist/core/ingestion/resolvers/standard.d.ts +28 -0
- package/dist/core/ingestion/resolvers/standard.js +123 -0
- package/dist/core/ingestion/resolvers/utils.d.ts +33 -0
- package/dist/core/ingestion/resolvers/utils.js +122 -0
- package/dist/core/ingestion/symbol-table.d.ts +15 -1
- package/dist/core/ingestion/symbol-table.js +20 -12
- package/dist/core/ingestion/tree-sitter-queries.d.ts +12 -11
- package/dist/core/ingestion/tree-sitter-queries.js +642 -485
- package/dist/core/ingestion/type-env.d.ts +49 -0
- package/dist/core/ingestion/type-env.js +559 -0
- package/dist/core/ingestion/type-extractors/c-cpp.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/c-cpp.js +385 -0
- package/dist/core/ingestion/type-extractors/csharp.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/csharp.js +369 -0
- package/dist/core/ingestion/type-extractors/go.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/go.js +436 -0
- package/dist/core/ingestion/type-extractors/index.d.ts +22 -0
- package/dist/core/ingestion/type-extractors/index.js +31 -0
- package/dist/core/ingestion/type-extractors/jvm.d.ts +3 -0
- package/dist/core/ingestion/type-extractors/jvm.js +654 -0
- package/dist/core/ingestion/type-extractors/php.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/php.js +411 -0
- package/dist/core/ingestion/type-extractors/python.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/python.js +392 -0
- package/dist/core/ingestion/type-extractors/ruby.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/ruby.js +389 -0
- package/dist/core/ingestion/type-extractors/rust.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/rust.js +436 -0
- package/dist/core/ingestion/type-extractors/shared.d.ts +132 -0
- package/dist/core/ingestion/type-extractors/shared.js +571 -0
- package/dist/core/ingestion/type-extractors/swift.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/swift.js +137 -0
- package/dist/core/ingestion/type-extractors/types.d.ts +95 -0
- package/dist/core/ingestion/type-extractors/types.js +1 -0
- package/dist/core/ingestion/type-extractors/typescript.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/typescript.js +480 -0
- package/dist/core/ingestion/utils.d.ts +98 -0
- package/dist/core/ingestion/utils.js +1064 -9
- package/dist/core/ingestion/workers/parse-worker.d.ts +38 -4
- package/dist/core/ingestion/workers/parse-worker.js +248 -359
- package/dist/core/ingestion/workers/worker-pool.js +8 -0
- package/dist/core/{kuzu → lbug}/csv-generator.d.ts +1 -1
- package/dist/core/{kuzu → lbug}/csv-generator.js +20 -4
- package/dist/core/{kuzu/kuzu-adapter.d.ts → lbug/lbug-adapter.d.ts} +19 -19
- package/dist/core/{kuzu/kuzu-adapter.js → lbug/lbug-adapter.js} +82 -82
- package/dist/core/{kuzu → lbug}/schema.d.ts +4 -4
- package/dist/core/{kuzu → lbug}/schema.js +304 -289
- package/dist/core/search/bm25-index.d.ts +4 -4
- package/dist/core/search/bm25-index.js +17 -16
- package/dist/core/search/hybrid-search.d.ts +2 -2
- package/dist/core/search/hybrid-search.js +9 -9
- package/dist/core/tree-sitter/parser-loader.js +9 -2
- package/dist/core/wiki/generator.d.ts +4 -52
- package/dist/core/wiki/generator.js +53 -552
- package/dist/core/wiki/graph-queries.d.ts +4 -46
- package/dist/core/wiki/graph-queries.js +103 -282
- package/dist/core/wiki/html-viewer.js +192 -192
- package/dist/core/wiki/llm-client.js +11 -73
- package/dist/core/wiki/prompts.d.ts +8 -52
- package/dist/core/wiki/prompts.js +86 -200
- package/dist/mcp/compatible-stdio-transport.d.ts +25 -0
- package/dist/mcp/compatible-stdio-transport.js +200 -0
- package/dist/mcp/core/{kuzu-adapter.d.ts → lbug-adapter.d.ts} +7 -9
- package/dist/mcp/core/{kuzu-adapter.js → lbug-adapter.js} +77 -79
- package/dist/mcp/local/local-backend.d.ts +6 -6
- package/dist/mcp/local/local-backend.js +153 -146
- package/dist/mcp/resources.js +42 -42
- package/dist/mcp/server.js +18 -19
- package/dist/mcp/tools.js +103 -104
- package/dist/server/api.js +12 -12
- package/dist/server/mcp-http.d.ts +1 -1
- package/dist/server/mcp-http.js +1 -1
- package/dist/storage/repo-manager.d.ts +20 -2
- package/dist/storage/repo-manager.js +55 -1
- package/dist/types/pipeline.d.ts +1 -1
- package/hooks/claude/gitnexus-hook.cjs +238 -155
- package/hooks/claude/pre-tool-use.sh +79 -79
- package/hooks/claude/session-start.sh +42 -42
- package/package.json +98 -96
- package/scripts/patch-tree-sitter-swift.cjs +74 -74
- package/skills/gitnexus-cli.md +82 -82
- package/skills/gitnexus-debugging.md +89 -89
- package/skills/gitnexus-exploring.md +78 -78
- package/skills/gitnexus-guide.md +64 -64
- package/skills/gitnexus-impact-analysis.md +97 -97
- package/skills/gitnexus-pr-review.md +163 -163
- package/skills/gitnexus-refactoring.md +121 -121
- package/vendor/leiden/index.cjs +355 -355
- package/vendor/leiden/utils.cjs +392 -392
- package/dist/core/wiki/diagrams.d.ts +0 -27
- package/dist/core/wiki/diagrams.js +0 -163
package/README.md
CHANGED
|
@@ -1,194 +1,215 @@
|
|
|
1
|
-
# GitNexus
|
|
2
|
-
|
|
3
|
-
**Graph-powered code intelligence for AI agents.** Index any codebase into a knowledge graph, then query it via MCP or CLI.
|
|
4
|
-
|
|
5
|
-
Works with **Cursor**, **Claude Code**, **Windsurf**, **Cline**, **OpenCode**, and any MCP-compatible tool.
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/gitnexus)
|
|
8
|
-
[](https://polyformproject.org/licenses/noncommercial/1.0.0/)
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## Why?
|
|
13
|
-
|
|
14
|
-
AI coding tools don't understand your codebase structure. They edit a function without knowing 47 other functions depend on it. GitNexus fixes this by **precomputing every dependency, call chain, and relationship** into a queryable graph.
|
|
15
|
-
|
|
16
|
-
**Three commands to give your AI agent full codebase awareness.**
|
|
17
|
-
|
|
18
|
-
## Quick Start
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
# Index your repo (run from repo root)
|
|
22
|
-
npx gitnexus analyze
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
That's it. This indexes the codebase, installs agent skills, registers Claude Code hooks, and creates `AGENTS.md` / `CLAUDE.md` context files — all in one command.
|
|
26
|
-
|
|
27
|
-
To configure MCP for your editor, run `npx gitnexus setup` once — or set it up manually below.
|
|
28
|
-
|
|
29
|
-
`gitnexus setup` auto-detects your editors and writes the correct global MCP config. You only need to run it once.
|
|
30
|
-
|
|
31
|
-
### Editor Support
|
|
32
|
-
|
|
33
|
-
| Editor | MCP | Skills | Hooks (auto-augment) | Support |
|
|
34
|
-
|--------|-----|--------|---------------------|---------|
|
|
35
|
-
| **Claude Code** | Yes | Yes | Yes (PreToolUse) | **Full** |
|
|
36
|
-
| **Cursor** | Yes | Yes | — | MCP + Skills |
|
|
37
|
-
| **Windsurf** | Yes | — | — | MCP |
|
|
38
|
-
| **OpenCode** | Yes | Yes | — | MCP + Skills |
|
|
39
|
-
|
|
40
|
-
> **Claude Code** gets the deepest integration: MCP tools + agent skills + PreToolUse hooks that automatically enrich grep/glob/bash calls with knowledge graph context.
|
|
41
|
-
|
|
42
|
-
### Community Integrations
|
|
43
|
-
|
|
44
|
-
| Agent | Install | Source |
|
|
45
|
-
|-------|---------|--------|
|
|
46
|
-
| [pi](https://pi.dev) | `pi install npm:pi-gitnexus` | [pi-gitnexus](https://github.com/tintinweb/pi-gitnexus) |
|
|
47
|
-
|
|
48
|
-
## MCP Setup (manual)
|
|
49
|
-
|
|
50
|
-
If you prefer to configure manually instead of using `gitnexus setup`:
|
|
51
|
-
|
|
52
|
-
### Claude Code (full support — MCP + skills + hooks)
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
claude mcp add gitnexus -- npx -y gitnexus@latest mcp
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Cursor / Windsurf
|
|
59
|
-
|
|
60
|
-
Add to `~/.cursor/mcp.json` (global — works for all projects):
|
|
61
|
-
|
|
62
|
-
```json
|
|
63
|
-
{
|
|
64
|
-
"mcpServers": {
|
|
65
|
-
"gitnexus": {
|
|
66
|
-
"command": "npx",
|
|
67
|
-
"args": ["-y", "gitnexus@latest", "mcp"]
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### OpenCode
|
|
74
|
-
|
|
75
|
-
Add to `~/.config/opencode/config.json`:
|
|
76
|
-
|
|
77
|
-
```json
|
|
78
|
-
{
|
|
79
|
-
"mcp": {
|
|
80
|
-
"gitnexus": {
|
|
81
|
-
"command": "npx",
|
|
82
|
-
"args": ["-y", "gitnexus@latest", "mcp"]
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## How It Works
|
|
89
|
-
|
|
90
|
-
GitNexus builds a complete knowledge graph of your codebase through a multi-phase indexing pipeline:
|
|
91
|
-
|
|
92
|
-
1. **Structure** — Walks the file tree and maps folder/file relationships
|
|
93
|
-
2. **Parsing** — Extracts functions, classes, methods, and interfaces using Tree-sitter ASTs
|
|
94
|
-
3. **Resolution** — Resolves imports and function calls across files with language-aware logic
|
|
95
|
-
4. **Clustering** — Groups related symbols into functional communities
|
|
96
|
-
5. **Processes** — Traces execution flows from entry points through call chains
|
|
97
|
-
6. **Search** — Builds hybrid search indexes for fast retrieval
|
|
98
|
-
|
|
99
|
-
The result is a **
|
|
100
|
-
|
|
101
|
-
## MCP Tools
|
|
102
|
-
|
|
103
|
-
Your AI agent gets these tools automatically:
|
|
104
|
-
|
|
105
|
-
| Tool | What It Does | `repo` Param |
|
|
106
|
-
|------|-------------|--------------|
|
|
107
|
-
| `list_repos` | Discover all indexed repositories | — |
|
|
108
|
-
| `query` | Process-grouped hybrid search (BM25 + semantic + RRF) | Optional |
|
|
109
|
-
| `context` | 360-degree symbol view — categorized refs, process participation | Optional |
|
|
110
|
-
| `impact` | Blast radius analysis with depth grouping and confidence | Optional |
|
|
111
|
-
| `detect_changes` | Git-diff impact — maps changed lines to affected processes | Optional |
|
|
112
|
-
| `rename` | Multi-file coordinated rename with graph + text search | Optional |
|
|
113
|
-
| `cypher` | Raw Cypher graph queries | Optional |
|
|
114
|
-
|
|
115
|
-
> With one indexed repo, the `repo` param is optional. With multiple, specify which: `query({query: "auth", repo: "my-app"})`.
|
|
116
|
-
|
|
117
|
-
## MCP Resources
|
|
118
|
-
|
|
119
|
-
| Resource | Purpose |
|
|
120
|
-
|----------|---------|
|
|
121
|
-
| `gitnexus://repos` | List all indexed repositories (read first) |
|
|
122
|
-
| `gitnexus://repo/{name}/context` | Codebase stats, staleness check, and available tools |
|
|
123
|
-
| `gitnexus://repo/{name}/clusters` | All functional clusters with cohesion scores |
|
|
124
|
-
| `gitnexus://repo/{name}/cluster/{name}` | Cluster members and details |
|
|
125
|
-
| `gitnexus://repo/{name}/processes` | All execution flows |
|
|
126
|
-
| `gitnexus://repo/{name}/process/{name}` | Full process trace with steps |
|
|
127
|
-
| `gitnexus://repo/{name}/schema` | Graph schema for Cypher queries |
|
|
128
|
-
|
|
129
|
-
## MCP Prompts
|
|
130
|
-
|
|
131
|
-
| Prompt | What It Does |
|
|
132
|
-
|--------|-------------|
|
|
133
|
-
| `detect_impact` | Pre-commit change analysis — scope, affected processes, risk level |
|
|
134
|
-
| `generate_map` | Architecture documentation from the knowledge graph with mermaid diagrams |
|
|
135
|
-
|
|
136
|
-
## CLI Commands
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
gitnexus setup # Configure MCP for your editors (one-time)
|
|
140
|
-
gitnexus analyze [path] # Index a repository (or update stale index)
|
|
141
|
-
gitnexus analyze --force # Force full re-index
|
|
142
|
-
gitnexus analyze --
|
|
143
|
-
gitnexus
|
|
144
|
-
gitnexus
|
|
145
|
-
gitnexus
|
|
146
|
-
gitnexus
|
|
147
|
-
gitnexus
|
|
148
|
-
gitnexus clean
|
|
149
|
-
gitnexus
|
|
150
|
-
gitnexus wiki
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
**
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
1
|
+
# GitNexus
|
|
2
|
+
|
|
3
|
+
**Graph-powered code intelligence for AI agents.** Index any codebase into a knowledge graph, then query it via MCP or CLI.
|
|
4
|
+
|
|
5
|
+
Works with **Cursor**, **Claude Code**, **Windsurf**, **Cline**, **OpenCode**, and any MCP-compatible tool.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/gitnexus)
|
|
8
|
+
[](https://polyformproject.org/licenses/noncommercial/1.0.0/)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Why?
|
|
13
|
+
|
|
14
|
+
AI coding tools don't understand your codebase structure. They edit a function without knowing 47 other functions depend on it. GitNexus fixes this by **precomputing every dependency, call chain, and relationship** into a queryable graph.
|
|
15
|
+
|
|
16
|
+
**Three commands to give your AI agent full codebase awareness.**
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Index your repo (run from repo root)
|
|
22
|
+
npx gitnexus analyze
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
That's it. This indexes the codebase, installs agent skills, registers Claude Code hooks, and creates `AGENTS.md` / `CLAUDE.md` context files — all in one command.
|
|
26
|
+
|
|
27
|
+
To configure MCP for your editor, run `npx gitnexus setup` once — or set it up manually below.
|
|
28
|
+
|
|
29
|
+
`gitnexus setup` auto-detects your editors and writes the correct global MCP config. You only need to run it once.
|
|
30
|
+
|
|
31
|
+
### Editor Support
|
|
32
|
+
|
|
33
|
+
| Editor | MCP | Skills | Hooks (auto-augment) | Support |
|
|
34
|
+
|--------|-----|--------|---------------------|---------|
|
|
35
|
+
| **Claude Code** | Yes | Yes | Yes (PreToolUse) | **Full** |
|
|
36
|
+
| **Cursor** | Yes | Yes | — | MCP + Skills |
|
|
37
|
+
| **Windsurf** | Yes | — | — | MCP |
|
|
38
|
+
| **OpenCode** | Yes | Yes | — | MCP + Skills |
|
|
39
|
+
|
|
40
|
+
> **Claude Code** gets the deepest integration: MCP tools + agent skills + PreToolUse hooks that automatically enrich grep/glob/bash calls with knowledge graph context.
|
|
41
|
+
|
|
42
|
+
### Community Integrations
|
|
43
|
+
|
|
44
|
+
| Agent | Install | Source |
|
|
45
|
+
|-------|---------|--------|
|
|
46
|
+
| [pi](https://pi.dev) | `pi install npm:pi-gitnexus` | [pi-gitnexus](https://github.com/tintinweb/pi-gitnexus) |
|
|
47
|
+
|
|
48
|
+
## MCP Setup (manual)
|
|
49
|
+
|
|
50
|
+
If you prefer to configure manually instead of using `gitnexus setup`:
|
|
51
|
+
|
|
52
|
+
### Claude Code (full support — MCP + skills + hooks)
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
claude mcp add gitnexus -- npx -y gitnexus@latest mcp
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Cursor / Windsurf
|
|
59
|
+
|
|
60
|
+
Add to `~/.cursor/mcp.json` (global — works for all projects):
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"gitnexus": {
|
|
66
|
+
"command": "npx",
|
|
67
|
+
"args": ["-y", "gitnexus@latest", "mcp"]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### OpenCode
|
|
74
|
+
|
|
75
|
+
Add to `~/.config/opencode/config.json`:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcp": {
|
|
80
|
+
"gitnexus": {
|
|
81
|
+
"command": "npx",
|
|
82
|
+
"args": ["-y", "gitnexus@latest", "mcp"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## How It Works
|
|
89
|
+
|
|
90
|
+
GitNexus builds a complete knowledge graph of your codebase through a multi-phase indexing pipeline:
|
|
91
|
+
|
|
92
|
+
1. **Structure** — Walks the file tree and maps folder/file relationships
|
|
93
|
+
2. **Parsing** — Extracts functions, classes, methods, and interfaces using Tree-sitter ASTs
|
|
94
|
+
3. **Resolution** — Resolves imports and function calls across files with language-aware logic
|
|
95
|
+
4. **Clustering** — Groups related symbols into functional communities
|
|
96
|
+
5. **Processes** — Traces execution flows from entry points through call chains
|
|
97
|
+
6. **Search** — Builds hybrid search indexes for fast retrieval
|
|
98
|
+
|
|
99
|
+
The result is a **LadybugDB graph database** stored locally in `.gitnexus/` with full-text search and semantic embeddings.
|
|
100
|
+
|
|
101
|
+
## MCP Tools
|
|
102
|
+
|
|
103
|
+
Your AI agent gets these tools automatically:
|
|
104
|
+
|
|
105
|
+
| Tool | What It Does | `repo` Param |
|
|
106
|
+
|------|-------------|--------------|
|
|
107
|
+
| `list_repos` | Discover all indexed repositories | — |
|
|
108
|
+
| `query` | Process-grouped hybrid search (BM25 + semantic + RRF) | Optional |
|
|
109
|
+
| `context` | 360-degree symbol view — categorized refs, process participation | Optional |
|
|
110
|
+
| `impact` | Blast radius analysis with depth grouping and confidence | Optional |
|
|
111
|
+
| `detect_changes` | Git-diff impact — maps changed lines to affected processes | Optional |
|
|
112
|
+
| `rename` | Multi-file coordinated rename with graph + text search | Optional |
|
|
113
|
+
| `cypher` | Raw Cypher graph queries | Optional |
|
|
114
|
+
|
|
115
|
+
> With one indexed repo, the `repo` param is optional. With multiple, specify which: `query({query: "auth", repo: "my-app"})`.
|
|
116
|
+
|
|
117
|
+
## MCP Resources
|
|
118
|
+
|
|
119
|
+
| Resource | Purpose |
|
|
120
|
+
|----------|---------|
|
|
121
|
+
| `gitnexus://repos` | List all indexed repositories (read first) |
|
|
122
|
+
| `gitnexus://repo/{name}/context` | Codebase stats, staleness check, and available tools |
|
|
123
|
+
| `gitnexus://repo/{name}/clusters` | All functional clusters with cohesion scores |
|
|
124
|
+
| `gitnexus://repo/{name}/cluster/{name}` | Cluster members and details |
|
|
125
|
+
| `gitnexus://repo/{name}/processes` | All execution flows |
|
|
126
|
+
| `gitnexus://repo/{name}/process/{name}` | Full process trace with steps |
|
|
127
|
+
| `gitnexus://repo/{name}/schema` | Graph schema for Cypher queries |
|
|
128
|
+
|
|
129
|
+
## MCP Prompts
|
|
130
|
+
|
|
131
|
+
| Prompt | What It Does |
|
|
132
|
+
|--------|-------------|
|
|
133
|
+
| `detect_impact` | Pre-commit change analysis — scope, affected processes, risk level |
|
|
134
|
+
| `generate_map` | Architecture documentation from the knowledge graph with mermaid diagrams |
|
|
135
|
+
|
|
136
|
+
## CLI Commands
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
gitnexus setup # Configure MCP for your editors (one-time)
|
|
140
|
+
gitnexus analyze [path] # Index a repository (or update stale index)
|
|
141
|
+
gitnexus analyze --force # Force full re-index
|
|
142
|
+
gitnexus analyze --embeddings # Enable embedding generation (slower, better search)
|
|
143
|
+
gitnexus analyze --verbose # Log skipped files when parsers are unavailable
|
|
144
|
+
gitnexus mcp # Start MCP server (stdio) — serves all indexed repos
|
|
145
|
+
gitnexus serve # Start local HTTP server (multi-repo) for web UI
|
|
146
|
+
gitnexus list # List all indexed repositories
|
|
147
|
+
gitnexus status # Show index status for current repo
|
|
148
|
+
gitnexus clean # Delete index for current repo
|
|
149
|
+
gitnexus clean --all --force # Delete all indexes
|
|
150
|
+
gitnexus wiki [path] # Generate LLM-powered docs from knowledge graph
|
|
151
|
+
gitnexus wiki --model <model> # Wiki with custom LLM model (default: gpt-4o-mini)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Multi-Repo Support
|
|
155
|
+
|
|
156
|
+
GitNexus supports indexing multiple repositories. Each `gitnexus analyze` registers the repo in a global registry (`~/.gitnexus/registry.json`). The MCP server serves all indexed repos automatically.
|
|
157
|
+
|
|
158
|
+
## Supported Languages
|
|
159
|
+
|
|
160
|
+
TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust, PHP, Kotlin, Swift, Ruby
|
|
161
|
+
|
|
162
|
+
### Language Feature Matrix
|
|
163
|
+
|
|
164
|
+
| Language | Imports | Named Bindings | Exports | Heritage | Type Annotations | Constructor Inference | Config | Frameworks | Entry Points |
|
|
165
|
+
|----------|---------|----------------|---------|----------|-----------------|---------------------|--------|------------|-------------|
|
|
166
|
+
| TypeScript | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
167
|
+
| JavaScript | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ |
|
|
168
|
+
| Python | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
169
|
+
| Java | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
|
|
170
|
+
| Kotlin | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
|
|
171
|
+
| C# | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
172
|
+
| Go | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
173
|
+
| Rust | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
|
|
174
|
+
| PHP | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
175
|
+
| Ruby | ✓ | — | ✓ | ✓ | — | ✓ | — | ✓ | ✓ |
|
|
176
|
+
| Swift | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
177
|
+
| C | — | — | ✓ | — | ✓ | ✓ | — | ✓ | ✓ |
|
|
178
|
+
| C++ | — | — | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
|
|
179
|
+
|
|
180
|
+
**Imports** — cross-file import resolution · **Named Bindings** — `import { X as Y }` / re-export tracking · **Exports** — public/exported symbol detection · **Heritage** — class inheritance, interfaces, mixins · **Type Annotations** — explicit type extraction for receiver resolution · **Constructor Inference** — infer receiver type from constructor calls (`self`/`this` resolution included for all languages) · **Config** — language toolchain config parsing (tsconfig, go.mod, etc.) · **Frameworks** — AST-based framework pattern detection · **Entry Points** — entry point scoring heuristics
|
|
181
|
+
|
|
182
|
+
## Agent Skills
|
|
183
|
+
|
|
184
|
+
GitNexus ships with skill files that teach AI agents how to use the tools effectively:
|
|
185
|
+
|
|
186
|
+
- **Exploring** — Navigate unfamiliar code using the knowledge graph
|
|
187
|
+
- **Debugging** — Trace bugs through call chains
|
|
188
|
+
- **Impact Analysis** — Analyze blast radius before changes
|
|
189
|
+
- **Refactoring** — Plan safe refactors using dependency mapping
|
|
190
|
+
|
|
191
|
+
Installed automatically by both `gitnexus analyze` (per-repo) and `gitnexus setup` (global).
|
|
192
|
+
|
|
193
|
+
## Requirements
|
|
194
|
+
|
|
195
|
+
- Node.js >= 18
|
|
196
|
+
- Git repository (uses git for commit tracking)
|
|
197
|
+
|
|
198
|
+
## Privacy
|
|
199
|
+
|
|
200
|
+
- All processing happens locally on your machine
|
|
201
|
+
- No code is sent to any server
|
|
202
|
+
- Index stored in `.gitnexus/` inside your repo (gitignored)
|
|
203
|
+
- Global registry at `~/.gitnexus/` stores only paths and metadata
|
|
204
|
+
|
|
205
|
+
## Web UI
|
|
206
|
+
|
|
207
|
+
GitNexus also has a browser-based UI at [gitnexus.vercel.app](https://gitnexus.vercel.app) — 100% client-side, your code never leaves the browser.
|
|
208
|
+
|
|
209
|
+
**Local Backend Mode:** Run `gitnexus serve` and open the web UI locally — it auto-detects the server and shows all your indexed repos, with full AI chat support. No need to re-upload or re-index. The agent's tools (Cypher queries, search, code navigation) route through the backend HTTP API automatically.
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
[PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/)
|
|
214
|
+
|
|
215
|
+
Free for non-commercial use. Contact for commercial licensing.
|
package/dist/cli/ai-context.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* AGENTS.md is the standard read by Cursor, Windsurf, OpenCode, Cline, etc.
|
|
6
6
|
* CLAUDE.md is for Claude Code which only reads that file.
|
|
7
7
|
*/
|
|
8
|
+
import { type GeneratedSkillInfo } from './skill-gen.js';
|
|
8
9
|
interface RepoStats {
|
|
9
10
|
files?: number;
|
|
10
11
|
nodes?: number;
|
|
@@ -16,7 +17,7 @@ interface RepoStats {
|
|
|
16
17
|
/**
|
|
17
18
|
* Generate AI context files after indexing
|
|
18
19
|
*/
|
|
19
|
-
export declare function generateAIContextFiles(repoPath: string, _storagePath: string, projectName: string, stats: RepoStats): Promise<{
|
|
20
|
+
export declare function generateAIContextFiles(repoPath: string, _storagePath: string, projectName: string, stats: RepoStats, generatedSkills?: GeneratedSkillInfo[]): Promise<{
|
|
20
21
|
files: string[];
|
|
21
22
|
}>;
|
|
22
23
|
export {};
|