@veewo/gitnexus 1.4.8-rc → 1.4.8-rc.2

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 CHANGED
@@ -18,17 +18,16 @@ AI coding tools don't understand your codebase structure. They edit a function w
18
18
  ## Quick Start
19
19
 
20
20
  ```bash
21
- # Optional: pin one version for the whole session (example RC)
22
- # export GITNEXUS_CLI_SPEC="@veewo/gitnexus@1.4.7-rc"
23
- GITNEXUS_CLI_SPEC="${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}"
24
-
25
- # Index your repo (run from repo root)
26
- npx -y "${GITNEXUS_CLI_SPEC}" analyze
21
+ npm install -g @veewo/gitnexus
22
+ gitnexus setup --cli-spec @veewo/gitnexus
23
+ gitnexus analyze
27
24
  ```
28
25
 
29
26
  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.
30
27
 
31
- To configure MCP for your editor, run `npx -y "${GITNEXUS_CLI_SPEC}" setup --cli-spec "$GITNEXUS_CLI_SPEC"` once or set it up manually below.
28
+ After `setup`, repository workflows resolve any npx package fallback from `~/.gitnexus/config.json` instead of defaulting to `@latest`.
29
+
30
+ To configure MCP for your editor, run `gitnexus setup --cli-spec <packageSpec>` once — or set it up manually below.
32
31
 
33
32
  `gitnexus setup` auto-detects your editors and writes the correct global MCP config. You only need to run it once.
34
33
 
@@ -56,7 +55,7 @@ If you prefer to configure manually instead of using `gitnexus setup`:
56
55
  ### Claude Code (full support — MCP + skills + hooks)
57
56
 
58
57
  ```bash
59
- claude mcp add gitnexus -- npx -y "${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}" mcp
58
+ claude mcp add gitnexus -- gitnexus mcp
60
59
  ```
61
60
 
62
61
  ### Cursor / Windsurf
@@ -67,8 +66,8 @@ Add to `~/.cursor/mcp.json` (global — works for all projects):
67
66
  {
68
67
  "mcpServers": {
69
68
  "gitnexus": {
70
- "command": "npx",
71
- "args": ["-y", "@veewo/gitnexus@latest", "mcp"]
69
+ "command": "gitnexus",
70
+ "args": ["mcp"]
72
71
  }
73
72
  }
74
73
  }
@@ -82,8 +81,8 @@ Add to `~/.config/opencode/config.json`:
82
81
  {
83
82
  "mcp": {
84
83
  "gitnexus": {
85
- "command": "npx",
86
- "args": ["-y", "@veewo/gitnexus@latest", "mcp"]
84
+ "command": "gitnexus",
85
+ "args": ["mcp"]
87
86
  }
88
87
  }
89
88
  }
@@ -141,10 +140,10 @@ Your AI agent gets these tools automatically:
141
140
 
