gitnexus 1.4.0 → 1.4.1

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.
Files changed (131) hide show
  1. package/README.md +194 -214
  2. package/dist/cli/ai-context.d.ts +1 -2
  3. package/dist/cli/ai-context.js +90 -117
  4. package/dist/cli/analyze.d.ts +0 -2
  5. package/dist/cli/analyze.js +2 -20
  6. package/dist/cli/index.js +25 -17
  7. package/dist/cli/setup.js +19 -17
  8. package/dist/core/augmentation/engine.js +20 -20
  9. package/dist/core/embeddings/embedding-pipeline.js +26 -26
  10. package/dist/core/graph/types.d.ts +2 -5
  11. package/dist/core/ingestion/ast-cache.js +2 -3
  12. package/dist/core/ingestion/call-processor.d.ts +5 -5
  13. package/dist/core/ingestion/call-processor.js +258 -173
  14. package/dist/core/ingestion/cluster-enricher.js +16 -16
  15. package/dist/core/ingestion/entry-point-scoring.d.ts +1 -2
  16. package/dist/core/ingestion/entry-point-scoring.js +22 -81
  17. package/dist/core/ingestion/framework-detection.d.ts +1 -5
  18. package/dist/core/ingestion/framework-detection.js +8 -39
  19. package/dist/core/ingestion/heritage-processor.d.ts +4 -13
  20. package/dist/core/ingestion/heritage-processor.js +28 -92
  21. package/dist/core/ingestion/import-processor.d.ts +19 -17
  22. package/dist/core/ingestion/import-processor.js +695 -170
  23. package/dist/core/ingestion/parsing-processor.d.ts +10 -1
  24. package/dist/core/ingestion/parsing-processor.js +177 -41
  25. package/dist/core/ingestion/pipeline.js +26 -49
  26. package/dist/core/ingestion/process-processor.js +1 -2
  27. package/dist/core/ingestion/symbol-table.d.ts +1 -12
  28. package/dist/core/ingestion/symbol-table.js +12 -19
  29. package/dist/core/ingestion/tree-sitter-queries.d.ts +11 -11
  30. package/dist/core/ingestion/tree-sitter-queries.js +485 -590
  31. package/dist/core/ingestion/utils.d.ts +0 -67
  32. package/dist/core/ingestion/utils.js +9 -692
  33. package/dist/core/ingestion/workers/parse-worker.d.ts +3 -20
  34. package/dist/core/ingestion/workers/parse-worker.js +345 -84
  35. package/dist/core/ingestion/workers/worker-pool.js +0 -8
  36. package/dist/core/kuzu/csv-generator.js +3 -19
  37. package/dist/core/kuzu/kuzu-adapter.js +19 -14
  38. package/dist/core/kuzu/schema.d.ts +3 -3
  39. package/dist/core/kuzu/schema.js +288 -303
  40. package/dist/core/search/bm25-index.js +6 -7
  41. package/dist/core/search/hybrid-search.js +3 -3
  42. package/dist/core/wiki/diagrams.d.ts +27 -0
  43. package/dist/core/wiki/diagrams.js +163 -0
  44. package/dist/core/wiki/generator.d.ts +50 -2
  45. package/dist/core/wiki/generator.js +548 -49
  46. package/dist/core/wiki/graph-queries.d.ts +42 -0
  47. package/dist/core/wiki/graph-queries.js +276 -97
  48. package/dist/core/wiki/html-viewer.js +192 -192
  49. package/dist/core/wiki/llm-client.js +73 -11
  50. package/dist/core/wiki/prompts.d.ts +52 -8
  51. package/dist/core/wiki/prompts.js +200 -86
  52. package/dist/mcp/core/kuzu-adapter.d.ts +3 -1
  53. package/dist/mcp/core/kuzu-adapter.js +44 -13
  54. package/dist/mcp/local/local-backend.js +128 -128
  55. package/dist/mcp/resources.js +42 -42
  56. package/dist/mcp/server.js +19 -18
  57. package/dist/mcp/tools.js +104 -103
  58. package/hooks/claude/gitnexus-hook.cjs +155 -238
  59. package/hooks/claude/pre-tool-use.sh +79 -79
  60. package/hooks/claude/session-start.sh +42 -42
  61. package/package.json +96 -96
  62. package/scripts/patch-tree-sitter-swift.cjs +74 -74
  63. package/skills/gitnexus-cli.md +82 -82
  64. package/skills/gitnexus-debugging.md +89 -89
  65. package/skills/gitnexus-exploring.md +78 -78
  66. package/skills/gitnexus-guide.md +64 -64
  67. package/skills/gitnexus-impact-analysis.md +97 -97
  68. package/skills/gitnexus-pr-review.md +163 -163
  69. package/skills/gitnexus-refactoring.md +121 -121
  70. package/vendor/leiden/index.cjs +355 -355
  71. package/vendor/leiden/utils.cjs +392 -392
  72. package/dist/cli/lazy-action.d.ts +0 -6
  73. package/dist/cli/lazy-action.js +0 -18
  74. package/dist/cli/skill-gen.d.ts +0 -26
  75. package/dist/cli/skill-gen.js +0 -549
  76. package/dist/core/ingestion/constants.d.ts +0 -16
  77. package/dist/core/ingestion/constants.js +0 -16
  78. package/dist/core/ingestion/export-detection.d.ts +0 -18
  79. package/dist/core/ingestion/export-detection.js +0 -230
  80. package/dist/core/ingestion/language-config.d.ts +0 -46
  81. package/dist/core/ingestion/language-config.js +0 -167
  82. package/dist/core/ingestion/mro-processor.d.ts +0 -45
  83. package/dist/core/ingestion/mro-processor.js +0 -369
  84. package/dist/core/ingestion/named-binding-extraction.d.ts +0 -61
  85. package/dist/core/ingestion/named-binding-extraction.js +0 -363
  86. package/dist/core/ingestion/resolvers/csharp.d.ts +0 -22
  87. package/dist/core/ingestion/resolvers/csharp.js +0 -109
  88. package/dist/core/ingestion/resolvers/go.d.ts +0 -19
  89. package/dist/core/ingestion/resolvers/go.js +0 -42
  90. package/dist/core/ingestion/resolvers/index.d.ts +0 -16
  91. package/dist/core/ingestion/resolvers/index.js +0 -11
  92. package/dist/core/ingestion/resolvers/jvm.d.ts +0 -23
  93. package/dist/core/ingestion/resolvers/jvm.js +0 -87
  94. package/dist/core/ingestion/resolvers/php.d.ts +0 -15
  95. package/dist/core/ingestion/resolvers/php.js +0 -35
  96. package/dist/core/ingestion/resolvers/rust.d.ts +0 -15
  97. package/dist/core/ingestion/resolvers/rust.js +0 -73
  98. package/dist/core/ingestion/resolvers/standard.d.ts +0 -28
  99. package/dist/core/ingestion/resolvers/standard.js +0 -145
  100. package/dist/core/ingestion/resolvers/utils.d.ts +0 -33
  101. package/dist/core/ingestion/resolvers/utils.js +0 -120
  102. package/dist/core/ingestion/symbol-resolver.d.ts +0 -32
  103. package/dist/core/ingestion/symbol-resolver.js +0 -83
  104. package/dist/core/ingestion/type-env.d.ts +0 -27
  105. package/dist/core/ingestion/type-env.js +0 -86
  106. package/dist/core/ingestion/type-extractors/c-cpp.d.ts +0 -2
  107. package/dist/core/ingestion/type-extractors/c-cpp.js +0 -60
  108. package/dist/core/ingestion/type-extractors/csharp.d.ts +0 -2
  109. package/dist/core/ingestion/type-extractors/csharp.js +0 -89
  110. package/dist/core/ingestion/type-extractors/go.d.ts +0 -2
  111. package/dist/core/ingestion/type-extractors/go.js +0 -105
  112. package/dist/core/ingestion/type-extractors/index.d.ts +0 -21
  113. package/dist/core/ingestion/type-extractors/index.js +0 -29
  114. package/dist/core/ingestion/type-extractors/jvm.d.ts +0 -3
  115. package/dist/core/ingestion/type-extractors/jvm.js +0 -121
  116. package/dist/core/ingestion/type-extractors/php.d.ts +0 -2
  117. package/dist/core/ingestion/type-extractors/php.js +0 -31
  118. package/dist/core/ingestion/type-extractors/python.d.ts +0 -2
  119. package/dist/core/ingestion/type-extractors/python.js +0 -41
  120. package/dist/core/ingestion/type-extractors/rust.d.ts +0 -2
  121. package/dist/core/ingestion/type-extractors/rust.js +0 -39
  122. package/dist/core/ingestion/type-extractors/shared.d.ts +0 -17
  123. package/dist/core/ingestion/type-extractors/shared.js +0 -97
  124. package/dist/core/ingestion/type-extractors/swift.d.ts +0 -2
  125. package/dist/core/ingestion/type-extractors/swift.js +0 -43
  126. package/dist/core/ingestion/type-extractors/types.d.ts +0 -14
  127. package/dist/core/ingestion/type-extractors/types.js +0 -1
  128. package/dist/core/ingestion/type-extractors/typescript.d.ts +0 -2
  129. package/dist/core/ingestion/type-extractors/typescript.js +0 -46
  130. package/dist/mcp/compatible-stdio-transport.d.ts +0 -25
  131. package/dist/mcp/compatible-stdio-transport.js +0 -200
