@insforge/install 0.0.18 → 0.0.19
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/dist/index.js +36 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -56,17 +56,43 @@ import {
|
|
|
56
56
|
|
|
57
57
|
// Handle different config structures for different clients
|
|
58
58
|
if (argv.client === "claude-code") {
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
// Use Claude CLI for Claude Code
|
|
60
|
+
const os = require('os');
|
|
61
|
+
const path = require('path');
|
|
62
|
+
const homeDir = os.homedir();
|
|
63
|
+
const isWindows = process.platform === 'win32';
|
|
64
|
+
const claudePath = isWindows
|
|
65
|
+
? path.join(homeDir, '.claude', 'local', 'claude.exe')
|
|
66
|
+
: path.join(homeDir, '.claude', 'local', 'claude');
|
|
67
|
+
|
|
68
|
+
const envArgs = Object.entries(envVars)
|
|
69
|
+
.filter(([key]) => key !== 'CLIENT_NAME')
|
|
70
|
+
.map(([key, value]) => `-e ${key}=${value}`)
|
|
71
|
+
.join(' ');
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
// First try to remove existing insforge MCP if it exists
|
|
75
|
+
try {
|
|
76
|
+
execSync(`"${claudePath}" mcp remove ${name}`, {
|
|
77
|
+
stdio: 'pipe',
|
|
78
|
+
shell: true
|
|
79
|
+
});
|
|
80
|
+
logger.info("Removed existing insforge MCP installation.");
|
|
81
|
+
} catch (removeError) {
|
|
82
|
+
// It's okay if remove fails - the MCP might not exist
|
|
83
|
+
logger.info("No existing insforge MCP found");
|
|
67
84
|
}
|
|
68
|
-
|
|
69
|
-
|
|
85
|
+
|
|
86
|
+
// Now add the MCP server
|
|
87
|
+
const command = `"${claudePath}" mcp add ${name} ${envArgs} -- npx -y @insforge/mcp@latest`;
|
|
88
|
+
logger.info("Adding insforge MCP server...");
|
|
89
|
+
execSync(command, {
|
|
90
|
+
stdio: 'inherit',
|
|
91
|
+
shell: true
|
|
92
|
+
});
|
|
93
|
+
} catch (error) {
|
|
94
|
+
throw new Error(`Failed to add MCP server via Claude CLI: ${error.message}`);
|
|
95
|
+
}
|
|
70
96
|
} else if (argv.client === "codex") {
|
|
71
97
|
// Use Codex CLI for Codex
|
|
72
98
|
const envArgs = Object.entries(envVars)
|