142
141
  ```bash
143
142
  gitnexus setup # Configure MCP for your editors (one-time)
144
- npx -y "${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}" analyze [path] # Index a repository (or update stale index)
145
- npx -y "${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}" analyze --force # Force full re-index
146
- npx -y "${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}" analyze --embeddings # Enable embedding generation (slower, better search)
147
- npx -y "${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}" analyze --verbose # Log skipped files when parsers are unavailable
143
+ gitnexus analyze [path] # Index a repository (or update stale index)
144
+ gitnexus analyze --force # Force full re-index
145
+ gitnexus analyze --embeddings # Enable embedding generation (slower, better search)
146
+ gitnexus analyze --verbose # Log skipped files when parsers are unavailable
148
147
  gitnexus mcp # Start MCP server (stdio) — serves all indexed repos
149
148
  gitnexus serve # Start local HTTP server (multi-repo) for web UI
150
149
  gitnexus list # List all indexed repositories
@@ -157,7 +156,7 @@ gitnexus wiki --model <model> # Wiki with custom LLM model (default: gpt-4o-m
157
156
 
158
157
  ## Multi-Repo Support
159
158
 
160
- GitNexus supports indexing multiple repositories. Each `npx -y "${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}" analyze` registers the repo in a global registry (`~/.gitnexus/registry.json`). The MCP server serves all indexed repos automatically.
159
+ 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.
161
160
 
162
161
  ## Supported Languages
163
162
 
@@ -192,7 +191,7 @@ GitNexus ships with skill files that teach AI agents how to use the tools effect
192
191
  - **Impact Analysis** — Analyze blast radius before changes
193
192
  - **Refactoring** — Plan safe refactors using dependency mapping
194
193
 
195
- Installed automatically by both `npx -y "${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}" analyze` (per-repo) and `gitnexus setup` (global).
194
+ Installed automatically by both `gitnexus analyze` (per-repo) and `gitnexus setup` (global).
196
195
 
197
196
  ## Requirements
198
197
 
@@ -44,7 +44,7 @@ This project is indexed by GitNexus as **${projectName}** (${stats.nodes || 0} s
44
44
  2. **Match your task to a skill below** and **read that skill file**
45
45
  3. **Follow the skill's workflow and checklist**
46
46
 
47
- > If step 1 warns the index is stale, ask user whether to rebuild index via \`gitnexus analyze\` when local CLI exists; otherwise run \`${reindexCmd}\` (it reuses previous analyze scope/options by default; add \`--no-reuse-options\` to reset). If user declines, explicitly warn that retrieval may not reflect current codebase. For build/analyze/test commands, use a 10-30 minute timeout; on failure/timeout, report exact tool output and do not auto-retry or silently fall back to glob/grep.
47
+ > If step 1 warns the index is stale, ask user whether to rebuild index via \`gitnexus analyze\` when local CLI exists; otherwise resolve the pinned npx package spec from \`~/.gitnexus/config.json\` (\`cliPackageSpec\` first, then \`cliVersion\`) and run \`${reindexCmd}\` with that exact package spec (it reuses previous analyze scope/options by default; add \`--no-reuse-options\` to reset). If user declines, explicitly warn that retrieval may not reflect current codebase. For build/analyze/test commands, use a 10-30 minute timeout; on failure/timeout, report exact tool output and do not auto-retry or silently fall back to glob/grep.
48
48
 
49
49
  ## Skills
50
50
 
package/dist/cli/setup.js CHANGED
@@ -264,7 +264,6 @@ async function installClaudeCodeHooks(result, mcpPackageSpec) {
264
264
  const normalizedCli = path.resolve(resolvedCli).replace(/\\/g, '/');
265
265
  const jsonCli = JSON.stringify(normalizedCli);
266
266
  content = content.replace("let cliPath = path.resolve(__dirname, '..', '..', 'dist', 'cli', 'index.js');", `let cliPath = ${jsonCli};`);
267
- content = content.replace("const DEFAULT_NPX_SPEC = '@veewo/gitnexus@latest';", `const DEFAULT_NPX_SPEC = ${JSON.stringify(mcpPackageSpec)};`);
268
267
  await fs.writeFile(dest, content, 'utf-8');
269
268
  }
270
269
  catch {
@@ -15,7 +15,7 @@ const fs = require('fs');
15
15
  const path = require('path');
16
16
  const os = require('os');
17
17
  const { spawnSync } = require('child_process');
18
- const DEFAULT_NPX_SPEC = '@veewo/gitnexus@latest';
18
+ const DEFAULT_NPX_SPEC = '';
19
19
  const DEFAULT_PACKAGE_NAME = '@veewo/gitnexus';
20
20
 
21
21
  function normalizeNpxSpec(raw) {
@@ -150,6 +150,7 @@ function runGitNexusCli(cliPath, args, cwd, timeout, npxSpec) {
150
150
  { encoding: 'utf-8', timeout, cwd, stdio: ['pipe', 'pipe', 'pipe'] }
151
151
  );
152
152
  }
153
+ if (!npxSpec) return null;
153
154
  // On Windows, invoke npx.cmd directly (no shell needed)
154
155
  return spawnSync(
155
156
  isWin ? 'npx.cmd' : 'npx',
@@ -179,7 +180,7 @@ function handlePreToolUse(input) {
179
180
  let result = '';
180
181
  try {
181
182
  const child = runGitNexusCli(cliPath, ['augment', '--', pattern], cwd, 7000, npxSpec);
182
- if (!child.error && child.status === 0) {
183
+ if (child && !child.error && child.status === 0) {
183
184
  result = child.stderr || '';
184
185
  }
185
186
  } catch { /* graceful failure */ }
@@ -248,10 +249,14 @@ function handlePostToolUse(input) {
248
249
  const npxSpec = resolveNpxSpec();
249
250
  const analyzeArgs = `analyze${hadEmbeddings ? ' --embeddings' : ''}`;
250
251
  const analyzeCmd = `gitnexus ${analyzeArgs}`;
251
- const fallbackCmd = `npx -y ${npxSpec} ${analyzeArgs}`;
252
+ const fallbackCmd = npxSpec
253
+ ? `npx -y ${npxSpec} ${analyzeArgs}`
254
+ : null;
252
255
  sendHookResponse('PostToolUse',
253
256
  `GitNexus index is stale (last indexed: ${lastCommit ? lastCommit.slice(0, 7) : 'never'}). ` +
254
- `Run \`${analyzeCmd}\` (or \`${fallbackCmd}\`) to update the knowledge graph.`
257
+ (fallbackCmd
258
+ ? `Run \`${analyzeCmd}\` (or \`${fallbackCmd}\`) to update the knowledge graph.`
259
+ : `Run \`${analyzeCmd}\` to update the knowledge graph. If local CLI is unavailable, populate ~/.gitnexus/config.json via \`gitnexus setup --cli-spec <packageSpec>\` first.`)
255
260
  );
