gitnexus 1.6.8-rc.23 → 1.6.8-rc.25

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
@@ -34,7 +34,7 @@ That's it. This indexes the codebase, installs agent skills, registers Claude Co
34
34
 
35
35
  To configure MCP for your editor, run `npx gitnexus setup` once — or set it up manually below.
36
36
 
37
- `gitnexus setup` auto-detects your editors and writes the correct global MCP config. You only need to run it once.
37
+ `gitnexus setup` auto-detects your editors and writes the correct global MCP config. You only need to run it once. To configure only selected integrations, pass `--coding-agent`/`-c` with a comma-separated list or repeat the option, for example `gitnexus setup -c cursor,codex`.
38
38
 
39
39
  ### Editor Support
40
40
 
@@ -158,7 +158,7 @@ Your AI agent gets these tools automatically:
158
158
  ## CLI Commands
159
159
 
160
160
  ```bash
161
- gitnexus setup # Configure MCP for your editors (one-time)
161
+ gitnexus setup # Configure MCP for detected editors (one-time; use -c to select)
162
162
  gitnexus uninstall # Preview removal of GitNexus MCP/skills/hooks (add --force to apply)
163
163
  gitnexus analyze [path] # Index a repository (or update stale index)
164
164
  gitnexus analyze --repair-fts # Fast path: rebuild/verify only FTS indexes on existing index data
@@ -42,6 +42,7 @@ const COMMAND_DESCRIPTION_KEYS = {
42
42
  };
43
43
  const OPTION_DESCRIPTION_KEYS = {
44
44
  '|-V, --version': 'help.option.version',
45
+ 'setup|-c, --coding-agent <agents>': 'help.option.setup.codingAgent',
45
46
  'analyze|-f, --force': 'help.option.analyze.force',
46
47
  'analyze|--repair-fts': 'help.option.analyze.repairFts',
47
48
  'analyze|--embeddings [limit]': 'help.option.analyze.embeddings',
@@ -138,6 +138,7 @@ export declare const en: {
138
138
  readonly 'help.command.group.impact.description': "Cross-repo impact for a symbol in one member repo of a group";
139
139
  readonly 'help.command.group.query.description': "Search execution flows across all repos in a group";
140
140
  readonly 'help.command.group.contracts.description': "Inspect Contract Registry";
141
+ readonly 'help.option.setup.codingAgent': "Configure only these coding agents (comma-separated or repeatable)";
141
142
  readonly 'help.option.analyze.force': "Force full re-index even if up to date";
142
143
  readonly 'help.option.analyze.repairFts': "Repair/rebuild search FTS indexes without full re-analysis";
143
144
  readonly 'help.option.analyze.embeddings': "Enable embedding generation for semantic search (off by default). Optional [limit] overrides the 50,000-node safety cap; pass 0 to disable the cap entirely.";
@@ -138,6 +138,7 @@ export const en = {
138
138
  'help.command.group.impact.description': 'Cross-repo impact for a symbol in one member repo of a group',
139
139
  'help.command.group.query.description': 'Search execution flows across all repos in a group',
140
140
  'help.command.group.contracts.description': 'Inspect Contract Registry',
141
+ 'help.option.setup.codingAgent': 'Configure only these coding agents (comma-separated or repeatable)',
141
142
  'help.option.analyze.force': 'Force full re-index even if up to date',
142
143
  'help.option.analyze.repairFts': 'Repair/rebuild search FTS indexes without full re-analysis',
143
144
  'help.option.analyze.embeddings': 'Enable embedding generation for semantic search (off by default). Optional [limit] overrides the 50,000-node safety cap; pass 0 to disable the cap entirely.',
@@ -139,6 +139,7 @@ export declare const cliResources: {
139
139
  readonly 'help.command.group.impact.description': "Cross-repo impact for a symbol in one member repo of a group";
140
140
  readonly 'help.command.group.query.description': "Search execution flows across all repos in a group";
141
141
  readonly 'help.command.group.contracts.description': "Inspect Contract Registry";
142
+ readonly 'help.option.setup.codingAgent': "Configure only these coding agents (comma-separated or repeatable)";
142
143
  readonly 'help.option.analyze.force': "Force full re-index even if up to date";
143
144
  readonly 'help.option.analyze.repairFts': "Repair/rebuild search FTS indexes without full re-analysis";
144
145
  readonly 'help.option.analyze.embeddings': "Enable embedding generation for semantic search (off by default). Optional [limit] overrides the 50,000-node safety cap; pass 0 to disable the cap entirely.";
@@ -365,6 +366,7 @@ export declare const cliResources: {
365
366
  'help.command.group.impact.description': string;
366
367
  'help.command.group.query.description': string;
367
368
  'help.command.group.contracts.description': string;
369
+ 'help.option.setup.codingAgent': string;
368
370
  'help.option.analyze.force': string;
369
371
  'help.option.analyze.repairFts': string;
370
372
  'help.option.analyze.embeddings': string;
@@ -138,6 +138,7 @@ export declare const zhCN: {
138
138
  'help.command.group.impact.description': string;
139
139
  'help.command.group.query.description': string;
140
140
  'help.command.group.contracts.description': string;
141
+ 'help.option.setup.codingAgent': string;
141
142
  'help.option.analyze.force': string;
142
143
  'help.option.analyze.repairFts': string;
143
144
  'help.option.analyze.embeddings': string;
@@ -138,6 +138,7 @@ export const zhCN = {
138
138
  'help.command.group.impact.description': '分析仓库组中某个成员仓库符号的跨仓库影响',
139
139
  'help.command.group.query.description': '跨仓库组所有仓库搜索执行流程',
140
140
  'help.command.group.contracts.description': '查看 Contract Registry',
141
+ 'help.option.setup.codingAgent': '仅配置这些编码代理(逗号分隔或重复传入)',
141
142
  'help.option.analyze.force': '即使已是最新也强制完整重建索引',
142
143
  'help.option.analyze.repairFts': '修复/重建搜索 FTS 索引,不执行完整重新分析',
143
144
  'help.option.analyze.embeddings': '启用语义搜索的嵌入生成(默认关闭)。可选 [limit] 覆盖 50,000 节点安全上限;传 0 可完全禁用上限。',
package/dist/cli/index.js CHANGED
@@ -10,10 +10,14 @@ import { t } from './i18n/index.js';
10
10
  const _require = createRequire(import.meta.url);
11
11
  const pkg = _require('../../package.json');
12
12
  const program = new Command();
13
+ function collectCodingAgents(value, previous) {
14
+ return [...(previous ?? []), ...value.split(',')];
15
+ }
13
16
  program.name('gitnexus').description('GitNexus local CLI and MCP server').version(pkg.version);
14
17
  program
15
18
  .command('setup')
16
19
  .description('One-time setup: configure MCP for Cursor, Claude Code, Antigravity, OpenCode, Codex')
20
+ .option('-c, --coding-agent <agents>', 'Configure only these coding agents (comma-separated or repeatable)', collectCodingAgents)
17
21
  .action(createLazyAction(() => import('./setup.js'), 'setupCommand'));
18
22
  program
19
23
  .command('uninstall')
@@ -37,5 +37,7 @@ interface SetupResult {
37
37
  * install paths copy this same list from hooks/claude/ (the canonical source).
38
38
  */
39
39
  export declare function copyHookHelpers(srcDir: string, destDir: string, label: string, result: SetupResult): Promise<string[]>;
40
- export declare const setupCommand: () => Promise<void>;
40
+ export declare const setupCommand: (options?: {
41
+ codingAgent?: string[] | string;
42
+ }) => Promise<void>;
41
43
  export {};
package/dist/cli/setup.js CHANGED
@@ -61,6 +61,33 @@ export function formatHookCommand(hookPath, isWindows = process.platform === 'wi
61
61
  // changes this literal, the guard records an actionable error instead of
62
62
  // silently shipping a hook with an unresolved relative cliPath.
63
63
  const CLI_PATH_SOURCE_LITERAL = "let cliPath = path.resolve(__dirname, '..', '..', 'dist', 'cli', 'index.js');";
64
+ const CODING_AGENT_IDS = {
65
+ cursor: 'cursor',
66
+ claude: 'claude',
67
+ antigravity: 'antigravity',
68
+ opencode: 'opencode',
69
+ codex: 'codex',
70
+ };
71
+ const SUPPORTED_CODING_AGENTS = Object.values(CODING_AGENT_IDS);
72
+ function selectedCodingAgents(values) {
73
+ if (values == null)
74
+ return new Set(SUPPORTED_CODING_AGENTS);
75
+ const rawValues = Array.isArray(values) ? values : [values];
76
+ const requested = rawValues
77
+ .flatMap((value) => value.split(','))
78
+ .map((value) => value.trim().toLowerCase())
79
+ .filter(Boolean);
80
+ const invalid = requested.filter((value) => !SUPPORTED_CODING_AGENTS.includes(value));
81
+ if (requested.length === 0 || invalid.length > 0) {
82
+ const detail = requested.length === 0
83
+ ? 'No coding agents were provided.'
84
+ : `Unknown: ${invalid.join(', ')}.`;
85
+ process.stderr.write(`${detail} Valid values: ${SUPPORTED_CODING_AGENTS.join(', ')}.\n`);
86
+ process.exitCode = 1;
87
+ return null;
88
+ }
89
+ return new Set(requested);
90
+ }
64
91
  /**
65
92
  * Resolve the absolute path to the `gitnexus` binary if it's installed
66
93
  * globally (or via npm -g / yarn global). Returns null when not found.
@@ -832,7 +859,11 @@ async function installCodexSkills(result) {
832
859
  }
833
860
  }
834
861
  // ─── Main command ──────────────────────────────────────────────────
835
- export const setupCommand = async () => {
862
+ export const setupCommand = async (options) => {
863
+ const explicitSelection = options?.codingAgent != null;
864
+ const selected = selectedCodingAgents(options?.codingAgent);
865
+ if (!selected)
866
+ return;
836
867
  console.log('');
837
868
  console.log(' GitNexus Setup');
838
869
  console.log(' ==============');
@@ -846,19 +877,31 @@ export const setupCommand = async () => {
846
877
  errors: [],
847
878
  };
848
879
  // Detect and configure each editor's MCP
849
- await setupCursor(result);
850
- await setupClaudeCode(result);
851
- await setupAntigravity(result);
852
- await setupOpenCode(result);
853
- await setupCodex(result);
880
+ if (selected.has('cursor'))
881
+ await setupCursor(result);
882
+ if (selected.has('claude'))
883
+ await setupClaudeCode(result);
884
+ if (selected.has('antigravity'))
885
+ await setupAntigravity(result);
886
+ if (selected.has('opencode'))
887
+ await setupOpenCode(result);
888
+ if (selected.has('codex'))
889
+ await setupCodex(result);
854
890
  // Install global skills for platforms that support them
855
- await installClaudeCodeSkills(result);
856
- await installClaudeCodeHooks(result);
857
- await installAntigravitySkills(result);
858
- await installAntigravityHooks(result);
859
- await installCursorSkills(result);
860
- await installOpenCodeSkills(result);
861
- await installCodexSkills(result);
891
+ if (selected.has('claude')) {
892
+ await installClaudeCodeSkills(result);
893
+ await installClaudeCodeHooks(result);
894
+ }
895
+ if (selected.has('antigravity')) {
896
+ await installAntigravitySkills(result);
897
+ await installAntigravityHooks(result);
898
+ }
899
+ if (selected.has('cursor'))
900
+ await installCursorSkills(result);
901
+ if (selected.has('opencode'))
902
+ await installOpenCodeSkills(result);
903
+ if (selected.has('codex'))
904
+ await installCodexSkills(result);
862
905
  // Print results
863
906
  if (result.configured.length > 0) {
864
907
  console.log(' Configured:');
@@ -884,10 +927,17 @@ export const setupCommand = async () => {
884
927
  console.log(' Summary:');
885
928
  console.log(` MCP configured for: ${result.configured.filter((c) => !c.includes('skills')).join(', ') || 'none'}`);
886
929
  console.log(` Skills installed to: ${result.configured.filter((c) => c.includes('skills')).length > 0 ? result.configured.filter((c) => c.includes('skills')).join(', ') : 'none'}`);
930
+ const configurationSucceeded = result.configured.length > 0;
931
+ if (explicitSelection && !configurationSucceeded) {
932
+ process.stderr.write('None of the explicitly selected coding agents were configured.\n');
933
+ process.exitCode = 1;
934
+ }
887
935
  console.log('');
888
- console.log(' Next steps:');
889
- console.log(' 1. cd into any git repo');
890
- console.log(' 2. Run: gitnexus analyze');
891
- console.log(' 3. Open the repo in your editor — MCP is ready!');
936
+ if (configurationSucceeded) {
937
+ console.log(' Next steps:');
938
+ console.log(' 1. cd into any git repo');
939
+ console.log(' 2. Run: gitnexus analyze');
940
+ console.log(' 3. Open the repo in your editor — MCP is ready!');
941
+ }
892
942
  console.log('');
893
943
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.8-rc.23",
3
+ "version": "1.6.8-rc.25",
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",