igel-qe-core 1.0.1 → 1.0.3

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/cli/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { Command } from "commander";
3
3
  import chalk from "chalk";
4
4
  import { spawn } from "child_process";
5
+ import { setupPlatform } from "./platform.js";
5
6
  const program = new Command();
6
7
  program
7
8
  .name("igel-qe")
@@ -10,7 +11,11 @@ program
10
11
  program
11
12
  .command("init")
12
13
  .description("Bootstrap the Python AI Platform Layer")
13
- .action(async () => {
14
+ .option("--with-copilot", "Auto-configure for GitHub Copilot in VS Code")
15
+ .option("--with-cline", "Auto-configure for Cline")
16
+ .option("--with-antigravity", "Auto-configure for Antigravity (Gemini Code Assist)")
17
+ .option("--with-all", "Auto-configure all supported platforms")
18
+ .action(async (options) => {
14
19
  console.log(chalk.blue("Initializing IGEL QE AI Platform..."));
15
20
  const steps = [
16
21
  "1. Checking Python version...",
@@ -27,7 +32,16 @@ program
27
32
  console.log(chalk.green(` ✓ Done`));
28
33
  }
29
34
  console.log(chalk.bold.green("\nIGEL QE AI Platform successfully initialized!"));
30
- console.log(`You can now use GitHub Copilot to invoke MCP tools or run commands via this CLI.`);
35
+ if (options.withCopilot || options.withAll) {
36
+ await setupPlatform('copilot');
37
+ }
38
+ if (options.withCline || options.withAll) {
39
+ await setupPlatform('cline');
40
+ }
41
+ if (options.withAntigravity || options.withAll) {
42
+ await setupPlatform('antigravity');
43
+ }
44
+ console.log(`You can now use GitHub Copilot, Cline, or Antigravity to invoke MCP tools or run commands via this CLI.`);
31
45
  });
32
46
  program
33
47
  .command("sync")
@@ -59,4 +73,14 @@ program
59
73
  });
60
74
  });
61
75
  });
76
+ const platformCmd = program
77
+ .command("platform")
78
+ .description("Manage coding agent platform configurations");
79
+ platformCmd
80
+ .command("setup <platform>")
81
+ .description("Setup an MCP configuration for a specific platform (copilot, cline)")
82
+ .action(async (platform) => {
83
+ console.log(chalk.blue(`Setting up configuration for ${platform}...`));
84
+ await setupPlatform(platform);
85
+ });
62
86
  program.parse();
@@ -0,0 +1,90 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import * as os from 'os';
4
+ import chalk from 'chalk';
5
+ export async function setupPlatform(platform) {
6
+ const homeDir = os.homedir();
7
+ // The command we want to inject
8
+ const mcpServerConfig = {
9
+ command: process.platform === 'win32' ? 'igel-qe-mcp.cmd' : 'igel-qe-mcp',
10
+ args: []
11
+ };
12
+ try {
13
+ if (platform === 'copilot') {
14
+ // Setup for GitHub Copilot in VS Code
15
+ // VS Code user settings on Windows usually live in AppData/Roaming/Code/User
16
+ let vscodeSettingsPath = path.join(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'settings.json');
17
+ if (process.platform !== 'win32') {
18
+ vscodeSettingsPath = path.join(homeDir, '.config', 'Code', 'User', 'settings.json');
19
+ }
20
+ let settings = {};
21
+ if (fs.existsSync(vscodeSettingsPath)) {
22
+ const raw = fs.readFileSync(vscodeSettingsPath, 'utf8');
23
+ try {
24
+ settings = JSON.parse(raw);
25
+ }
26
+ catch (e) { /* ignore parse error for now */ }
27
+ }
28
+ else {
29
+ fs.mkdirSync(path.dirname(vscodeSettingsPath), { recursive: true });
30
+ }
31
+ if (!settings['github.copilot.chat.mcp.servers']) {
32
+ settings['github.copilot.chat.mcp.servers'] = {};
33
+ }
34
+ settings['github.copilot.chat.mcp.servers']['igel-qe'] = mcpServerConfig;
35
+ fs.writeFileSync(vscodeSettingsPath, JSON.stringify(settings, null, 2));
36
+ console.log(chalk.green(`✓ Successfully configured GitHub Copilot MCP in ${vscodeSettingsPath}`));
37
+ }
38
+ else if (platform === 'cline') {
39
+ // Setup for Cline (Claude Dev)
40
+ let clineConfigPath = path.join(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
41
+ if (process.platform !== 'win32') {
42
+ clineConfigPath = path.join(homeDir, '.config', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
43
+ }
44
+ let settings = { mcpServers: {} };
45
+ if (fs.existsSync(clineConfigPath)) {
46
+ const raw = fs.readFileSync(clineConfigPath, 'utf8');
47
+ try {
48
+ settings = JSON.parse(raw);
49
+ }
50
+ catch (e) { /* ignore parse error */ }
51
+ }
52
+ else {
53
+ fs.mkdirSync(path.dirname(clineConfigPath), { recursive: true });
54
+ }
55
+ settings.mcpServers['igel-qe'] = mcpServerConfig;
56
+ fs.writeFileSync(clineConfigPath, JSON.stringify(settings, null, 2));
57
+ console.log(chalk.green(`✓ Successfully configured Cline MCP in ${clineConfigPath}`));
58
+ }
59
+ else if (platform === 'antigravity') {
60
+ // Setup for Antigravity (Gemini Code Assist / AI)
61
+ let vscodeSettingsPath = path.join(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'settings.json');
62
+ if (process.platform !== 'win32') {
63
+ vscodeSettingsPath = path.join(homeDir, '.config', 'Code', 'User', 'settings.json');
64
+ }
65
+ let settings = {};
66
+ if (fs.existsSync(vscodeSettingsPath)) {
67
+ const raw = fs.readFileSync(vscodeSettingsPath, 'utf8');
68
+ try {
69
+ settings = JSON.parse(raw);
70
+ }
71
+ catch (e) { /* ignore */ }
72
+ }
73
+ else {
74
+ fs.mkdirSync(path.dirname(vscodeSettingsPath), { recursive: true });
75
+ }
76
+ if (!settings['gemini.mcp.servers']) {
77
+ settings['gemini.mcp.servers'] = {};
78
+ }
79
+ settings['gemini.mcp.servers']['igel-qe'] = mcpServerConfig;
80
+ fs.writeFileSync(vscodeSettingsPath, JSON.stringify(settings, null, 2));
81
+ console.log(chalk.green(`✓ Successfully configured Antigravity MCP in ${vscodeSettingsPath}`));
82
+ }
83
+ else {
84
+ console.log(chalk.yellow(`Platform '${platform}' is not currently supported for auto-setup.`));
85
+ }
86
+ }
87
+ catch (err) {
88
+ console.error(chalk.red(`Failed to setup ${platform}: ${err.message}`));
89
+ }
90
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igel-qe-core",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "IGEL QE Developer Experience Layer (CLI & MCP)",
5
5
  "type": "module",
6
6
  "publishConfig": {