/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/mcp-config@0.0.10/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
#!/usr/bin/env node
import{fileURLToPath}from"url";import{dirname,resolve}from"path";import fs from"fs-extra";import pc from"picocolors";import ansiEscapes from"ansi-escapes";import{addOrConfigureServer}from"./commands/addOrConfigureServer.js";import{selectAndConfigure}from"./commands/selectAndConfigure.js";async function getPackageVersion(){try{const e=fileURLToPath(import.meta.url),r=dirname(e),o=resolve(r,"..","package.json");return(await fs.readJSON(o)).version}catch(e){return console.error("Error reading package version:",e),"unknown"}}function parseCommandLineArgs(){const e=process.argv.slice(2),r={};return e.length>0&&!e[0].startsWith("-")&&(r.serverName=e[0]),r}async function displayWelcomeBanner(e){process.stdout.write(ansiEscapes.clearScreen),console.log(""),console.log(pc.bgCyan(pc.black(" ".repeat(60)))),console.log(pc.bgCyan(pc.black(`  ${pc.bold("MCP CONFIG")} ${pc.dim(`v${e}`)}${" ".repeat(43-e.length)}  `))),console.log(pc.bgCyan(pc.black(" ".repeat(60)))),console.log(""),console.log(`${pc.bold("Manage Your MCP Servers")}`),console.log(pc.dim("─".repeat(60))),console.log("")}async function main(){try{const e=await getPackageVersion();await displayWelcomeBanner(e);const r=parseCommandLineArgs();if(r.serverName)return void await addOrConfigureServer(r.serverName);await selectAndConfigure()}catch(e){e instanceof Error&&("ExitPromptError"===e.name||e.message.includes("ExitPromptError"))&&(console.log("\nOperation cancelled by user."),process.exit(0)),console.error("Error configuring MCP servers:",e),process.exit(1)}}main();
//# sourceMappingURL=/sm/80e0849a1dca473750d9636d870572b5a627b67001673850d2509f981d20f747.map