@insforge/install 0.0.43 → 0.0.45

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
@@ -234,6 +234,38 @@ import {
234
234
  }
235
235
  };
236
236
  writeConfig(config, argv.client);
237
+ } else if (argv.client === "copilot") {
238
+ // Copilot uses "servers" instead of "mcpServers"
239
+ const fs = await import('fs');
240
+ const vscodeDir = path.join(process.cwd(), '.vscode');
241
+ const mcpConfigPath = path.join(vscodeDir, 'mcp.json');
242
+
243
+ if (!fs.existsSync(vscodeDir)) {
244
+ fs.mkdirSync(vscodeDir, { recursive: true });
245
+ }
246
+
247
+ let copilotConfig = { servers: {} };
248
+ if (fs.existsSync(mcpConfigPath)) {
249
+ try {
250
+ copilotConfig = JSON.parse(fs.readFileSync(mcpConfigPath, 'utf8'));
251
+ if (!copilotConfig.servers) copilotConfig.servers = {};
252
+ } catch (error) {
253
+ logger.warn(`Could not parse existing mcp.json: ${error.message}`);
254
+ copilotConfig = { servers: {} };
255
+ }
256
+ }
257
+
258
+ copilotConfig.servers[name] = {
259
+ command: "npx",
260
+ args: ["-y", mcpVersion],
261
+ env: {
262
+ API_KEY: envVars.API_KEY,
263
+ API_BASE_URL: envVars.API_BASE_URL
264
+ }
265
+ };
266
+
267
+ fs.writeFileSync(mcpConfigPath, JSON.stringify(copilotConfig, null, 2));
268
+ logger.info(`Configured Copilot MCP at: ${mcpConfigPath}`);
237
269
  }
238
270
 
239
271
  // Fetch instructions documentation and save to appropriate files
@@ -254,7 +286,7 @@ import {
254
286
  logger.warn(`Could not download instructions: ${fetchError.message}`);
255
287
  }
256
288
 
257
- // Save instructions to appropriate files based on client
289
+ // Save instructions to agent.md for all clients
258
290
  if (instructionsContent) {
259
291
  const fs = await import('fs');
260
292
  const frontmatter = `---
@@ -265,25 +297,9 @@ alwaysApply: true
265
297
 
266
298
  `;
267
299
  const contentWithFrontmatter = frontmatter + instructionsContent;
268
-
269
- // Save CLAUDE.md for claude-code client
270
- if (argv.client === "claude-code") {
271
- const claudeMdPath = path.join(process.cwd(), 'CLAUDE.md');
272
- fs.writeFileSync(claudeMdPath, contentWithFrontmatter, 'utf-8');
273
- logger.info(`Saved instructions to: ${claudeMdPath}`);
274
- }
275
-
276
- // Save cursor rules for cursor client
277
- if (argv.client === "cursor") {
278
- const cursorRulesDir = path.join(process.cwd(), '.cursor', 'rules');
279
- const cursorRulesPath = path.join(cursorRulesDir, 'cursor-rules.mdc');
280
-
281
- if (!fs.existsSync(cursorRulesDir)) {
282
- fs.mkdirSync(cursorRulesDir, { recursive: true });
283
- }
284
- fs.writeFileSync(cursorRulesPath, contentWithFrontmatter, 'utf-8');
285
- logger.info(`Saved cursor rules to: ${cursorRulesPath}`);
286
- }
300
+ const agentsMdPath = path.join(process.cwd(), 'AGENTS.md');
301
+ fs.writeFileSync(agentsMdPath, contentWithFrontmatter, 'utf-8');
302
+ logger.info(`Saved instructions to: ${agentsMdPath}`);
287
303
  }
288
304
 
289
305
  printHeader('Setup Complete!');
package/dist/utils.js CHANGED
@@ -56,6 +56,10 @@ var clientPaths = {
56
56
  codex: {
57
57
  type: "file",
58
58
  path: path.join(homeDir, ".codex", "mcp_config.json")
59
+ },
60
+ copilot: {
61
+ type: "file",
62
+ path: path.join(process.cwd(), ".vscode", "mcp.json")
59
63
  }
60
64
  };
61
65
  var clientNames = Object.keys(clientPaths);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/install",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "CLI tool for installing Insforge MCP servers across different AI clients",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",