From a64fba0aec0e7c845fdba4285601baf6fbf8793b Mon Sep 17 00:00:00 2001 From: Kailas Mahavarkar <66670953+KailasMahavarkar@users.noreply.github.com> Date: Wed, 15 Apr 2026 00:45:40 +0530 Subject: [PATCH] feat: add CLI interface for autonomous setup --- package.json | 3 ++- scripts/setup.ts | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 scripts/setup.ts diff --git a/package.json b/package.json index c1ffc64..e83d217 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "dev": "bun --watch src/index.ts", "docker:run": "bun scripts/ensure-singleton.ts", "skills:index": "bun scripts/generate-skills-index.ts", - "mcp:start": "bun scripts/start-mcp.ts" + "mcp:start": "bun scripts/start-mcp.ts", + "setup": "bun scripts/setup.ts" }, "author": "Orkait", "license": "MIT", diff --git a/scripts/setup.ts b/scripts/setup.ts new file mode 100644 index 0000000..441b67d --- /dev/null +++ b/scripts/setup.ts @@ -0,0 +1,38 @@ +import * as setup from "../src/internal/setup-hyperstack.js"; +import * as fs from "node:fs"; +import * as path from "node:path"; + +async function main() { + console.log("\nšŸš€ Hyperstack Autonomous Setup (CLI)"); + console.log("=====================================\n"); + + const platform = setup.detectEnvironment(); + console.log(`šŸ“” Detected platform: ${platform}`); + + const configPath = setup.findConfigFile(platform); + + if (!configPath) { + console.warn("āš ļø Could not automatically find an MCP configuration file."); + console.log(`Check ${platform} documentation for the correct 'mcp.json' or settings path.`); + process.exit(1); + } + + console.log(`āœ… Found config: ${configPath}`); + + const pluginRoot = process.cwd(); + const patch = setup.generateMcpPatch(configPath, pluginRoot); + + console.log("\nProposed MCP Configuration Patch:"); + console.log("---------------------------------"); + console.log(JSON.stringify(patch, null, 2)); + console.log("---------------------------------\n"); + + console.log("To apply this patch:"); + console.log(`1. Open ${configPath}`); + console.log("2. Merged the 'hyperstack' entry into your 'mcpServers' or 'extensions' block."); + console.log("3. Restart your AI client."); + + console.log("\nFor an automated autopilot installation, call the 'hyperstack_setup' tool from within your AI assistant.\n"); +} + +main().catch(console.error);