@insforge/install 0.0.25 → 0.0.26
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 +15 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -98,18 +98,22 @@ import {
|
|
|
98
98
|
}
|
|
99
99
|
} else if (argv.client === "codex") {
|
|
100
100
|
// Use Codex CLI for Codex
|
|
101
|
+
const homeDir = os.homedir();
|
|
102
|
+
const isWindows = process.platform === 'win32';
|
|
103
|
+
const codexPath = isWindows
|
|
104
|
+
? path.join(homeDir, 'AppData', 'Roaming', 'npm', 'codex.cmd')
|
|
105
|
+
: 'codex';
|
|
106
|
+
|
|
101
107
|
const envArgs = Object.entries(envVars)
|
|
102
|
-
.
|
|
103
|
-
|
|
104
|
-
const quotedValue = value.includes(' ') ? `"${value}"` : value;
|
|
105
|
-
return `--env ${key}=${quotedValue}`;
|
|
106
|
-
})
|
|
108
|
+
.filter(([key]) => key !== 'CLIENT_NAME')
|
|
109
|
+
.map(([key, value]) => `--env ${key}=${value}`)
|
|
107
110
|
.join(' ');
|
|
108
|
-
|
|
111
|
+
|
|
109
112
|
try {
|
|
110
113
|
// First try to remove existing insforge MCP if it exists
|
|
111
114
|
try {
|
|
112
|
-
|
|
115
|
+
const removeCmd = isWindows ? `"${codexPath}" mcp remove ${name}` : `codex mcp remove ${name}`;
|
|
116
|
+
execSync(removeCmd, {
|
|
113
117
|
stdio: 'pipe',
|
|
114
118
|
shell: true
|
|
115
119
|
});
|
|
@@ -118,9 +122,11 @@ import {
|
|
|
118
122
|
// It's okay if remove fails - the MCP might not exist
|
|
119
123
|
logger.info("No existing insforge MCP found");
|
|
120
124
|
}
|
|
121
|
-
|
|
125
|
+
|
|
122
126
|
// Now add the MCP server using codex CLI with --env flags
|
|
123
|
-
const command =
|
|
127
|
+
const command = isWindows
|
|
128
|
+
? `"${codexPath}" mcp add ${name} ${envArgs} -- npx -y ${mcpVersion}`
|
|
129
|
+
: `codex mcp add ${name} ${envArgs} -- npx -y ${mcpVersion}`;
|
|
124
130
|
logger.info(`Adding insforge MCP server (${mcpVersion})...`);
|
|
125
131
|
execSync(command, {
|
|
126
132
|
stdio: 'inherit',
|