supermind-claude 2.0.0

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/.env.example ADDED
@@ -0,0 +1,5 @@
1
+ # Copy this to .env and fill in your keys
2
+ # DO NOT commit .env to git
3
+
4
+ TAVILY_API_KEY=your_tavily_api_key_here
5
+ TWENTYFIRST_API_KEY=your_21st_dev_api_key_here
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # Supermind
2
+
3
+ Complete, opinionated Claude Code setup — hooks, skills, status line, MCP servers, and living documentation.
4
+
5
+ ## Quick Install
6
+
7
+ ```bash
8
+ npx supermind-claude
9
+ ```
10
+
11
+ Or give Claude Code the repo URL and it will figure out the setup.
12
+
13
+ ## What Gets Installed
14
+
15
+ | Component | Location | Purpose |
16
+ |-----------|----------|---------|
17
+ | Hooks | ~/.claude/hooks/ | Session persistence, bash permissions, status line, cost tracking |
18
+ | Skills | ~/.claude/skills/ | /supermind-init, /supermind-living-docs |
19
+ | Plugins | settings.json | Superpowers, frontend-design, claude-md-management, ui-ux-pro-max |
20
+ | Settings | settings.json | Thinking mode, effort level, hook registration |
21
+ | Templates | ~/.claude/templates/ | CLAUDE.md project template |
22
+
23
+ ## Project Setup
24
+
25
+ After installing, run `/supermind-init` in any project to:
26
+ 1. Create or merge CLAUDE.md with project-specific config
27
+ 2. Generate ARCHITECTURE.md (and DESIGN.md for UI projects)
28
+ 3. Check setup health and discover relevant tools
29
+
30
+ ## Living Documentation
31
+
32
+ - **Auto-read**: Session-start hook reads ARCHITECTURE.md and DESIGN.md at every conversation start
33
+ - **Manual sync**: Run `/supermind-living-docs` to update docs after code changes
34
+
35
+ ## Status Line
36
+
37
+ Two-line terminal display showing: user, model, path, git branch, context usage, thinking level, active agents, and session cost.
38
+
39
+ ## MCP Servers
40
+
41
+ Choose during setup:
42
+ - **Docker** (AIRIS gateway): Single endpoint routing to context7, playwright, serena, tavily, chrome-devtools, shadcn
43
+ - **Direct**: Individual servers via npx/uvx
44
+
45
+ ## Commands
46
+
47
+ | Command | Purpose |
48
+ |---------|---------|
49
+ | `npx supermind-claude` | Full global setup |
50
+ | `npx supermind-claude update` | Refresh hooks, skills, templates |
51
+ | `npx supermind-claude doctor` | Verify installation health |
52
+ | `npx supermind-claude uninstall` | Remove all components |
53
+ | `npx supermind-claude approve "cmd"` | Permanently auto-approve a command |
54
+
55
+ ## Approved Commands
56
+
57
+ Permanently auto-approve specific commands that the bash-permissions hook would normally flag:
58
+
59
+ ```bash
60
+ npx supermind-claude approve "git push" # exact/prefix match
61
+ npx supermind-claude approve "/npm run .*/" # regex match
62
+ npx supermind-claude approve --list # see all approved
63
+ npx supermind-claude approve --remove "git push" # remove approval
64
+ ```
65
+
66
+ Or tell Claude: "add that to my approved commands" — it knows how to edit the file directly.
67
+
68
+ ## Platforms
69
+
70
+ Windows, macOS, and Linux. Requires Node.js >= 18.
71
+
72
+ ## Troubleshooting
73
+
74
+ Run `npx supermind-claude doctor` to check installation health. Common issues:
75
+ - **Plugins not active**: Restart Claude Code after install
76
+ - **Status line not showing**: Ensure Node.js is in PATH
77
+ - **Hooks not firing**: Run `npx supermind-claude update` to re-register
@@ -0,0 +1,76 @@
1
+ # AIRIS MCP Gateway - Distribution Version
2
+ # Usage: cd ~/.claude/airis && docker compose up -d
3
+
4
+ name: airis-mcp-gateway
5
+
6
+ services:
7
+ # Serena MCP Server (semantic code retrieval)
8
+ serena:
9
+ container_name: airis-serena
10
+ image: ghcr.io/oraios/serena:latest
11
+ command:
12
+ - serena
13
+ - start-mcp-server
14
+ - --transport
15
+ - sse
16
+ - --port
17
+ - "8000"
18
+ - --context
19
+ - claude-code
20
+ expose:
21
+ - "8000"
22
+ volumes:
23
+ - ${HOST_WORKSPACE_DIR:-~/github}:/workspaces/projects:rw
24
+ healthcheck:
25
+ test: ["CMD-SHELL", "curl -f http://localhost:8000/health 2>/dev/null || exit 0"]
26
+ interval: 30s
27
+ timeout: 10s
28
+ retries: 3
29
+ start_period: 30s
30
+ restart: unless-stopped
31
+
32
+ # Docker MCP Gateway (manages MCP servers from Docker catalog)
33
+ gateway:
34
+ container_name: airis-mcp-gateway-core
35
+ image: docker/mcp-gateway:latest
36
+ command:
37
+ - --transport=sse
38
+ - --port=9390
39
+ - --watch
40
+ - --servers=time
41
+ expose:
42
+ - "9390"
43
+ volumes:
44
+ - /var/run/docker.sock:/var/run/docker.sock
45
+ - ${HOST_WORKSPACE_DIR:-~/github}:/workspace:rw
46
+ healthcheck:
47
+ test: ["CMD-SHELL", "wget -qS --spider http://localhost:9390/health 2>&1 | grep -q '200'"]
48
+ interval: 10s
49
+ timeout: 3s
50
+ retries: 5
51
+ restart: unless-stopped
52
+
53
+ # FastAPI Proxy (MCP Multiplexer)
54
+ api:
55
+ container_name: airis-mcp-gateway
56
+ image: ghcr.io/agiletec-inc/airis-mcp-gateway:latest
57
+ ports:
58
+ - "9400:8000"
59
+ environment:
60
+ - MCP_GATEWAY_URL=http://gateway:9390
61
+ - MCP_CONFIG_PATH=/app/mcp-config.json
62
+ - AIRIS_MODE=${AIRIS_MODE:-embedded}
63
+
64
+ - TAVILY_API_KEY=${TAVILY_API_KEY:-}
65
+ volumes:
66
+ - ./mcp-config.json:/app/mcp-config.json:ro
67
+ - ./profiles:/app/profiles:rw
68
+ depends_on:
69
+ gateway:
70
+ condition: service_healthy
71
+ healthcheck:
72
+ test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
73
+ interval: 10s
74
+ timeout: 3s
75
+ retries: 5
76
+ restart: unless-stopped
@@ -0,0 +1,43 @@
1
+ {
2
+ "mcpServers": {
3
+ "context7": {
4
+ "command": "npx",
5
+ "args": ["-y", "@upstash/context7-mcp"],
6
+ "enabled": true,
7
+ "mode": "cold"
8
+ },
9
+ "playwright": {
10
+ "command": "npx",
11
+ "args": ["-y", "@playwright/mcp@latest"],
12
+ "enabled": true,
13
+ "mode": "cold"
14
+ },
15
+ "serena": {
16
+ "command": "uvx",
17
+ "args": ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "claude-code", "--enable-web-dashboard", "false", "--enable-gui-log-window", "false"],
18
+ "enabled": true,
19
+ "mode": "cold"
20
+ },
21
+ "tavily": {
22
+ "command": "npx",
23
+ "args": ["-y", "tavily-mcp@0.1.2"],
24
+ "enabled": true,
25
+ "mode": "cold",
26
+ "env": {
27
+ "TAVILY_API_KEY": "${TAVILY_API_KEY}"
28
+ }
29
+ },
30
+ "chrome-devtools": {
31
+ "command": "npx",
32
+ "args": ["-y", "chrome-devtools-mcp@latest"],
33
+ "enabled": true,
34
+ "mode": "cold"
35
+ },
36
+ "shadcn": {
37
+ "command": "npx",
38
+ "args": ["-y", "shadcn@latest", "mcp"],
39
+ "enabled": true,
40
+ "mode": "cold"
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const { PATHS } = require('../lib/platform');
6
+ const logger = require('../lib/logger');
7
+
8
+ const APPROVED_FILE = path.join(PATHS.claudeHome, 'supermind-approved.json');
9
+
10
+ function loadApproved() {
11
+ try {
12
+ const data = JSON.parse(fs.readFileSync(APPROVED_FILE, 'utf-8'));
13
+ return Array.isArray(data) ? data : [];
14
+ } catch {
15
+ return [];
16
+ }
17
+ }
18
+
19
+ function saveApproved(list) {
20
+ fs.writeFileSync(APPROVED_FILE, JSON.stringify(list, null, 2) + '\n');
21
+ }
22
+
23
+ module.exports = function approve(flags) {
24
+ const args = process.argv.slice(3).filter(a => !a.startsWith('-'));
25
+
26
+ // supermind-claude approve --list
27
+ if (flags.list || args.length === 0) {
28
+ const approved = loadApproved();
29
+ if (approved.length === 0) {
30
+ console.log('\n No approved commands. Add one with:\n');
31
+ console.log(' supermind-claude approve "git push"');
32
+ console.log(' supermind-claude approve "/npm run .*/"\n');
33
+ return;
34
+ }
35
+ console.log('\n Approved commands:\n');
36
+ for (const cmd of approved) {
37
+ logger.success(cmd);
38
+ }
39
+ console.log('');
40
+ return;
41
+ }
42
+
43
+ // supermind-claude approve --remove "pattern"
44
+ if (flags.remove) {
45
+ const pattern = args[0];
46
+ if (!pattern) {
47
+ logger.error('Specify the command to remove: supermind-claude approve --remove "git push"');
48
+ return;
49
+ }
50
+ const approved = loadApproved();
51
+ const filtered = approved.filter(c => c !== pattern);
52
+ if (filtered.length === approved.length) {
53
+ logger.warn(`"${pattern}" not found in approved commands`);
54
+ return;
55
+ }
56
+ saveApproved(filtered);
57
+ logger.success(`Removed: ${pattern}`);
58
+ return;
59
+ }
60
+
61
+ // supermind-claude approve "command"
62
+ const pattern = args[0];
63
+ const approved = loadApproved();
64
+ if (approved.includes(pattern)) {
65
+ logger.info(`Already approved: ${pattern}`);
66
+ return;
67
+ }
68
+ approved.push(pattern);
69
+ saveApproved(approved);
70
+ logger.success(`Approved: ${pattern}`);
71
+ logger.info('This command will now be auto-allowed by bash-permissions hook');
72
+ };
@@ -0,0 +1,101 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const { PATHS } = require('../lib/platform');
6
+ const logger = require('../lib/logger');
7
+ const { readSettings, SUPERMIND_PLUGINS } = require('../lib/settings');
8
+ const { getHookFiles } = require('../lib/hooks');
9
+ const { getSkillDirs } = require('../lib/skills');
10
+ const { version } = require('../../package.json');
11
+
12
+ function check(label, pass, detail) {
13
+ if (pass) {
14
+ logger.success(label);
15
+ } else {
16
+ logger.error(`${label}${detail ? ' \u2014 ' + detail : ''}`);
17
+ }
18
+ return pass;
19
+ }
20
+
21
+ module.exports = function doctor(flags) {
22
+ logger.banner();
23
+ console.log(' Running health checks...\n');
24
+
25
+ let passed = 0;
26
+ let failed = 0;
27
+
28
+ function run(label, pass, detail) {
29
+ if (check(label, pass, detail)) passed++;
30
+ else failed++;
31
+ }
32
+
33
+ // Node.js version
34
+ const nodeVersion = parseInt(process.versions.node.split('.')[0], 10);
35
+ run('Node.js >= 18', nodeVersion >= 18, `found v${process.versions.node}`);
36
+
37
+ // Claude home
38
+ run('~/.claude/ exists', fs.existsSync(PATHS.claudeHome));
39
+
40
+ // Settings
41
+ const settingsExists = fs.existsSync(PATHS.settings);
42
+ run('settings.json exists', settingsExists);
43
+
44
+ let settings = {};
45
+ if (settingsExists) {
46
+ try {
47
+ settings = JSON.parse(fs.readFileSync(PATHS.settings, 'utf-8'));
48
+ run('settings.json is valid JSON', true);
49
+ } catch {
50
+ run('settings.json is valid JSON', false, 'parse error');
51
+ }
52
+ }
53
+
54
+ // Hooks present
55
+ const expectedHooks = getHookFiles();
56
+ for (const file of expectedHooks) {
57
+ run(`Hook: ${file}`, fs.existsSync(path.join(PATHS.hooksDir, file)));
58
+ }
59
+
60
+ // Skills present
61
+ const expectedSkills = getSkillDirs();
62
+ for (const dir of expectedSkills) {
63
+ const skillPath = path.join(PATHS.skillsDir, dir);
64
+ run(`Skill: ${dir}`, fs.existsSync(skillPath) && fs.existsSync(path.join(skillPath, 'SKILL.md')));
65
+ }
66
+
67
+ // Plugins
68
+ for (const id of SUPERMIND_PLUGINS) {
69
+ run(`Plugin: ${id.split('@')[0]}`, settings.enabledPlugins?.[id] === true);
70
+ }
71
+
72
+ // Template
73
+ run('CLAUDE.md template', fs.existsSync(path.join(PATHS.templatesDir, 'CLAUDE.md')));
74
+
75
+ // Sessions directory
76
+ run('Sessions directory writable', (() => {
77
+ try {
78
+ const testFile = path.join(PATHS.sessionsDir, '.doctor-test');
79
+ fs.writeFileSync(testFile, 'test');
80
+ fs.unlinkSync(testFile);
81
+ return true;
82
+ } catch { return false; }
83
+ })());
84
+
85
+ // Docker (warn only, not required)
86
+ try {
87
+ require('child_process').execSync('docker compose version', { stdio: 'pipe', timeout: 5000 });
88
+ logger.success('Docker available');
89
+ passed++;
90
+ } catch {
91
+ logger.warn('Docker not available (optional \u2014 needed for AIRIS mode)');
92
+ }
93
+
94
+ // Version
95
+ let installedVersion = 'not found';
96
+ try { installedVersion = fs.readFileSync(PATHS.versionFile, 'utf-8').trim(); } catch {}
97
+ run('Version marker', installedVersion === version, installedVersion !== version ? `installed: ${installedVersion}, package: ${version}` : undefined);
98
+
99
+ console.log(`\n ${passed} passed, ${failed} failed\n`);
100
+ if (failed > 0) process.exit(1);
101
+ };
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const { PATHS, ensureDir } = require('../lib/platform');
5
+ const logger = require('../lib/logger');
6
+ const { readSettings, writeSettings, backupSettings, mergeSettings } = require('../lib/settings');
7
+ const { installHooks, getHookSettings } = require('../lib/hooks');
8
+ const { installSkills, removeLegacySkills } = require('../lib/skills');
9
+ const { getPluginDefaults } = require('../lib/plugins');
10
+ const { setupMcp } = require('../lib/mcp');
11
+ const { installTemplates } = require('../lib/templates');
12
+ const { version } = require('../../package.json');
13
+
14
+ module.exports = async function install(flags) {
15
+ logger.banner();
16
+ const TOTAL = 7;
17
+
18
+ // Step 1: Platform setup
19
+ logger.step(1, TOTAL, 'Detecting platform and creating directories...');
20
+ ensureDir(PATHS.claudeHome);
21
+ ensureDir(PATHS.hooksDir);
22
+ ensureDir(PATHS.skillsDir);
23
+ ensureDir(PATHS.sessionsDir);
24
+ logger.success(`Claude home: ${PATHS.claudeHome}`);
25
+
26
+ // Clean up legacy files
27
+ if (fs.existsSync(PATHS.legacyHooksJson)) {
28
+ fs.unlinkSync(PATHS.legacyHooksJson);
29
+ logger.info('Removed legacy hooks.json');
30
+ }
31
+
32
+ // Step 2: Settings
33
+ logger.step(2, TOTAL, 'Configuring settings...');
34
+ backupSettings();
35
+ const existing = readSettings();
36
+ const hookSettings = getHookSettings();
37
+ const pluginDefaults = getPluginDefaults();
38
+ const defaults = {
39
+ ...hookSettings,
40
+ ...pluginDefaults,
41
+ alwaysThinkingEnabled: true,
42
+ effortLevel: 'high',
43
+ };
44
+ let merged = mergeSettings(existing, defaults);
45
+ writeSettings(merged);
46
+ logger.success('Settings merged');
47
+
48
+ // Step 3: Hooks
49
+ logger.step(3, TOTAL, 'Installing hooks...');
50
+ const hookFiles = installHooks();
51
+ logger.info(`${hookFiles.length} hooks installed`);
52
+
53
+ // Step 4: Skills
54
+ logger.step(4, TOTAL, 'Installing skills...');
55
+ removeLegacySkills();
56
+ const skillDirs = installSkills();
57
+ logger.info(`${skillDirs.length} skill directories installed`);
58
+
59
+ // Step 5: Plugins (data already merged in Step 2 via getPluginDefaults — this step is log-only)
60
+ logger.step(5, TOTAL, 'Enabling plugins...');
61
+ logger.success('superpowers, frontend-design, claude-md-management, ui-ux-pro-max');
62
+
63
+ // Step 6: MCP servers
64
+ logger.step(6, TOTAL, 'MCP server setup...');
65
+ const mcpConfig = await setupMcp(flags);
66
+ if (mcpConfig.mcpServers) {
67
+ merged = readSettings();
68
+ merged.mcpServers = { ...(merged.mcpServers || {}), ...mcpConfig.mcpServers };
69
+ writeSettings(merged);
70
+ }
71
+
72
+ // Step 7: Templates
73
+ logger.step(7, TOTAL, 'Installing templates...');
74
+ installTemplates();
75
+
76
+ // Write version marker
77
+ fs.writeFileSync(PATHS.versionFile, version);
78
+
79
+ // Summary
80
+ console.log(`\n${'\x1b[32m'}\u2713 Supermind v${version} installed successfully${'\x1b[0m'}\n`);
81
+ console.log(' Next steps:');
82
+ console.log(' 1. Restart Claude Code to activate plugins');
83
+ console.log(' 2. In any project, run /supermind-init to set up project docs');
84
+ console.log(' 3. Run: npx supermind-claude doctor to verify installation\n');
85
+ };
@@ -0,0 +1,75 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const readline = require('readline');
5
+ const { PATHS } = require('../lib/platform');
6
+ const logger = require('../lib/logger');
7
+ const { readSettings, writeSettings, removeSupermindEntries } = require('../lib/settings');
8
+ const { removeHooks } = require('../lib/hooks');
9
+ const { removeSkills } = require('../lib/skills');
10
+ const { removeTemplates } = require('../lib/templates');
11
+
12
+ function prompt(question) {
13
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
14
+ return new Promise(resolve => rl.question(question, answer => { rl.close(); resolve(answer.trim()); }));
15
+ }
16
+
17
+ module.exports = async function uninstall(flags) {
18
+ logger.banner();
19
+
20
+ if (!flags.yes && !flags.nonInteractive) {
21
+ const answer = await prompt(' Remove all Supermind components? [y/N]: ');
22
+ if (answer.toLowerCase() !== 'y') {
23
+ console.log(' Cancelled.\n');
24
+ return;
25
+ }
26
+ }
27
+
28
+ console.log('');
29
+
30
+ // Remove hooks
31
+ console.log(' Removing hooks...');
32
+ removeHooks();
33
+
34
+ // Remove skills
35
+ console.log(' Removing skills...');
36
+ removeSkills();
37
+
38
+ // Remove templates
39
+ console.log(' Removing templates...');
40
+ removeTemplates();
41
+
42
+ // Clean settings
43
+ console.log(' Cleaning settings...');
44
+ const settings = readSettings();
45
+ const cleaned = removeSupermindEntries(settings);
46
+ writeSettings(cleaned);
47
+ logger.success('Settings cleaned');
48
+
49
+ // Remove version marker
50
+ if (fs.existsSync(PATHS.versionFile)) {
51
+ fs.unlinkSync(PATHS.versionFile);
52
+ }
53
+
54
+ // Remove legacy hooks.json
55
+ if (fs.existsSync(PATHS.legacyHooksJson)) {
56
+ fs.unlinkSync(PATHS.legacyHooksJson);
57
+ logger.info('Removed legacy hooks.json');
58
+ }
59
+
60
+ // Optional: AIRIS config
61
+ if (fs.existsSync(PATHS.airisDir)) {
62
+ if (flags.yes || flags.nonInteractive) {
63
+ fs.rmSync(PATHS.airisDir, { recursive: true, force: true });
64
+ logger.success('Removed AIRIS config');
65
+ } else {
66
+ const answer = await prompt(' Also remove AIRIS/Docker config? [y/N]: ');
67
+ if (answer.toLowerCase() === 'y') {
68
+ fs.rmSync(PATHS.airisDir, { recursive: true, force: true });
69
+ logger.success('Removed AIRIS config');
70
+ }
71
+ }
72
+ }
73
+
74
+ console.log(`\n${'\x1b[32m'}\u2713 Supermind uninstalled${'\x1b[0m'}\n`);
75
+ };
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const { PATHS } = require('../lib/platform');
5
+ const logger = require('../lib/logger');
6
+ const { readSettings, writeSettings, mergeSettings } = require('../lib/settings');
7
+ const { installHooks, getHookSettings } = require('../lib/hooks');
8
+ const { installSkills, removeLegacySkills } = require('../lib/skills');
9
+ const { installTemplates } = require('../lib/templates');
10
+ const { version } = require('../../package.json');
11
+
12
+ module.exports = function update(flags) {
13
+ logger.banner();
14
+
15
+ // Version comparison
16
+ let installedVersion = 'unknown';
17
+ try { installedVersion = fs.readFileSync(PATHS.versionFile, 'utf-8').trim(); } catch {}
18
+
19
+ if (installedVersion === version) {
20
+ logger.info(`Already at v${version}, refreshing files...`);
21
+ } else {
22
+ logger.info(`Updating from v${installedVersion} to v${version}...`);
23
+ }
24
+
25
+ const TOTAL = 4;
26
+
27
+ // Step 1: Hooks
28
+ logger.step(1, TOTAL, 'Updating hooks...');
29
+ installHooks();
30
+
31
+ // Step 2: Hook settings (re-merge to pick up any new hooks)
32
+ logger.step(2, TOTAL, 'Updating settings...');
33
+ const existing = readSettings();
34
+ const hookSettings = getHookSettings();
35
+ const merged = mergeSettings(existing, hookSettings);
36
+ writeSettings(merged);
37
+ logger.success('Hook settings refreshed');
38
+
39
+ // Step 3: Skills
40
+ logger.step(3, TOTAL, 'Updating skills...');
41
+ removeLegacySkills();
42
+ installSkills();
43
+
44
+ // Step 4: Templates
45
+ logger.step(4, TOTAL, 'Updating templates...');
46
+ installTemplates();
47
+
48
+ // Write version marker
49
+ fs.writeFileSync(PATHS.versionFile, version);
50
+
51
+ console.log(`\n${'\x1b[32m'}\u2713 Supermind updated to v${version}${'\x1b[0m'}\n`);
52
+ };
package/cli/index.js ADDED
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { version } = require('../package.json');
5
+
6
+ const COMMANDS = {
7
+ install: () => require('./commands/install'),
8
+ update: () => require('./commands/update'),
9
+ doctor: () => require('./commands/doctor'),
10
+ uninstall: () => require('./commands/uninstall'),
11
+ approve: () => require('./commands/approve'),
12
+ };
13
+
14
+ function parseArgs(argv) {
15
+ const args = argv.slice(2);
16
+ const flags = {};
17
+ let command = 'install'; // default
18
+
19
+ for (let i = 0; i < args.length; i++) {
20
+ const arg = args[i];
21
+ if (arg === '--help' || arg === '-h') { flags.help = true; continue; }
22
+ if (arg === '--version' || arg === '-v') { flags.version = true; continue; }
23
+ if (arg === '--non-interactive') { flags.nonInteractive = true; continue; }
24
+ if (arg === '--yes' || arg === '-y') { flags.yes = true; continue; }
25
+ if (arg === '--mcp' && args[i + 1]) { flags.mcp = args[++i]; continue; }
26
+ if (arg === '--list' || arg === '-l') { flags.list = true; continue; }
27
+ if (arg === '--remove' || arg === '-r') { flags.remove = true; continue; }
28
+ if (!arg.startsWith('-') && COMMANDS[arg]) { command = arg; continue; }
29
+ }
30
+
31
+ return { command, flags };
32
+ }
33
+
34
+ function showHelp() {
35
+ console.log(`
36
+ supermind-claude v${version}
37
+
38
+ Usage: supermind-claude [command] [options]
39
+
40
+ Commands:
41
+ install Full global setup (default)
42
+ update Refresh hooks, skills, and templates
43
+ doctor Verify installation health
44
+ uninstall Remove all Supermind components
45
+ approve Manage auto-approved commands
46
+
47
+ Options:
48
+ --non-interactive Skip all prompts, use defaults
49
+ --mcp <mode> MCP setup: docker, direct, or skip
50
+ --yes, -y Auto-confirm destructive operations
51
+ --help, -h Show this help
52
+ --version, -v Show version
53
+ `);
54
+ }
55
+
56
+ async function main() {
57
+ const { command, flags } = parseArgs(process.argv);
58
+
59
+ if (flags.version) { console.log(version); process.exit(0); }
60
+ if (flags.help) { showHelp(); process.exit(0); }
61
+
62
+ const run = COMMANDS[command]();
63
+ await run(flags);
64
+ }
65
+
66
+ main().catch(err => {
67
+ console.error(`\n \x1b[31m\u2717\x1b[0m ${err.message}\n`);
68
+ process.exit(1);
69
+ });