/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@zamaz/claude-agents@1.0.3/src/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{program}from"commander";import chalk from"chalk";import{readFileSync}from"fs";import{fileURLToPath}from"url";import{dirname,join}from"path";import{logger}from"./utils/logger.js";import{CLIError}from"./utils/errors.js";import{installCommand}from"./commands/install.js";import{listCommand}from"./commands/list.js";import{enableCommand}from"./commands/enable.js";import{disableCommand}from"./commands/disable.js";import{infoCommand}from"./commands/info.js";import{createCommand}from"./commands/create.js";import{removeCommand}from"./commands/remove.js";import{updateCommand}from"./commands/update.js";import{syncCommand}from"./commands/sync.js";import{migrateCommandConfig}from"./commands/migrate.js";import{optimizeCommandConfig}from"./commands/optimize.js";import{validateCommandConfig}from"./commands/validate.js";import{checkForUpdates}from"./utils/update-checker.js";const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),packageJson=JSON.parse(readFileSync(join(__dirname,"..","package.json"),"utf-8"));logger.info(chalk.blue("\n╔═══════════════════════════════════════════╗\n║       Claude Sub-Agents Manager           ║\n║   Enhance Claude Code with AI Agents      ║\n╚═══════════════════════════════════════════╝\n")),program.name("claude-agents").description("CLI tool to manage Claude Code sub-agents").version(packageJson.version),program.command("install [agents...]").description("Install sub-agents to your system").option("-p, --project","Install to project directory instead of user directory").option("-a, --all","Install all available agents").action(((o,a)=>installCommand(o,a))),program.command("list").description("List available and installed agents").option("-i, --installed","Show only installed agents").option("-a, --available","Show only available agents").action(listCommand),program.command("enable <agent>").description("Enable a specific agent").option("-p, --project","Enable in project scope").action(enableCommand),program.command("disable <agent>").description("Disable a specific agent without removing it").option("-p, --project","Disable in project scope").action(disableCommand),program.command("info <agent>").description("Show detailed information about an agent").action(infoCommand),program.command("create").description("Create a new custom agent").option("-n, --name <name>","Agent name").option("-t, --template <template>","Use a template (basic, advanced)").action(createCommand),program.command("remove <agent>").alias("uninstall").description("Remove an installed agent").option("-p, --project","Remove from project scope").action(removeCommand),program.command(updateCommand.name).description(updateCommand.description).option("-a, --all","Update all installed agents").option("-p, --project","Update agents in project scope").option("-f, --force","Force update without confirmation").option("--preserve-custom","Preserve custom modifications").action(updateCommand.action),program.command("sync").description("Sync externally installed agents with configuration").option("-a, --auto","Auto-register without confirmation").option("-c, --commands","Also check for orphaned commands").option("-f, --force-copy","Force copy all agents to project directory").action(syncCommand);const migrateCmd=program.command(migrateCommandConfig.command).description(migrateCommandConfig.description);migrateCommandConfig.options.forEach((o=>{migrateCmd.option(...o)})),migrateCmd.action(migrateCommandConfig.action);const optimizeCmd=program.command(optimizeCommandConfig.command).description(optimizeCommandConfig.description);optimizeCommandConfig.options.forEach((o=>{optimizeCmd.option(...o)})),optimizeCmd.action(optimizeCommandConfig.action);const validateCmd=program.command(validateCommandConfig.command).description(validateCommandConfig.description);validateCommandConfig.options.forEach((o=>{validateCmd.option(...o)})),validateCmd.action(validateCommandConfig.action),program.command("config <setting> [value]").description("Configure settings (e.g., config autosync on/off)").action((async(o,a)=>{const{enableAutoSync:n,disableAutoSync:e,isAutoSyncEnabled:t}=await import("./utils/auto-sync.js");"autosync"===o?"on"===a||"true"===a?n():"off"===a||"false"===a?e():a?console.log(chalk.red('Invalid value. Use "on" or "off"')):console.log(`Auto-sync is currently: ${t()?chalk.green("enabled"):chalk.gray("disabled")}`):(console.log(chalk.red(`Unknown setting: ${o}`)),console.log(chalk.gray("Available settings: autosync")))})),program.command("version").description("Show version and check for updates").action((async()=>{logger.info(`${packageJson.name} v${packageJson.version}`),await checkForUpdates(!1)})),checkForUpdates(!0);const originalParse=program.parse.bind(program);program.parse=async(...o)=>{try{return await originalParse(...o)}catch(o){o instanceof CLIError?process.exit(o.code||1):(logger.error("Unexpected error:",o.message),"true"===process.env.DEBUG&&logger.error(o.stack),process.exit(1))}},program.parse(process.argv),process.argv.slice(2).length||program.outputHelp();
//# sourceMappingURL=/sm/8a2cd02da04f8e17262d1e5cfbe4bc0018b33b9379b5421ac34a86b6235c318f.map