opencode-azure-setup 1.0.4 → 1.0.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/index.js +11 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -368,18 +368,22 @@ async function main() {
|
|
|
368
368
|
console.log();
|
|
369
369
|
console.log(colors.blue + 'Setting up MCP Marketplace...' + colors.reset);
|
|
370
370
|
|
|
371
|
-
const mcpDir = path.join(os.homedir(), '.config', 'opencode', 'mcps');
|
|
371
|
+
const mcpDir = path.join(os.homedir(), '.config', 'opencode', 'mcps', 'mcp-marketplace');
|
|
372
372
|
fs.mkdirSync(mcpDir, { recursive: true });
|
|
373
373
|
|
|
374
374
|
try {
|
|
375
375
|
const { execFileSync } = await import('child_process');
|
|
376
376
|
|
|
377
|
-
//
|
|
378
|
-
|
|
377
|
+
// Initialize package.json if not exists
|
|
378
|
+
const pkgPath = path.join(mcpDir, 'package.json');
|
|
379
|
+
if (!fs.existsSync(pkgPath)) {
|
|
380
|
+
fs.writeFileSync(pkgPath, JSON.stringify({ name: 'opencode-mcps', version: '1.0.0', type: 'module' }, null, 2));
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Install mcp-marketplace package locally (no sudo needed)
|
|
384
|
+
execFileSync('npm', ['install', 'opencode-mcp-marketplace@latest'], { cwd: mcpDir, stdio: 'pipe' });
|
|
379
385
|
|
|
380
|
-
|
|
381
|
-
const npmRoot = execFileSync('npm', ['root', '-g'], { encoding: 'utf-8' }).trim();
|
|
382
|
-
const mcpPath = path.join(npmRoot, 'opencode-mcp-marketplace', 'dist', 'index.js');
|
|
386
|
+
const mcpPath = path.join(mcpDir, 'node_modules', 'opencode-mcp-marketplace', 'dist', 'index.js');
|
|
383
387
|
|
|
384
388
|
// Add to config
|
|
385
389
|
config.mcp = config.mcp || {};
|
|
@@ -391,6 +395,7 @@ async function main() {
|
|
|
391
395
|
console.log(colors.green + '✓ MCP Marketplace installed!' + colors.reset);
|
|
392
396
|
} catch (e) {
|
|
393
397
|
console.log(colors.yellow + '⚠ MCP Marketplace install skipped (npm not available or failed)' + colors.reset);
|
|
398
|
+
console.log(colors.dim + ' You can install manually: npm install -g opencode-mcp-marketplace' + colors.reset);
|
|
394
399
|
}
|
|
395
400
|
|
|
396
401
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|