256
261
  }
257
262
 
@@ -64,11 +64,32 @@ fi
64
64
 
65
65
  # Run gitnexus augment — must be fast (<500ms target)
66
66
  # augment writes to stderr (KuzuDB captures stdout at OS level), so capture stderr and discard stdout
67
- GITNEXUS_CLI_SPEC="${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}"
68
- if [ -n "$GITNEXUS_CLI_VERSION" ]; then
69
- GITNEXUS_CLI_SPEC="@veewo/gitnexus@$GITNEXUS_CLI_VERSION"
67
+ if command -v gitnexus >/dev/null 2>&1; then
68
+ RESULT=$(cd "$CWD" && gitnexus augment "$PATTERN" 2>&1 1>/dev/null)
69
+ else
70
+ if [ -n "$GITNEXUS_CLI_SPEC" ]; then
71
+ :
72
+ elif [ -n "$GITNEXUS_CLI_VERSION" ]; then
73
+ GITNEXUS_CLI_SPEC="@veewo/gitnexus@$GITNEXUS_CLI_VERSION"
74
+ elif [ -f "${HOME}/.gitnexus/config.json" ]; then
75
+ GITNEXUS_CLI_SPEC="$(
76
+ node -e 'const fs=require("fs");const os=require("os");const path=require("path");
77
+ try {
78
+ const raw=fs.readFileSync(path.join(os.homedir(),".gitnexus","config.json"),"utf8");
79
+ const parsed=JSON.parse(raw);
80
+ const spec=typeof parsed.cliPackageSpec==="string" && parsed.cliPackageSpec.trim()
81
+ ? parsed.cliPackageSpec.trim()
82
+ : typeof parsed.cliVersion==="string" && parsed.cliVersion.trim()
83
+ ? `@veewo/gitnexus@${parsed.cliVersion.trim()}`
84
+ : "";
85
+ if (spec) process.stdout.write(spec);
86
+ } catch {}'
87
+ )"
88
+ fi
89
+
90
+ [ -z "$GITNEXUS_CLI_SPEC" ] && exit 0
91
+ RESULT=$(cd "$CWD" && npx -y "$GITNEXUS_CLI_SPEC" augment "$PATTERN" 2>&1 1>/dev/null)
70
92
  fi
71
- RESULT=$(cd "$CWD" && npx -y "$GITNEXUS_CLI_SPEC" augment "$PATTERN" 2>&1 1>/dev/null)
72
93
 
73
94
  if [ -n "$RESULT" ]; then
74
95
  ESCAPED=$(echo "$RESULT" | jq -Rs .)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veewo/gitnexus",
3
- "version": "1.4.8-rc",
3
+ "version": "1.4.8-rc.2",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -5,15 +5,29 @@ description: "Use when the user needs to run GitNexus CLI commands like analyze/
5
5
 
6
6
  # GitNexus CLI Commands
7
7
 
8
- Use one command alias in the session so every CLI/MCP call stays on one version line.
8
+ Use one command alias in the session so every CLI/MCP call stays on one version line. After `setup`, treat `~/.gitnexus/config.json` as the only npx version source.
9
9
 
