@insforge/install 0.0.8 → 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 CHANGED
@@ -76,7 +76,7 @@ import {
76
76
  logger.info("Removed existing insforge MCP installation.");
77
77
  } catch (removeError) {
78
78
  // It's okay if remove fails - the MCP might not exist
79
- logger.info("No existing insforge MCP found or removal skipped.");
79
+ logger.info("No existing insforge MCP found");
80
80
  }
81
81
 
82
82
  // Now add the MCP server
@@ -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 = {};
@@ -112,7 +145,7 @@ import {
112
145
  }
113
146
  };
114
147
  writeConfig(config, argv.client);
115
- } else if (argv.client === "cline" || argv.client === "roocode") {
148
+ } else if (argv.client === "cline" || argv.client === "roocode" || argv.client === "trae") {
116
149
  if (!config.mcpServers) config.mcpServers = {};
117
150
  config.mcpServers[name] = {
118
151
  command: "npx",
package/dist/utils.js CHANGED
@@ -48,6 +48,14 @@ var clientPaths = {
48
48
  roocode: {
49
49
  type: "file",
50
50
  path: path.join(baseDir, vscodePath, "rooveterinaryinc.roo-cline", "settings", "mcp_settings.json")
51
+ },
52
+ trae: {
53
+ type: "file",
54
+ path: path.join(baseDir, "Trae", "User", "mcp.json")
55
+ },
56
+ codex: {
57
+ type: "file",
58
+ path: path.join(homeDir, ".codex", "mcp_config.json")
51
59
  }
52
60
  };
53
61
  var clientNames = Object.keys(clientPaths);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/install",
3
- "version": "0.0.8",
3
+ "version": "0.0.11",
4
4
  "description": "CLI tool for installing Insforge MCP servers across different AI clients",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",