gitnexushub 0.2.3 → 0.2.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OpenCode Editor Setup
|
|
3
3
|
*
|
|
4
|
-
* Writes MCP config to ~/.config/opencode/
|
|
4
|
+
* Writes MCP config to ~/.config/opencode/opencode.json (under `mcp` key)
|
|
5
5
|
* Installs skills to ~/.config/opencode/skill/
|
|
6
6
|
*/
|
|
7
7
|
import type { EditorConfig } from './types.js';
|
package/dist/editors/opencode.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OpenCode Editor Setup
|
|
3
3
|
*
|
|
4
|
-
* Writes MCP config to ~/.config/opencode/
|
|
4
|
+
* Writes MCP config to ~/.config/opencode/opencode.json (under `mcp` key)
|
|
5
5
|
* Installs skills to ~/.config/opencode/skill/
|
|
6
6
|
*/
|
|
7
7
|
import os from 'os';
|
|
@@ -11,13 +11,13 @@ import { readJsonFile, writeJsonFile } from '../utils.js';
|
|
|
11
11
|
import { HUB_SKILLS } from '../content.js';
|
|
12
12
|
function getMcpConfig(hubUrl, token) {
|
|
13
13
|
return {
|
|
14
|
-
type: '
|
|
14
|
+
type: 'remote',
|
|
15
15
|
url: `${hubUrl}/mcp`,
|
|
16
16
|
headers: { Authorization: `Bearer ${token}` },
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
async function configure(hubUrl, token) {
|
|
20
|
-
const configPath = path.join(os.homedir(), '.config', 'opencode', '
|
|
20
|
+
const configPath = path.join(os.homedir(), '.config', 'opencode', 'opencode.json');
|
|
21
21
|
try {
|
|
22
22
|
const existing = (await readJsonFile(configPath)) || {};
|
|
23
23
|
if (!existing.mcp || typeof existing.mcp !== 'object') {
|
|
@@ -25,7 +25,7 @@ async function configure(hubUrl, token) {
|
|
|
25
25
|
}
|
|
26
26
|
existing.mcp.gitnexus = getMcpConfig(hubUrl, token);
|
|
27
27
|
await writeJsonFile(configPath, existing);
|
|
28
|
-
return { success: true, message: 'MCP configured in ~/.config/opencode/
|
|
28
|
+
return { success: true, message: 'MCP configured in ~/.config/opencode/opencode.json' };
|
|
29
29
|
}
|
|
30
30
|
catch (err) {
|
|
31
31
|
return { success: false, message: `Failed: ${err.message}` };
|
|
@@ -48,14 +48,14 @@ async function installSkills(skills) {
|
|
|
48
48
|
return installed;
|
|
49
49
|
}
|
|
50
50
|
async function unconfigure() {
|
|
51
|
-
const configPath = path.join(os.homedir(), '.config', 'opencode', '
|
|
51
|
+
const configPath = path.join(os.homedir(), '.config', 'opencode', 'opencode.json');
|
|
52
52
|
try {
|
|
53
53
|
const existing = await readJsonFile(configPath);
|
|
54
54
|
if (existing?.mcp?.gitnexus) {
|
|
55
55
|
delete existing.mcp.gitnexus;
|
|
56
56
|
await writeJsonFile(configPath, existing);
|
|
57
57
|
}
|
|
58
|
-
return { success: true, message: 'MCP removed from ~/.config/opencode/
|
|
58
|
+
return { success: true, message: 'MCP removed from ~/.config/opencode/opencode.json' };
|
|
59
59
|
}
|
|
60
60
|
catch (err) {
|
|
61
61
|
return { success: false, message: `Failed: ${err.message}` };
|
package/dist/editors/windsurf.js
CHANGED
|
@@ -11,8 +11,7 @@ import { readJsonFile, writeJsonFile } from '../utils.js';
|
|
|
11
11
|
import { HUB_SKILLS } from '../content.js';
|
|
12
12
|
function getMcpConfig(hubUrl, token) {
|
|
13
13
|
return {
|
|
14
|
-
|
|
15
|
-
url: `${hubUrl}/mcp`,
|
|
14
|
+
serverUrl: `${hubUrl}/mcp`,
|
|
16
15
|
headers: { Authorization: `Bearer ${token}` },
|
|
17
16
|
};
|
|
18
17
|
}
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,11 @@
|
|
|
7
7
|
* disconnect Remove all GitNexus config, skills, and project files
|
|
8
8
|
* index Trigger indexing for a GitHub repo on the Hub
|
|
9
9
|
*/
|
|
10
|
+
import { createRequire } from 'module';
|
|
10
11
|
import { Command } from 'commander';
|
|
11
12
|
import pc from 'picocolors';
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
const PKG_VERSION = require('../package.json').version;
|
|
12
15
|
import { loadConfig, saveConfig, clearConfig } from './config.js';
|
|
13
16
|
import { HubAPI } from './api.js';
|
|
14
17
|
import { isGitRepo, getGitRemoteUrl, parseGitRemote, matchRepo } from './project.js';
|
|
@@ -84,7 +87,7 @@ const program = new Command();
|
|
|
84
87
|
program
|
|
85
88
|
.name('gnx')
|
|
86
89
|
.description('Connect your editor to GitNexus Hub')
|
|
87
|
-
.version(
|
|
90
|
+
.version(PKG_VERSION);
|
|
88
91
|
// ─── Default command: connect ─────────────────────────────────────
|
|
89
92
|
const connectOpts = (cmd) => cmd
|
|
90
93
|
.argument('[token]', 'gnx_ API token (optional if already saved)')
|
package/package.json
CHANGED