@insforge/install 0.0.10 → 0.0.11
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 +33 -0
- package/dist/utils.js +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -89,6 +89,39 @@ import {
|
|
|
89
89
|
} catch (error) {
|
|
90
90
|
throw new Error(`Failed to add MCP server via Claude CLI: ${error.message}`);
|
|
91
91
|
}
|
|
92
|
+
} else if (argv.client === "codex") {
|
|
93
|
+
// Use Codex CLI for Codex
|
|
94
|
+
const envArgs = Object.entries(envVars)
|
|
95
|
+
.map(([key, value]) => {
|
|
96
|
+
// Properly quote values for cross-platform compatibility
|
|
97
|
+
const quotedValue = value.includes(' ') ? `"${value}"` : value;
|
|
98
|
+
return `--env ${key}=${quotedValue}`;
|
|
99
|
+
})
|
|
100
|
+
.join(' ');
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
// First try to remove existing insforge MCP if it exists
|
|
104
|
+
try {
|
|
105
|
+
execSync(`codex mcp remove ${name}`, {
|
|
106
|
+
stdio: 'pipe',
|
|
107
|
+
shell: true
|
|
108
|
+
});
|
|
109
|
+
logger.info("Removed existing insforge MCP installation.");
|
|
110
|
+
} catch (removeError) {
|
|
111
|
+
// It's okay if remove fails - the MCP might not exist
|
|
112
|
+
logger.info("No existing insforge MCP found");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Now add the MCP server using codex CLI with --env flags
|
|
116
|
+
const command = `codex mcp add ${name} ${envArgs} -- npx -y @insforge/insforge-mcp@latest`;
|
|
117
|
+
logger.info("Adding insforge MCP server...");
|
|
118
|
+
execSync(command, {
|
|
119
|
+
stdio: 'inherit',
|
|
120
|
+
shell: true
|
|
121
|
+
});
|
|
122
|
+
} catch (error) {
|
|
123
|
+
throw new Error(`Failed to add MCP server via Codex CLI: ${error.message}`);
|
|
124
|
+
}
|
|
92
125
|
} else if (argv.client === "cursor") {
|
|
93
126
|
// Cursor uses mcpServers at root level
|
|
94
127
|
if (!config.mcpServers) config.mcpServers = {};
|
package/dist/utils.js
CHANGED