@veewo/gitnexus 1.3.4 → 1.3.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 +8 -1
- package/dist/cli/ai-context.d.ts +1 -1
- package/dist/cli/ai-context.js +2 -2
- package/dist/cli/index.js +1 -1
- package/dist/cli/setup.js +18 -0
- package/dist/cli/setup.test.js +54 -3
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Graph-powered code intelligence for AI agents.** Index any codebase into a knowledge graph, then query it via MCP or CLI.
|
|
4
4
|
|
|
5
|
-
Works with **Cursor**, **Claude Code**, **Windsurf**, **Cline**, **OpenCode**, and any MCP-compatible tool.
|
|
5
|
+
Works with **Cursor**, **Claude Code**, **Codex**, **Windsurf**, **Cline**, **OpenCode**, and any MCP-compatible tool.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/gitnexus)
|
|
8
8
|
[](https://polyformproject.org/licenses/noncommercial/1.0.0/)
|
|
@@ -43,6 +43,7 @@ Key links:
|
|
|
43
43
|
|--------|-----|--------|---------------------|---------|
|
|
44
44
|
| **Claude Code** | Yes | Yes | Yes (PreToolUse) | **Full** |
|
|
45
45
|
| **Cursor** | Yes | Yes | — | MCP + Skills |
|
|
46
|
+
| **Codex** | Yes | Yes | — | MCP + Skills |
|
|
46
47
|
| **Windsurf** | Yes | — | — | MCP |
|
|
47
48
|
| **OpenCode** | Yes | Yes | — | MCP + Skills |
|
|
48
49
|
|
|
@@ -94,6 +95,12 @@ Add to `~/.config/opencode/config.json`:
|
|
|
94
95
|
}
|
|
95
96
|
```
|
|
96
97
|
|
|
98
|
+
### Codex
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
codex mcp add gitnexus -- npx -y gitnexus@latest mcp
|
|
102
|
+
```
|
|
103
|
+
|
|
97
104
|
## How It Works
|
|
98
105
|
|
|
99
106
|
GitNexus builds a complete knowledge graph of your codebase through a multi-phase indexing pipeline:
|
package/dist/cli/ai-context.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* AI Context Generator
|
|
3
3
|
*
|
|
4
4
|
* Creates AGENTS.md and CLAUDE.md with full inline GitNexus context.
|
|
5
|
-
* AGENTS.md is the standard read by Cursor, Windsurf, OpenCode, Cline, etc.
|
|
5
|
+
* AGENTS.md is the standard read by Cursor, Windsurf, OpenCode, Codex, Cline, etc.
|
|
6
6
|
* CLAUDE.md is for Claude Code which only reads that file.
|
|
7
7
|
*/
|
|
8
8
|
interface RepoStats {
|
package/dist/cli/ai-context.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* AI Context Generator
|
|
3
3
|
*
|
|
4
4
|
* Creates AGENTS.md and CLAUDE.md with full inline GitNexus context.
|
|
5
|
-
* AGENTS.md is the standard read by Cursor, Windsurf, OpenCode, Cline, etc.
|
|
5
|
+
* AGENTS.md is the standard read by Cursor, Windsurf, OpenCode, Codex, Cline, etc.
|
|
6
6
|
* CLAUDE.md is for Claude Code which only reads that file.
|
|
7
7
|
*/
|
|
8
8
|
import fs from 'fs/promises';
|
|
@@ -167,7 +167,7 @@ Use GitNexus tools to accomplish this task.
|
|
|
167
167
|
export async function generateAIContextFiles(repoPath, _storagePath, projectName, stats) {
|
|
168
168
|
const content = generateGitNexusContent(projectName, stats);
|
|
169
169
|
const createdFiles = [];
|
|
170
|
-
// Create AGENTS.md (standard for Cursor, Windsurf, OpenCode, Cline, etc.)
|
|
170
|
+
// Create AGENTS.md (standard for Cursor, Windsurf, OpenCode, Codex, Cline, etc.)
|
|
171
171
|
const agentsPath = path.join(repoPath, 'AGENTS.md');
|
|
172
172
|
const agentsResult = await upsertGitNexusSection(agentsPath, content);
|
|
173
173
|
createdFiles.push(`AGENTS.md (${agentsResult})`);
|
package/dist/cli/index.js
CHANGED
|
@@ -59,7 +59,7 @@ program
|
|
|
59
59
|
.version(resolveCliVersion());
|
|
60
60
|
program
|
|
61
61
|
.command('setup')
|
|
62
|
-
.description('One-time setup: configure MCP for Cursor, Claude Code, OpenCode')
|
|
62
|
+
.description('One-time setup: configure MCP for Cursor, Claude Code, OpenCode, Codex')
|
|
63
63
|
.action(setupCommand);
|
|
64
64
|
program
|
|
65
65
|
.command('analyze [path]')
|
package/dist/cli/setup.js
CHANGED
|
@@ -8,10 +8,13 @@
|
|
|
8
8
|
import fs from 'fs/promises';
|
|
9
9
|
import path from 'path';
|
|
10
10
|
import os from 'os';
|
|
11
|
+
import { execFile } from 'node:child_process';
|
|
12
|
+
import { promisify } from 'node:util';
|
|
11
13
|
import { fileURLToPath } from 'url';
|
|
12
14
|
import { getGlobalDir } from '../storage/repo-manager.js';
|
|
13
15
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
16
|
const __dirname = path.dirname(__filename);
|
|
17
|
+
const execFileAsync = promisify(execFile);
|
|
15
18
|
/**
|
|
16
19
|
* The MCP server entry for all editors.
|
|
17
20
|
* On Windows, npx must be invoked via cmd /c since it's a .cmd script.
|
|
@@ -195,6 +198,20 @@ async function setupOpenCode(result) {
|
|
|
195
198
|
result.errors.push(`OpenCode: ${err.message}`);
|
|
196
199
|
}
|
|
197
200
|
}
|
|
201
|
+
async function setupCodex(result) {
|
|
202
|
+
const entry = getMcpEntry();
|
|
203
|
+
try {
|
|
204
|
+
await execFileAsync('codex', ['mcp', 'add', 'gitnexus', '--', entry.command, ...entry.args], { timeout: 15000 });
|
|
205
|
+
result.configured.push('Codex');
|
|
206
|
+
}
|
|
207
|
+
catch (err) {
|
|
208
|
+
if (err?.code === 'ENOENT') {
|
|
209
|
+
result.skipped.push('Codex (not installed)');
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
result.errors.push(`Codex: ${err.message}`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
198
215
|
// ─── Skill Installation ───────────────────────────────────────────
|
|
199
216
|
const SKILL_NAMES = ['gitnexus-exploring', 'gitnexus-debugging', 'gitnexus-impact-analysis', 'gitnexus-refactoring', 'gitnexus-guide', 'gitnexus-cli'];
|
|
200
217
|
/**
|
|
@@ -273,6 +290,7 @@ export const setupCommand = async () => {
|
|
|
273
290
|
await setupCursor(result);
|
|
274
291
|
await setupClaudeCode(result);
|
|
275
292
|
await setupOpenCode(result);
|
|
293
|
+
await setupCodex(result);
|
|
276
294
|
// Install shared global skills once
|
|
277
295
|
await installGlobalAgentSkills(result);
|
|
278
296
|
// Optional Claude-specific hooks
|
package/dist/cli/setup.test.js
CHANGED
|
@@ -7,11 +7,11 @@ import { execFile } from 'node:child_process';
|
|
|
7
7
|
import { promisify } from 'node:util';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
const execFileAsync = promisify(execFile);
|
|
10
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const packageRoot = path.resolve(here, '..', '..');
|
|
12
|
+
const cliPath = path.join(packageRoot, 'dist', 'cli', 'index.js');
|
|
10
13
|
test('setup installs global skills under ~/.agents/skills/gitnexus', async () => {
|
|
11
14
|
const fakeHome = await fs.mkdtemp(path.join(os.tmpdir(), 'gitnexus-setup-home-'));
|
|
12
|
-
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const packageRoot = path.resolve(here, '..', '..');
|
|
14
|
-
const cliPath = path.join(packageRoot, 'dist', 'cli', 'index.js');
|
|
15
15
|
try {
|
|
16
16
|
await execFileAsync(process.execPath, [cliPath, 'setup'], {
|
|
17
17
|
cwd: packageRoot,
|
|
@@ -29,3 +29,54 @@ test('setup installs global skills under ~/.agents/skills/gitnexus', async () =>
|
|
|
29
29
|
await fs.rm(fakeHome, { recursive: true, force: true });
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
test('setup configures Codex MCP when codex CLI is available', async () => {
|
|
33
|
+
const fakeHome = await fs.mkdtemp(path.join(os.tmpdir(), 'gitnexus-setup-home-'));
|
|
34
|
+
const fakeBin = await fs.mkdtemp(path.join(os.tmpdir(), 'gitnexus-setup-bin-'));
|
|
35
|
+
const codexShimPath = path.join(fakeBin, process.platform === 'win32' ? 'codex.cmd' : 'codex');
|
|
36
|
+
const shimLogic = `
|
|
37
|
+
const fs = require('node:fs');
|
|
38
|
+
const path = require('node:path');
|
|
39
|
+
const args = process.argv.slice(2);
|
|
40
|
+
if (args[0] === 'mcp' && args[1] === 'add' && args[2] === 'gitnexus') {
|
|
41
|
+
const home = process.env.HOME || process.env.USERPROFILE;
|
|
42
|
+
const outputPath = path.join(home, '.codex', 'gitnexus-mcp-add.json');
|
|
43
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
44
|
+
fs.writeFileSync(outputPath, JSON.stringify({ args }, null, 2));
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
if (args[0] === '--version') {
|
|
48
|
+
process.stdout.write('codex-shim 0.0.0\\n');
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
process.exit(0);
|
|
52
|
+
`;
|
|
53
|
+
try {
|
|
54
|
+
if (process.platform === 'win32') {
|
|
55
|
+
const runnerPath = path.join(fakeBin, 'codex-shim.cjs');
|
|
56
|
+
await fs.writeFile(runnerPath, shimLogic, 'utf-8');
|
|
57
|
+
await fs.writeFile(codexShimPath, `@echo off\r\nnode "${runnerPath}" %*\r\n`, 'utf-8');
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
await fs.writeFile(codexShimPath, `#!/usr/bin/env node\n${shimLogic}`, { mode: 0o755 });
|
|
61
|
+
}
|
|
62
|
+
await execFileAsync(process.execPath, [cliPath, 'setup'], {
|
|
63
|
+
cwd: packageRoot,
|
|
64
|
+
env: {
|
|
65
|
+
...process.env,
|
|
66
|
+
HOME: fakeHome,
|
|
67
|
+
USERPROFILE: fakeHome,
|
|
68
|
+
PATH: `${fakeBin}${path.delimiter}${process.env.PATH || ''}`,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
const outputPath = path.join(fakeHome, '.codex', 'gitnexus-mcp-add.json');
|
|
72
|
+
const raw = await fs.readFile(outputPath, 'utf-8');
|
|
73
|
+
const parsed = JSON.parse(raw);
|
|
74
|
+
assert.deepEqual(parsed.args.slice(0, 4), ['mcp', 'add', 'gitnexus', '--']);
|
|
75
|
+
assert.ok(parsed.args.includes('gitnexus@latest'));
|
|
76
|
+
assert.ok(parsed.args.includes('mcp'));
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
await fs.rm(fakeHome, { recursive: true, force: true });
|
|
80
|
+
await fs.rm(fakeBin, { recursive: true, force: true });
|
|
81
|
+
}
|
|
82
|
+
});
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* MCP Server (Multi-Repo)
|
|
3
3
|
*
|
|
4
4
|
* Model Context Protocol server that runs on stdio.
|
|
5
|
-
* External AI tools (Cursor, Claude) spawn this process and
|
|
5
|
+
* External AI tools (Cursor, Claude, Codex, etc.) spawn this process and
|
|
6
6
|
* communicate via stdin/stdout using the MCP protocol.
|
|
7
7
|
*
|
|
8
8
|
* Supports multiple indexed repositories via the global registry.
|
package/dist/mcp/server.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* MCP Server (Multi-Repo)
|
|
3
3
|
*
|
|
4
4
|
* Model Context Protocol server that runs on stdio.
|
|
5
|
-
* External AI tools (Cursor, Claude) spawn this process and
|
|
5
|
+
* External AI tools (Cursor, Claude, Codex, etc.) spawn this process and
|
|
6
6
|
* communicate via stdin/stdout using the MCP protocol.
|
|
7
7
|
*
|
|
8
8
|
* Supports multiple indexed repositories via the global registry.
|
package/package.json
CHANGED