package/package.json CHANGED
@@ -1,96 +1,96 @@
1
- {
2
- "name": "gitnexus",
3
- "version": "1.4.0",
4
- "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
- "author": "Abhigyan Patwari",
6
- "license": "PolyForm-Noncommercial-1.0.0",
7
- "homepage": "https://github.com/abhigyanpatwari/GitNexus#readme",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/abhigyanpatwari/GitNexus.git",
11
- "directory": "gitnexus"
12
- },
13
- "bugs": {
14
- "url": "https://github.com/abhigyanpatwari/GitNexus/issues"
15
- },
16
- "keywords": [
17
- "mcp",
18
- "model-context-protocol",
19
- "code-intelligence",
20
- "knowledge-graph",
21
- "cursor",
22
- "claude",
23
- "ai-agent",
24
- "gitnexus",
25
- "static-analysis",
26
- "codebase-indexing"
27
- ],
28
- "type": "module",
29
- "bin": {
30
- "gitnexus": "dist/cli/index.js"
31
- },
32
- "files": [
33
- "dist",
34
- "hooks",
35
- "scripts",
36
- "skills",
37
- "vendor"
38
- ],
39
- "scripts": {
40
- "build": "tsc",
41
- "dev": "tsx watch src/cli/index.ts",
42
- "test": "vitest run test/unit",
43
- "test:integration": "vitest run test/integration",
44
- "test:all": "vitest run",
45
- "test:watch": "vitest",
46
- "test:coverage": "vitest run --coverage",
47
- "prepare": "npm run build",
48
- "postinstall": "node scripts/patch-tree-sitter-swift.cjs"
49
- },
50
- "dependencies": {
51
- "@huggingface/transformers": "^3.0.0",
52
- "@modelcontextprotocol/sdk": "^1.0.0",
53
- "cli-progress": "^3.12.0",
54
- "commander": "^12.0.0",
55
- "cors": "^2.8.5",
56
- "express": "^4.19.2",
57
- "glob": "^11.0.0",
58
- "graphology": "^0.25.4",
59
- "graphology-indices": "^0.17.0",
60
- "graphology-utils": "^2.3.0",
61
- "kuzu": "^0.11.3",
62
- "lru-cache": "^11.0.0",
63
- "mnemonist": "^0.39.0",
64
- "pandemonium": "^2.4.0",
65
- "tree-sitter": "^0.21.0",
66
- "tree-sitter-c": "^0.21.0",
67
- "tree-sitter-c-sharp": "^0.21.0",
68
- "tree-sitter-cpp": "^0.22.0",
69
- "tree-sitter-go": "^0.21.0",
70
- "tree-sitter-java": "^0.21.0",
71
- "tree-sitter-javascript": "^0.21.0",
72
- "tree-sitter-kotlin": "^0.3.8",
73
- "tree-sitter-php": "^0.23.12",
74
- "tree-sitter-python": "^0.21.0",
75
- "tree-sitter-rust": "^0.21.0",
76
- "tree-sitter-typescript": "^0.21.0",
77
- "uuid": "^13.0.0"
78
- },
79
- "optionalDependencies": {
80
- "tree-sitter-swift": "^0.6.0"
81
- },
82
- "devDependencies": {
83
- "@types/cli-progress": "^3.11.6",
84
- "@types/cors": "^2.8.17",
85
- "@types/express": "^4.17.21",
86
- "@types/node": "^20.0.0",
87
- "@types/uuid": "^10.0.0",
88
- "@vitest/coverage-v8": "^4.0.18",
89
- "tsx": "^4.0.0",
90
- "typescript": "^5.4.5",
91
- "vitest": "^4.0.18"
92
- },
93
- "engines": {
94
- "node": ">=18.0.0"
95
- }
96
- }
1
+ {
2
+ "name": "gitnexus",
3
+ "version": "1.4.1",
4
+ "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
+ "author": "Abhigyan Patwari",
6
+ "license": "PolyForm-Noncommercial-1.0.0",
7
+ "homepage": "https://github.com/abhigyanpatwari/GitNexus#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/abhigyanpatwari/GitNexus.git",
11
+ "directory": "gitnexus"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/abhigyanpatwari/GitNexus/issues"
15
+ },
16
+ "keywords": [
17
+ "mcp",
18
+ "model-context-protocol",
19
+ "code-intelligence",
20
+ "knowledge-graph",
21
+ "cursor",
22
+ "claude",
23
+ "ai-agent",
24
+ "gitnexus",
25
+ "static-analysis",
26
+ "codebase-indexing"
27
+ ],
28
+ "type": "module",
29
+ "bin": {
30
+ "gitnexus": "dist/cli/index.js"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "hooks",
35
+ "scripts",
36
+ "skills",
37
+ "vendor"
38
+ ],
39
+ "scripts": {
40
+ "build": "tsc",
41
+ "dev": "tsx watch src/cli/index.ts",
42
+ "test": "vitest run test/unit",
43
+ "test:integration": "vitest run test/integration",
44
+ "test:all": "vitest run",
45
+ "test:watch": "vitest",
46
+ "test:coverage": "vitest run --coverage",
47
+ "prepare": "npm run build",
48
+ "postinstall": "node scripts/patch-tree-sitter-swift.cjs"
49
+ },
50
+ "dependencies": {
51
+ "@huggingface/transformers": "^3.0.0",
52
+ "@modelcontextprotocol/sdk": "^1.0.0",
53
+ "cli-progress": "^3.12.0",
54
+ "commander": "^12.0.0",
55
+ "cors": "^2.8.5",
56
+ "express": "^4.19.2",
57
+ "glob": "^11.0.0",
58
+ "graphology": "^0.25.4",
59
+ "graphology-indices": "^0.17.0",
60
+ "graphology-utils": "^2.3.0",
61
+ "kuzu": "^0.11.3",
62
+ "lru-cache": "^11.0.0",
63
+ "mnemonist": "^0.39.0",
64
+ "pandemonium": "^2.4.0",
65
+ "tree-sitter": "^0.21.0",
66
+ "tree-sitter-c": "^0.21.0",
67
+ "tree-sitter-c-sharp": "^0.21.0",
68
+ "tree-sitter-cpp": "^0.22.0",
69
+ "tree-sitter-go": "^0.21.0",
70
+ "tree-sitter-java": "^0.21.0",
71
+ "tree-sitter-javascript": "^0.21.0",
72
+ "tree-sitter-kotlin": "^0.3.8",
73
+ "tree-sitter-php": "^0.23.12",
74
+ "tree-sitter-python": "^0.21.0",
75
+ "tree-sitter-rust": "^0.21.0",
76
+ "tree-sitter-typescript": "^0.21.0",
77
+ "uuid": "^13.0.0"
78
+ },
79
+ "optionalDependencies": {
80
+ "tree-sitter-swift": "^0.6.0"
81
+ },
82
+ "devDependencies": {
83
+ "@types/cli-progress": "^3.11.6",
84
+ "@types/cors": "^2.8.17",
85
+ "@types/express": "^4.17.21",
86
+ "@types/node": "^20.0.0",
87
+ "@types/uuid": "^10.0.0",
88
+ "@vitest/coverage-v8": "^4.0.18",
89
+ "tsx": "^4.0.0",
90
+ "typescript": "^5.4.5",
91
+ "vitest": "^4.0.18"
92
+ },
93
+ "engines": {
94
+ "node": ">=18.0.0"
95
+ }
96
+ }
@@ -1,74 +1,74 @@
1
- #!/usr/bin/env node
2
- /**
3
- * WORKAROUND: tree-sitter-swift@0.6.0 binding.gyp build failure
4
- *
5
- * Background:
6
- * tree-sitter-swift@0.6.0's binding.gyp contains an "actions" array that
7
- * invokes `tree-sitter generate` to regenerate parser.c from grammar.js.
8
- * This is intended for grammar developers, but the published npm package
9
- * already ships pre-generated parser files (parser.c, scanner.c), so the
10
- * actions are unnecessary for consumers. Since consumers don't have
11
- * tree-sitter-cli installed, the actions always fail during `npm install`.
12
- *
13
- * Why we can't just upgrade:
14
- * tree-sitter-swift@0.7.1 fixes this (removes postinstall, ships prebuilds),
15
- * but it requires tree-sitter@^0.22.1. The upstream project pins tree-sitter
16
- * to ^0.21.0 and all other grammar packages depend on that version.
17
- * Upgrading tree-sitter would be a separate breaking change.
18
- *
19
- * How this workaround works:
20
- * 1. tree-sitter-swift's own postinstall fails (npm warns but continues)
21
- * 2. This script runs as gitnexus's postinstall
22
- * 3. It removes the "actions" array from binding.gyp
23
- * 4. It rebuilds the native binding with the cleaned binding.gyp
24
- *
25
- * TODO: Remove this script when tree-sitter is upgraded to ^0.22.x,
26
- * which allows using tree-sitter-swift@0.7.1+ directly.
27
- */
28
- const fs = require('fs');
29
- const path = require('path');
30
- const { execSync } = require('child_process');
31
-
32
- const swiftDir = path.join(__dirname, '..', 'node_modules', 'tree-sitter-swift');
33
- const bindingPath = path.join(swiftDir, 'binding.gyp');
34
-
35
- try {
36
- if (!fs.existsSync(bindingPath)) {
37
- process.exit(0);
38
- }
39
-
40
- const content = fs.readFileSync(bindingPath, 'utf8');
41
- let needsRebuild = false;
42
-
43
- if (content.includes('"actions"')) {
44
- // Strip Python-style comments (#) before JSON parsing
45
- const cleaned = content.replace(/#[^\n]*/g, '');
46
- const gyp = JSON.parse(cleaned);
47
-
48
- if (gyp.targets && gyp.targets[0] && gyp.targets[0].actions) {
49
- delete gyp.targets[0].actions;
50
- fs.writeFileSync(bindingPath, JSON.stringify(gyp, null, 2) + '\n');
51
- console.log('[tree-sitter-swift] Patched binding.gyp (removed actions array)');
52
- needsRebuild = true;
53
- }
54
- }
55
-
56
- // Check if native binding exists
57
- const bindingNode = path.join(swiftDir, 'build', 'Release', 'tree_sitter_swift_binding.node');
58
- if (!fs.existsSync(bindingNode)) {
59
- needsRebuild = true;
60
- }
61
-
62
- if (needsRebuild) {
63
- console.log('[tree-sitter-swift] Rebuilding native binding...');
64
- execSync('npx node-gyp rebuild', {
65
- cwd: swiftDir,
66
- stdio: 'pipe',
67
- timeout: 120000,
68
- });
69
- console.log('[tree-sitter-swift] Native binding built successfully');
70
- }
71
- } catch (err) {
72
- console.warn('[tree-sitter-swift] Could not build native binding:', err.message);
73
- console.warn('[tree-sitter-swift] You may need to manually run: cd node_modules/tree-sitter-swift && npx node-gyp rebuild');
74
- }
1
+ #!/usr/bin/env node
2
+ /**
3
+ * WORKAROUND: tree-sitter-swift@0.6.0 binding.gyp build failure
4
+ *
5
+ * Background:
6
+ * tree-sitter-swift@0.6.0's binding.gyp contains an "actions" array that
7
+ * invokes `tree-sitter generate` to regenerate parser.c from grammar.js.
8
+ * This is intended for grammar developers, but the published npm package
9
+ * already ships pre-generated parser files (parser.c, scanner.c), so the
10
+ * actions are unnecessary for consumers. Since consumers don't have
11
+ * tree-sitter-cli installed, the actions always fail during `npm install`.
12
+ *
13
+ * Why we can't just upgrade:
14
+ * tree-sitter-swift@0.7.1 fixes this (removes postinstall, ships prebuilds),
15
+ * but it requires tree-sitter@^0.22.1. The upstream project pins tree-sitter
16
+ * to ^0.21.0 and all other grammar packages depend on that version.
17
+ * Upgrading tree-sitter would be a separate breaking change.
18
+ *
19
+ * How this workaround works:
20
+ * 1. tree-sitter-swift's own postinstall fails (npm warns but continues)
21
+ * 2. This script runs as gitnexus's postinstall
22
+ * 3. It removes the "actions" array from binding.gyp
23
+ * 4. It rebuilds the native binding with the cleaned binding.gyp
24
+ *
25
+ * TODO: Remove this script when tree-sitter is upgraded to ^0.22.x,
26
+ * which allows using tree-sitter-swift@0.7.1+ directly.
27
+ */
28
+ const fs = require('fs');
29
+ const path = require('path');
30
+ const { execSync } = require('child_process');
31
+
32
+ const swiftDir = path.join(__dirname, '..', 'node_modules', 'tree-sitter-swift');
33
+ const bindingPath = path.join(swiftDir, 'binding.gyp');
34
+
35
+ try {
36
+ if (!fs.existsSync(bindingPath)) {
37
+ process.exit(0);
38
+ }
39
+
40
+ const content = fs.readFileSync(bindingPath, 'utf8');
41
+ let needsRebuild = false;
42
+
43
+ if (content.includes('"actions"')) {
44
+ // Strip Python-style comments (#) before JSON parsing
45
+ const cleaned = content.replace(/#[^\n]*/g, '');
46
+ const gyp = JSON.parse(cleaned);
47
+
48
+ if (gyp.targets && gyp.targets[0] && gyp.targets[0].actions) {
49
+ delete gyp.targets[0].actions;
50
+ fs.writeFileSync(bindingPath, JSON.stringify(gyp, null, 2) + '\n');
51
+ console.log('[tree-sitter-swift] Patched binding.gyp (removed actions array)');
52
+ needsRebuild = true;
53
+ }
54
+ }
55
+
56
+ // Check if native binding exists
57
+ const bindingNode = path.join(swiftDir, 'build', 'Release', 'tree_sitter_swift_binding.node');
58
+ if (!fs.existsSync(bindingNode)) {
59
+ needsRebuild = true;
60
+ }
61
+
62
+ if (needsRebuild) {
63
+ console.log('[tree-sitter-swift] Rebuilding native binding...');
64
+ execSync('npx node-gyp rebuild', {
65
+ cwd: swiftDir,
66
+ stdio: 'pipe',
67
+ timeout: 120000,
68
+ });
69
+ console.log('[tree-sitter-swift] Native binding built successfully');
70
+ }
71
+ } catch (err) {
72
+ console.warn('[tree-sitter-swift] Could not build native binding:', err.message);
73
+ console.warn('[tree-sitter-swift] You may need to manually run: cd node_modules/tree-sitter-swift && npx node-gyp rebuild');
74
+ }
@@ -1,82 +1,82 @@
1
- ---
2
- name: gitnexus-cli
3
- description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\""
4
- ---
5
-
6
- # GitNexus CLI Commands
7
-
8
- All commands work via `npx` — no global install required.
9
-
10
- ## Commands
11
-
12
- ### analyze — Build or refresh the index
13
-
14
- ```bash
15
- npx gitnexus analyze
16
- ```
17
-
18
- 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.
19
-
20
- | Flag | Effect |
21
- | -------------- | ---------------------------------------------------------------- |
22
- | `--force` | Force full re-index even if up to date |
23
- | `--embeddings` | Enable embedding generation for semantic search (off by default) |
24
-
25
- **When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale. In Claude Code, a PostToolUse hook runs `analyze` automatically after `git commit` and `git merge`, preserving embeddings if previously generated.
26
-
27
- ### status — Check index freshness
28
-
29
- ```bash
30
- npx gitnexus status
31
- ```
32
-
33
- 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.
34
-
35
- ### clean — Delete the index
36
-
37
- ```bash
38
- npx gitnexus clean
39
- ```
40
-
41
- 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.
42
-
43
- | Flag | Effect |
44
- | --------- | ------------------------------------------------- |
45
- | `--force` | Skip confirmation prompt |
46
- | `--all` | Clean all indexed repos, not just the current one |
47
-
48
- ### wiki — Generate documentation from the graph
49
-
50
- ```bash
51
- npx gitnexus wiki
52
- ```
53
-
54
- Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to `~/.gitnexus/config.json` on first use).
55
-
56
- | Flag | Effect |
57
- | ------------------- | ----------------------------------------- |
58
- | `--force` | Force full regeneration |
59
- | `--model <model>` | LLM model (default: minimax/minimax-m2.5) |
60
- | `--base-url <url>` | LLM API base URL |
61
- | `--api-key <key>` | LLM API key |
62
- | `--concurrency <n>` | Parallel LLM calls (default: 3) |
63
- | `--gist` | Publish wiki as a public GitHub Gist |
64
-
65
- ### list — Show all indexed repos
66
-
67
- ```bash
68
- npx gitnexus list
69
- ```
70
-
71
- Lists all repositories registered in `~/.gitnexus/registry.json`. The MCP `list_repos` tool provides the same information.
72
-
73
- ## After Indexing
74
-
75
- 1. **Read `gitnexus://repo/{name}/context`** to verify the index loaded
76
- 2. Use the other GitNexus skills (`exploring`, `debugging`, `impact-analysis`, `refactoring`) for your task
77
-
78
- ## Troubleshooting
79
-
80
- - **"Not inside a git repository"**: Run from a directory inside a git repo
81
- - **Index is stale after re-analyzing**: Restart Claude Code to reload the MCP server
82
- - **Embeddings slow**: Omit `--embeddings` (it's off by default) or set `OPENAI_API_KEY` for faster API-based embedding
1
+ ---
2
+ name: gitnexus-cli
3
+ description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\""
4
+ ---
5
+
6
+ # GitNexus CLI Commands
7
+
8
+ All commands work via `npx` — no global install required.
9
+
10
+ ## Commands
11
+
12
+ ### analyze — Build or refresh the index
13
+
14
+ ```bash
15
+ npx gitnexus analyze
16
+ ```
17
+
18
+ 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.
19
+
20
+ | Flag | Effect |
21
+ | -------------- | ---------------------------------------------------------------- |
22
+ | `--force` | Force full re-index even if up to date |
23
+ | `--embeddings` | Enable embedding generation for semantic search (off by default) |
24
+
25
+ **When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale.
26
+
27
+ ### status — Check index freshness
28
+
29
+ ```bash
30
+ npx gitnexus status
31
+ ```
32
+
33
+ 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.
34
+
35
+ ### clean — Delete the index
36
+
37
+ ```bash
38
+ npx gitnexus clean
39
+ ```
40
+
41
+ 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.
42
+
43
+ | Flag | Effect |
44
+ | --------- | ------------------------------------------------- |
45
+ | `--force` | Skip confirmation prompt |
46
+ | `--all` | Clean all indexed repos, not just the current one |
47
+
48
+ ### wiki — Generate documentation from the graph
49
+
50
+ ```bash
51
+ npx gitnexus wiki
52
+ ```
53
+
54
+ Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to `~/.gitnexus/config.json` on first use).
55
+
56
+ | Flag | Effect |
57
+ | ------------------- | ----------------------------------------- |
58
+ | `--force` | Force full regeneration |
59
+ | `--model <model>` | LLM model (default: minimax/minimax-m2.5) |
60
+ | `--base-url <url>` | LLM API base URL |
61
+ | `--api-key <key>` | LLM API key |
62
+ | `--concurrency <n>` | Parallel LLM calls (default: 3) |
63
+ | `--gist` | Publish wiki as a public GitHub Gist |
64
+
65
+ ### list — Show all indexed repos
66
+
67
+ ```bash
68
+ npx gitnexus list
69
+ ```
70
+
71
+ Lists all repositories registered in `~/.gitnexus/registry.json`. The MCP `list_repos` tool provides the same information.
72
+
73
+ ## After Indexing
74
+
75
+ 1. **Read `gitnexus://repo/{name}/context`** to verify the index loaded
76
+ 2. Use the other GitNexus skills (`exploring`, `debugging`, `impact-analysis`, `refactoring`) for your task
77
+
78
+ ## Troubleshooting
79
+
80
+ - **"Not inside a git repository"**: Run from a directory inside a git repo
81
+ - **Index is stale after re-analyzing**: Restart Claude Code to reload the MCP server
82
+ - **Embeddings slow**: Omit `--embeddings` (it's off by default) or set `OPENAI_API_KEY` for faster API-based embedding