10
10
  ```bash
11
- # If user prompt specifies a version (example: 1.4.7-rc), set it once:
12
- # export GITNEXUS_CLI_SPEC="@veewo/gitnexus@1.4.7-rc"
13
- GITNEXUS_CLI_SPEC="${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest}"
14
11
  if command -v gitnexus >/dev/null 2>&1; then
15
12
  GN="gitnexus"
16
13
  else
14
+ GITNEXUS_CLI_SPEC="$(
15
+ node -e 'const fs=require("fs");const os=require("os");const path=require("path");
16
+ try {
17
+ const raw=fs.readFileSync(path.join(os.homedir(),".gitnexus","config.json"),"utf8");
18
+ const parsed=JSON.parse(raw);
19
+ const spec=typeof parsed.cliPackageSpec==="string" && parsed.cliPackageSpec.trim()
20
+ ? parsed.cliPackageSpec.trim()
21
+ : typeof parsed.cliVersion==="string" && parsed.cliVersion.trim()
22
+ ? `@veewo/gitnexus@${parsed.cliVersion.trim()}`
23
+ : "";
24
+ if (spec) process.stdout.write(spec);
25
+ } catch {}'
26
+ )"
27
+ if [ -z "$GITNEXUS_CLI_SPEC" ]; then
28
+ echo "Missing GitNexus CLI package spec in ~/.gitnexus/config.json. Run gitnexus setup --cli-spec <packageSpec> first." >&2
29
+ exit 1
30
+ fi
17
31
  GN="npx -y ${GITNEXUS_CLI_SPEC}"
18
32
  fi
19
33
  ```
@@ -23,7 +23,7 @@ description: "Use when the user is debugging a bug, tracing an error, or asking
23
23
  5. gitnexus_cypher({query: "MATCH path..."}) → Custom traces if needed
24
24
  ```
25
25
 
26
- > If "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise run `npx -y ${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest} analyze`.
26
+ > If "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise resolve the pinned npx package spec from `~/.gitnexus/config.json` and run `npx -y <resolved-cli-spec> analyze`.
27
27
 
28
28
  ## Checklist
29
29
 
@@ -24,7 +24,7 @@ description: "Use when the user asks how code works, wants to understand archite
24
24
  6. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow
25
25
  ```
26
26
 
27
- > If step 2 says "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise run `npx -y ${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest} analyze`.
27
+ > If step 2 says "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise resolve the pinned npx package spec from `~/.gitnexus/config.json` and run `npx -y <resolved-cli-spec> analyze`.
28
28
 
29
29
  ## Checklist
30
30
 
@@ -15,7 +15,7 @@ For any task involving code understanding, debugging, impact analysis, or refact
15
15
  2. **Match your task to a skill below** and **read that skill file**
16
16
  3. **Follow the skill's workflow and checklist**
17
17
 
18
- > If step 1 warns the index is stale, run `gitnexus analyze` when local CLI exists; otherwise run `npx -y ${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest} analyze`.
18
+ > If step 1 warns the index is stale, run `gitnexus analyze` when local CLI exists; otherwise resolve the pinned npx package spec from `~/.gitnexus/config.json` and run `npx -y <resolved-cli-spec> analyze`.
19
19
 
20
20
  ## Skills
21
21
 
@@ -23,7 +23,7 @@ description: "Use when the user wants to know what will break if they change som
23
23
  4. Assess risk and report to user
24
24
  ```
25
25
 
26
- > If "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise run `npx -y ${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest} analyze`.
26
+ > If "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise resolve the pinned npx package spec from `~/.gitnexus/config.json` and run `npx -y <resolved-cli-spec> analyze`.
27
27
 
28
28
  ## Checklist
29
29
 
@@ -26,7 +26,7 @@ description: "Use when the user wants to review a pull request, understand what
26
26
  6. Summarize findings with risk assessment
27
27
  ```
28
28
 
29
- > If "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise run `npx -y ${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest} analyze` before reviewing.
29
+ > If "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise resolve the pinned npx package spec from `~/.gitnexus/config.json` and run `npx -y <resolved-cli-spec> analyze` before reviewing.
30
30
 
31
31
  ## Checklist
32
32
 
@@ -23,7 +23,7 @@ description: "Use when the user wants to rename, extract, split, move, or restru
23
23
  5. Plan update order: interfaces → implementations → callers → tests
24
24
  ```
25
25
 
26
- > If "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise run `npx -y ${GITNEXUS_CLI_SPEC:-@veewo/gitnexus@latest} analyze`.
26
+ > If "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise resolve the pinned npx package spec from `~/.gitnexus/config.json` and run `npx -y <resolved-cli-spec> analyze`.
27
27
 
28
28
  ## Checklists
29
29