uloop-cli 0.44.1 → 0.45.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../node_modules/commander/lib/error.js", "../node_modules/commander/lib/argument.js", "../node_modules/commander/lib/help.js", "../node_modules/commander/lib/option.js", "../node_modules/commander/lib/suggestSimilar.js", "../node_modules/commander/lib/command.js", "../node_modules/commander/index.js", "../src/cli.ts", "../node_modules/commander/esm.mjs", "../src/direct-unity-client.ts", "../src/simple-framer.ts", "../src/port-resolver.ts", "../src/project-root.ts", "../src/tool-cache.ts", "../src/default-tools.json", "../src/version.ts", "../src/execute-tool.ts", "../src/arg-parser.ts", "../src/skills/skills-manager.ts", "../src/skills/skill-definitions/uloop-compile/SKILL.md", "../src/skills/skill-definitions/uloop-get-logs/SKILL.md", "../src/skills/skill-definitions/uloop-run-tests/SKILL.md", "../src/skills/skill-definitions/uloop-clear-console/SKILL.md", "../src/skills/skill-definitions/uloop-focus-window/SKILL.md", "../src/skills/skill-definitions/uloop-get-hierarchy/SKILL.md", "../src/skills/skill-definitions/uloop-unity-search/SKILL.md", "../src/skills/skill-definitions/uloop-get-menu-items/SKILL.md", "../src/skills/skill-definitions/uloop-execute-menu-item/SKILL.md", "../src/skills/skill-definitions/uloop-find-game-objects/SKILL.md", "../src/skills/skill-definitions/uloop-capture-gameview/SKILL.md", "../src/skills/skill-definitions/uloop-execute-dynamic-code/SKILL.md", "../src/skills/skill-definitions/uloop-get-provider-details/SKILL.md", "../src/skills/bundled-skills.ts", "../src/skills/skills-command.ts"],
4
- "sourcesContent": ["/**\n * CommanderError class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n", "const { InvalidArgumentError } = require('./error.js');\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.endsWith('...')) {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n", "const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map<string, Command[] | Option[]>}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripColor(str).length;\n }\n\n /**\n * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.\n *\n * @param {string} str\n * @returns {string}\n */\n styleTitle(str) {\n return str;\n }\n\n styleUsage(str) {\n // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:\n // command subcommand [options] [command] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word === '[command]') return this.styleSubcommandText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleCommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleCommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleOptionDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleSubcommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleArgumentDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleDescriptionText(str) {\n return str;\n }\n styleOptionTerm(str) {\n return this.styleOptionText(str);\n }\n styleSubcommandTerm(str) {\n // This is very like usage with lots of parts! Assume default string which is formed like:\n // subcommand [options] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleSubcommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleArgumentTerm(str) {\n return this.styleArgumentText(str);\n }\n styleOptionText(str) {\n return str;\n }\n styleArgumentText(str) {\n return str;\n }\n styleSubcommandText(str) {\n return str;\n }\n styleCommandText(str) {\n return str;\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper),\n );\n }\n\n /**\n * Detect manually wrapped and indented strings by checking for line break followed by whitespace.\n *\n * @param {string} str\n * @returns {boolean}\n */\n preformatted(str) {\n return /\\n[^\\S\\r\\n]/.test(str);\n }\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n *\n * @param {string} term\n * @param {number} termWidth\n * @param {string} description\n * @param {Help} helper\n * @returns {string}\n */\n formatItem(term, termWidth, description, helper) {\n const itemIndent = 2;\n const itemIndentStr = ' '.repeat(itemIndent);\n if (!description) return itemIndentStr + term;\n\n // Pad the term out to a consistent width, so descriptions are aligned.\n const paddedTerm = term.padEnd(\n termWidth + term.length - helper.displayWidth(term),\n );\n\n // Format the description.\n const spacerWidth = 2; // between term and description\n const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called\n const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;\n let formattedDescription;\n if (\n remainingWidth < this.minWidthToWrap ||\n helper.preformatted(description)\n ) {\n formattedDescription = description;\n } else {\n const wrappedDescription = helper.boxWrap(description, remainingWidth);\n formattedDescription = wrappedDescription.replace(\n /\\n/g,\n '\\n' + ' '.repeat(termWidth + spacerWidth),\n );\n }\n\n // Construct and overall indent.\n return (\n itemIndentStr +\n paddedTerm +\n ' '.repeat(spacerWidth) +\n formattedDescription.replace(/\\n/g, `\\n${itemIndentStr}`)\n );\n }\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n *\n * @param {string} str\n * @param {number} width\n * @returns {string}\n */\n boxWrap(str, width) {\n if (width < this.minWidthToWrap) return str;\n\n const rawLines = str.split(/\\r\\n|\\n/);\n // split up text by whitespace\n const chunkPattern = /[\\s]*[^\\s]+/g;\n const wrappedLines = [];\n rawLines.forEach((line) => {\n const chunks = line.match(chunkPattern);\n if (chunks === null) {\n wrappedLines.push('');\n return;\n }\n\n let sumChunks = [chunks.shift()];\n let sumWidth = this.displayWidth(sumChunks[0]);\n chunks.forEach((chunk) => {\n const visibleWidth = this.displayWidth(chunk);\n // Accumulate chunks while they fit into width.\n if (sumWidth + visibleWidth <= width) {\n sumChunks.push(chunk);\n sumWidth += visibleWidth;\n return;\n }\n wrappedLines.push(sumChunks.join(''));\n\n const nextChunk = chunk.trimStart(); // trim space at line break\n sumChunks = [nextChunk];\n sumWidth = this.displayWidth(nextChunk);\n });\n wrappedLines.push(sumChunks.join(''));\n });\n\n return wrappedLines.join('\\n');\n }\n}\n\n/**\n * Strip style ANSI escape sequences from the string. In particular, SGR (Select Graphic Rendition) codes.\n *\n * @param {string} str\n * @returns {string}\n * @package\n */\n\nfunction stripColor(str) {\n // eslint-disable-next-line no-control-regex\n const sgrPattern = /\\x1b\\[\\d*(;\\d*)*m/g;\n return str.replace(sgrPattern, '');\n}\n\nexports.Help = Help;\nexports.stripColor = stripColor;\n", "const { InvalidArgumentError } = require('./error.js');\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nclass DualOptions {\n /**\n * @param {Option[]} options\n */\n constructor(options) {\n this.positiveOptions = new Map();\n this.negativeOptions = new Map();\n this.dualOptions = new Set();\n options.forEach((option) => {\n if (option.negate) {\n this.negativeOptions.set(option.attributeName(), option);\n } else {\n this.positiveOptions.set(option.attributeName(), option);\n }\n });\n this.negativeOptions.forEach((value, key) => {\n if (this.positiveOptions.has(key)) {\n this.dualOptions.add(key);\n }\n });\n }\n\n /**\n * Did the value come from the option, and not from possible matching dual option?\n *\n * @param {*} value\n * @param {Option} option\n * @returns {boolean}\n */\n valueFromOption(value, option) {\n const optionKey = option.attributeName();\n if (!this.dualOptions.has(optionKey)) return true;\n\n // Use the value to deduce if (probably) came from the option.\n const preset = this.negativeOptions.get(optionKey).presetArg;\n const negativeValue = preset !== undefined ? preset : false;\n return option.negate === (negativeValue === value);\n }\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // short flag, single dash and single character\n const shortFlagExp = /^-[^-]$/;\n // long flag, double dash and at least one character\n const longFlagExp = /^--[^-]/;\n\n const flagParts = flags.split(/[ |,]+/).concat('guard');\n // Normal is short and/or long.\n if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();\n if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();\n // Long then short. Rarely used but fine.\n if (!shortFlag && shortFlagExp.test(flagParts[0]))\n shortFlag = flagParts.shift();\n // Allow two long flags, like '--ws, --workspace'\n // This is the supported way to have a shortish option flag.\n if (!shortFlag && longFlagExp.test(flagParts[0])) {\n shortFlag = longFlag;\n longFlag = flagParts.shift();\n }\n\n // Check for unprocessed flag. Fail noisily rather than silently ignore.\n if (flagParts[0].startsWith('-')) {\n const unsupportedFlag = flagParts[0];\n const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;\n if (/^-[^-][^-]/.test(unsupportedFlag))\n throw new Error(\n `${baseError}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`,\n );\n if (shortFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many short flags`);\n if (longFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many long flags`);\n\n throw new Error(`${baseError}\n- unrecognised flag format`);\n }\n if (shortFlag === undefined && longFlag === undefined)\n throw new Error(\n `option creation failed due to no flags found in '${flags}'.`,\n );\n\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.DualOptions = DualOptions;\n", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance)\n return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost, // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map((candidate) => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map((candidate) => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n", "const EventEmitter = require('node:events').EventEmitter;\nconst childProcess = require('node:child_process');\nconst path = require('node:path');\nconst fs = require('node:fs');\nconst process = require('node:process');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help, stripColor } = require('./help.js');\nconst { Option, DualOptions } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = false;\n /** @type {Argument[]} */\n this.registeredArguments = [];\n this._args = this.registeredArguments; // deprecated old name\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default, env, cli etc\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._executableDir = null; // custom search directory for subcommands\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._summary = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {(boolean | string)} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = true;\n this._savedState = null; // used in save/restoreStateBeforeParse\n\n // see configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n outputError: (str, write) => write(str),\n getOutHelpWidth: () =>\n process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () =>\n process.stderr.isTTY ? process.stderr.columns : undefined,\n getOutHasColors: () =>\n useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),\n getErrHasColors: () =>\n useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),\n stripColor: (str) => stripColor(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = {\n ...this._outputConfiguration,\n ...configuration,\n };\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument?.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.negate) {\n // --no-foo is special and defaults foo to true, unless a --foo option is already defined\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n name,\n option.defaultValue === undefined ? true : option.defaultValue,\n 'default',\n );\n }\n } else if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._collectValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, parseArg, defaultValue) {\n return this._optionEx({}, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, parseArg, defaultValue) {\n return this._optionEx(\n { mandatory: true },\n flags,\n description,\n parseArg,\n defaultValue,\n );\n }\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.\n * @return {Command} `this` command for chaining\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n }\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.\n * @return {Command} `this` command for chaining\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n }\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.\n * @return {Command} `this` command for chaining\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n }\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {boolean} [positional]\n * @return {Command} `this` command for chaining\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n }\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {boolean} [passThrough] for unknown options.\n * @return {Command} `this` command for chaining\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n this._checkForBrokenPassThrough();\n return this;\n }\n\n /**\n * @private\n */\n\n _checkForBrokenPassThrough() {\n if (\n this.parent &&\n this._passThroughOptions &&\n !this.parent._enablePositionalOptions\n ) {\n throw new Error(\n `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`,\n );\n }\n }\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n if (Object.keys(this._optionValues).length) {\n throw new Error(\n 'call .storeOptionsAsProperties() before setting option values',\n );\n }\n this._storeOptionsAsProperties = !!storeAsProperties;\n return this;\n }\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n }\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n return this.setOptionValueWithSource(key, value, undefined);\n }\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {object} value\n * @param {string} source - expected values are default/config/env/cli/implied\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n }\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSourceWithGlobals(key) {\n // global overwrites local, like optsWithGlobals\n let source;\n this._getCommandAndAncestors().forEach((cmd) => {\n if (cmd.getOptionValueSource(key) !== undefined) {\n source = cmd.getOptionValueSource(key);\n }\n });\n return source;\n }\n\n /**\n * Get user arguments from implied or explicit arguments.\n * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.\n *\n * @private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // auto-detect argument conventions if nothing supplied\n if (argv === undefined && parseOptions.from === undefined) {\n if (process.versions?.electron) {\n parseOptions.from = 'electron';\n }\n // check node specific options for scenarios where user CLI args follow executable without scriptname\n const execArgv = process.execArgv ?? [];\n if (\n execArgv.includes('-e') ||\n execArgv.includes('--eval') ||\n execArgv.includes('-p') ||\n execArgv.includes('--print')\n ) {\n parseOptions.from = 'eval'; // internal usage, not documented\n }\n }\n\n // default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n }\n this.rawArgs = argv.slice();\n\n // extract the user args and scriptPath\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: because defaultApp is an unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n case 'eval':\n userArgs = argv.slice(1);\n break;\n default:\n throw new Error(\n `unexpected parse option { from: '${parseOptions.from}' }`,\n );\n }\n\n // Find default name for program from arguments.\n if (!this._name && this._scriptPath)\n this.nameFromFilename(this._scriptPath);\n this._name = this._name || 'program';\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n }\n\n _prepareForParse() {\n if (this._savedState === null) {\n this.saveStateBeforeParse();\n } else {\n this.restoreStateBeforeParse();\n }\n }\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse() {\n this._savedState = {\n // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing\n _name: this._name,\n // option values before parse have default values (including false for negated options)\n // shallow clones\n _optionValues: { ...this._optionValues },\n _optionValueSources: { ...this._optionValueSources },\n };\n }\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse() {\n if (this._storeOptionsAsProperties)\n throw new Error(`Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties`);\n\n // clear state from _prepareUserArgs\n this._name = this._savedState._name;\n this._scriptPath = null;\n this.rawArgs = [];\n // clear state from setOptionValueWithSource\n this._optionValues = { ...this._savedState._optionValues };\n this._optionValueSources = { ...this._savedState._optionValueSources };\n // clear state from _parseCommand\n this.args = [];\n // clear state from _processArguments\n this.processedArgs = [];\n }\n\n /**\n * Throw if expected executable is missing. Add lots of help for author.\n *\n * @param {string} executableFile\n * @param {string} executableDir\n * @param {string} subcommandName\n */\n _checkForMissingExecutable(executableFile, executableDir, subcommandName) {\n if (fs.existsSync(executableFile)) return;\n\n const executableDirMessage = executableDir\n ? `searched for local subcommand relative to directory '${executableDir}'`\n : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';\n const executableMissing = `'${executableFile}' does not exist\n - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`;\n throw new Error(executableMissing);\n }\n\n /**\n * Execute a sub-command executable.\n *\n * @private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for specified file\n const localBin = path.resolve(baseDir, baseName);\n if (fs.existsSync(localBin)) return localBin;\n\n // Stop looking if candidate already has an expected extension.\n if (sourceExt.includes(path.extname(baseName))) return undefined;\n\n // Try all the extensions.\n const foundExt = sourceExt.find((ext) =>\n fs.existsSync(`${localBin}${ext}`),\n );\n if (foundExt) return `${localBin}${foundExt}`;\n\n return undefined;\n }\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // executableFile and executableDir might be full path, or just a name\n let executableFile =\n subcommand._executableFile || `${this._name}-${subcommand._name}`;\n let executableDir = this._executableDir || '';\n if (this._scriptPath) {\n let resolvedScriptPath; // resolve possible symlink for installed npm binary\n try {\n resolvedScriptPath = fs.realpathSync(this._scriptPath);\n } catch {\n resolvedScriptPath = this._scriptPath;\n }\n executableDir = path.resolve(\n path.dirname(resolvedScriptPath),\n executableDir,\n );\n }\n\n // Look for a local file in preference to a command in PATH.\n if (executableDir) {\n let localFile = findFile(executableDir, executableFile);\n\n // Legacy search using prefix of script name instead of command name\n if (!localFile && !subcommand._executableFile && this._scriptPath) {\n const legacyName = path.basename(\n this._scriptPath,\n path.extname(this._scriptPath),\n );\n if (legacyName !== this._name) {\n localFile = findFile(\n executableDir,\n `${legacyName}-${subcommand._name}`,\n );\n }\n }\n executableFile = localFile || executableFile;\n }\n\n launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise?.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent?.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} args\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(args) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-(\\d+|\\d*\\.\\d+)(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n let activeGroup = null; // working through group of short options, like -abc\n let i = 0;\n while (i < args.length || activeGroup) {\n const arg = activeGroup ?? args[i++];\n activeGroup = null;\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args.slice(i));\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args[i++];\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n i < args.length &&\n (!maybeOption(args[i]) || negativeNumberArg(args[i]))\n ) {\n value = args[i++];\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option\n this.emit(`option:${option.name()}`);\n // remove the processed option and keep processing group\n activeGroup = `-${arg.slice(2)}`;\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n unknown.push(...args.slice(i));\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg, ...args.slice(i));\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg, ...args.slice(i));\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg, ...args.slice(i));\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(require.main.filename);\n *\n * @param {string} filename\n * @return {Command}\n */\n\n nameFromFilename(filename) {\n this._name = path.basename(filename, path.extname(filename));\n\n return this;\n }\n\n /**\n * Get or set the directory for searching for executable subcommands of this command.\n *\n * @example\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * @returns {boolean | undefined}\n * @package\n */\nfunction useColor() {\n // Test for common conventions.\n // NB: the observed behaviour is in combination with how author adds color! For example:\n // - we do not test NODE_DISABLE_COLORS, but util:styletext does\n // - we do test NO_COLOR, but Chalk does not\n //\n // References:\n // https://no-color.org\n // https://bixense.com/clicolors/\n // https://github.com/nodejs/node/blob/0a00217a5f67ef4a22384cfc80eb6dd9a917fdc1/lib/internal/tty.js#L109\n // https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L33\n // (https://force-color.org recent web page from 2023, does not match major javascript implementations)\n\n if (\n process.env.NO_COLOR ||\n process.env.FORCE_COLOR === '0' ||\n process.env.FORCE_COLOR === 'false'\n )\n return false;\n if (process.env.FORCE_COLOR || process.env.CLICOLOR_FORCE !== undefined)\n return true;\n return undefined;\n}\n\nexports.Command = Command;\nexports.useColor = useColor; // exporting for tests\n", "const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\nexports.program = new Command();\n\nexports.createCommand = (name) => new Command(name);\nexports.createOption = (flags, description) => new Option(flags, description);\nexports.createArgument = (name, description) => new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexports.Command = Command;\nexports.Option = Option;\nexports.Argument = Argument;\nexports.Help = Help;\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\n", "/**\n * CLI entry point for uloop command.\n * Provides direct Unity communication without MCP server.\n * Commands are dynamically registered from tools.json cache.\n */\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';\nimport { join, basename, dirname } from 'path';\nimport { homedir } from 'os';\nimport { spawn } from 'child_process';\nimport { Command } from 'commander';\nimport {\n executeToolCommand,\n listAvailableTools,\n GlobalOptions,\n syncTools,\n} from './execute-tool.js';\nimport { loadToolsCache, ToolDefinition, ToolProperty } from './tool-cache.js';\nimport { pascalToKebabCase } from './arg-parser.js';\nimport { registerSkillsCommand } from './skills/skills-command.js';\nimport { VERSION } from './version.js';\nimport { findUnityProjectRoot } from './project-root.js';\n\ninterface CliOptions extends GlobalOptions {\n [key: string]: unknown;\n}\n\nconst BUILTIN_COMMANDS = ['list', 'sync', 'completion', 'update', 'skills'] as const;\n\nconst program = new Command();\n\nprogram\n .name('uloop')\n .description('Unity MCP CLI - Direct communication with Unity Editor')\n .version(VERSION, '-v, --version', 'Output the version number');\n\n// --list-commands: Output command names for shell completion\nprogram.option('--list-commands', 'List all command names (for shell completion)');\n\n// --list-options <cmd>: Output options for a specific command (for shell completion)\nprogram.option('--list-options <cmd>', 'List options for a command (for shell completion)');\n\n// Built-in commands (not from tools.json)\nprogram\n .command('list')\n .description('List all available tools from Unity')\n .option('-p, --port <port>', 'Unity TCP port')\n .action(async (options: CliOptions) => {\n await runWithErrorHandling(() => listAvailableTools(options));\n });\n\nprogram\n .command('sync')\n .description('Sync tool definitions from Unity to local cache')\n .option('-p, --port <port>', 'Unity TCP port')\n .action(async (options: CliOptions) => {\n await runWithErrorHandling(() => syncTools(options));\n });\n\nprogram\n .command('completion')\n .description('Setup shell completion')\n .option('--install', 'Install completion to shell config file')\n .option('--shell <type>', 'Shell type: bash, zsh, or powershell')\n .action((options: { install?: boolean; shell?: string }) => {\n handleCompletion(options.install ?? false, options.shell);\n });\n\nprogram\n .command('update')\n .description('Update uloop CLI to the latest version')\n .action(() => {\n updateCli();\n });\n\n// Register skills subcommand\nregisterSkillsCommand(program);\n\n// Load tools from cache and register commands dynamically\nconst toolsCache = loadToolsCache();\nfor (const tool of toolsCache.tools) {\n registerToolCommand(tool);\n}\n\n/**\n * Register a tool as a CLI command dynamically.\n */\nfunction registerToolCommand(tool: ToolDefinition): void {\n const cmd = program.command(tool.name).description(tool.description);\n\n // Add options from inputSchema.properties\n const properties = tool.inputSchema.properties;\n for (const [propName, propInfo] of Object.entries(properties)) {\n const optionStr = generateOptionString(propName, propInfo);\n const description = buildOptionDescription(propInfo);\n const defaultValue = propInfo.default as string | boolean | undefined;\n if (defaultValue !== undefined) {\n cmd.option(optionStr, description, defaultValue);\n } else {\n cmd.option(optionStr, description);\n }\n }\n\n // Add global options\n cmd.option('-p, --port <port>', 'Unity TCP port');\n\n cmd.action(async (options: CliOptions) => {\n const params = buildParams(options, properties);\n\n // Unescape \\! to ! for execute-dynamic-code\n // Some shells (e.g., Claude Code's bash wrapper) escape ! as \\!\n if (tool.name === 'execute-dynamic-code' && params['Code']) {\n const code = params['Code'] as string;\n params['Code'] = code.replace(/\\\\!/g, '!');\n }\n\n await runWithErrorHandling(() =>\n executeToolCommand(tool.name, params, extractGlobalOptions(options)),\n );\n });\n}\n\n/**\n * Generate commander.js option string from property info.\n */\nfunction generateOptionString(propName: string, propInfo: ToolProperty): string {\n const kebabName = pascalToKebabCase(propName);\n const lowerType = propInfo.type.toLowerCase();\n\n if (lowerType === 'boolean') {\n return `--${kebabName}`;\n }\n\n return `--${kebabName} <value>`;\n}\n\n/**\n * Build option description with enum values if present.\n */\nfunction buildOptionDescription(propInfo: ToolProperty): string {\n let desc = propInfo.description || '';\n if (propInfo.enum && propInfo.enum.length > 0) {\n desc += ` (${propInfo.enum.join(', ')})`;\n }\n return desc;\n}\n\n/**\n * Build parameters from CLI options.\n */\nfunction buildParams(\n options: Record<string, unknown>,\n properties: Record<string, ToolProperty>,\n): Record<string, unknown> {\n const params: Record<string, unknown> = {};\n\n for (const propName of Object.keys(properties)) {\n const camelName = propName.charAt(0).toLowerCase() + propName.slice(1);\n const value = options[camelName];\n\n if (value !== undefined) {\n const propInfo = properties[propName];\n params[propName] = convertValue(value, propInfo);\n }\n }\n\n return params;\n}\n\n/**\n * Convert CLI value to appropriate type based on property info.\n */\nfunction convertValue(value: unknown, propInfo: ToolProperty): unknown {\n const lowerType = propInfo.type.toLowerCase();\n\n if (lowerType === 'array' && typeof value === 'string') {\n return value.split(',').map((s) => s.trim());\n }\n\n if (lowerType === 'integer' && typeof value === 'string') {\n const parsed = parseInt(value, 10);\n if (isNaN(parsed)) {\n throw new Error(`Invalid integer value: ${value}`);\n }\n return parsed;\n }\n\n if (lowerType === 'number' && typeof value === 'string') {\n const parsed = parseFloat(value);\n if (isNaN(parsed)) {\n throw new Error(`Invalid number value: ${value}`);\n }\n return parsed;\n }\n\n return value;\n}\n\nfunction extractGlobalOptions(options: Record<string, unknown>): GlobalOptions {\n return {\n port: options['port'] as string | undefined,\n };\n}\n\nfunction isDomainReloadLockFilePresent(): boolean {\n const projectRoot = findUnityProjectRoot();\n if (projectRoot === null) {\n return false;\n }\n const lockPath = join(projectRoot, 'Temp', 'domainreload.lock');\n return existsSync(lockPath);\n}\n\nasync function runWithErrorHandling(fn: () => Promise<void>): Promise<void> {\n try {\n await fn();\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n\n if (message.includes('ECONNREFUSED')) {\n if (isDomainReloadLockFilePresent()) {\n console.error('\\x1b[33m\u23F3 Unity is reloading (Domain Reload in progress).\\x1b[0m');\n console.error('Please wait a moment and try again.');\n } else {\n console.error('\\x1b[31mError: Cannot connect to Unity.\\x1b[0m');\n console.error('Make sure Unity is running with uLoopMCP installed.');\n }\n process.exit(1);\n }\n\n console.error(`\\x1b[31mError: ${message}\\x1b[0m`);\n process.exit(1);\n }\n}\n\n/**\n * Detect shell type from environment.\n */\nfunction detectShell(): 'bash' | 'zsh' | 'powershell' | null {\n // Check $SHELL first (works for bash/zsh including MINGW64)\n const shell = process.env['SHELL'] || '';\n const shellName = basename(shell).replace(/\\.exe$/i, ''); // Remove .exe for Windows\n if (shellName === 'zsh') {\n return 'zsh';\n }\n if (shellName === 'bash') {\n return 'bash';\n }\n\n // Check for PowerShell (only if $SHELL is not set)\n if (process.env['PSModulePath']) {\n return 'powershell';\n }\n\n return null;\n}\n\n/**\n * Get shell config file path.\n */\nfunction getShellConfigPath(shell: 'bash' | 'zsh' | 'powershell'): string {\n const home = homedir();\n if (shell === 'zsh') {\n return join(home, '.zshrc');\n }\n if (shell === 'powershell') {\n // PowerShell profile path\n return join(home, 'Documents', 'WindowsPowerShell', 'Microsoft.PowerShell_profile.ps1');\n }\n return join(home, '.bashrc');\n}\n\n/**\n * Get completion script for a shell.\n */\nfunction getCompletionScript(shell: 'bash' | 'zsh' | 'powershell'): string {\n if (shell === 'bash') {\n return `# uloop bash completion\n_uloop_completions() {\n local cur=\"\\${COMP_WORDS[COMP_CWORD]}\"\n local cmd=\"\\${COMP_WORDS[1]}\"\n\n if [[ \\${COMP_CWORD} -eq 1 ]]; then\n COMPREPLY=($(compgen -W \"$(uloop --list-commands 2>/dev/null)\" -- \"\\${cur}\"))\n elif [[ \\${COMP_CWORD} -ge 2 ]]; then\n COMPREPLY=($(compgen -W \"$(uloop --list-options \\${cmd} 2>/dev/null)\" -- \"\\${cur}\"))\n fi\n}\ncomplete -F _uloop_completions uloop`;\n }\n\n if (shell === 'powershell') {\n return `# uloop PowerShell completion\nRegister-ArgumentCompleter -Native -CommandName uloop -ScriptBlock {\n param($wordToComplete, $commandAst, $cursorPosition)\n $commands = $commandAst.CommandElements\n if ($commands.Count -eq 1) {\n uloop --list-commands 2>$null | Where-Object { $_ -like \"$wordToComplete*\" } | ForEach-Object {\n [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)\n }\n } elseif ($commands.Count -ge 2) {\n $cmd = $commands[1].ToString()\n uloop --list-options $cmd 2>$null | Where-Object { $_ -like \"$wordToComplete*\" } | ForEach-Object {\n [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)\n }\n }\n}`;\n }\n\n /* eslint-disable no-useless-escape */\n return `# uloop zsh completion\n_uloop() {\n local -a commands\n local -a options\n local -a used_options\n\n if (( CURRENT == 2 )); then\n commands=(\\${(f)\"$(uloop --list-commands 2>/dev/null)\"})\n _describe 'command' commands\n elif (( CURRENT >= 3 )); then\n options=(\\${(f)\"$(uloop --list-options \\${words[2]} 2>/dev/null)\"})\n used_options=(\\${words:2})\n for opt in \\${used_options}; do\n options=(\\${options:#\\$opt})\n done\n _describe 'option' options\n fi\n}\ncompdef _uloop uloop`;\n /* eslint-enable no-useless-escape */\n}\n\n/**\n * Update uloop CLI to the latest version using npm.\n */\nfunction updateCli(): void {\n // eslint-disable-next-line no-console\n console.log('Updating uloop-cli to the latest version...');\n\n const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';\n const child = spawn(npmCommand, ['install', '-g', 'uloop-cli@latest'], {\n stdio: 'inherit',\n shell: true,\n });\n\n child.on('close', (code) => {\n if (code === 0) {\n // eslint-disable-next-line no-console\n console.log('\\n\u2705 uloop-cli has been updated successfully!');\n // eslint-disable-next-line no-console\n console.log('Run \"uloop --version\" to check the new version.');\n } else {\n // eslint-disable-next-line no-console\n console.error(`\\n\u274C Update failed with exit code ${code}`);\n process.exit(1);\n }\n });\n\n child.on('error', (err) => {\n // eslint-disable-next-line no-console\n console.error(`\u274C Failed to run npm: ${err.message}`);\n process.exit(1);\n });\n}\n\n/**\n * Handle completion command.\n */\nfunction handleCompletion(install: boolean, shellOverride?: string): void {\n let shell: 'bash' | 'zsh' | 'powershell' | null;\n\n if (shellOverride) {\n const normalized = shellOverride.toLowerCase();\n if (normalized === 'bash' || normalized === 'zsh' || normalized === 'powershell') {\n shell = normalized;\n } else {\n console.error(`Unknown shell: ${shellOverride}. Supported: bash, zsh, powershell`);\n process.exit(1);\n }\n } else {\n shell = detectShell();\n }\n\n if (!shell) {\n console.error('Could not detect shell. Use --shell option: bash, zsh, or powershell');\n process.exit(1);\n }\n\n const script = getCompletionScript(shell);\n\n if (!install) {\n console.log(script);\n return;\n }\n\n // Install to shell config file\n const configPath = getShellConfigPath(shell);\n\n // PowerShell profile directory may not exist on fresh installations\n const configDir = dirname(configPath);\n if (!existsSync(configDir)) {\n mkdirSync(configDir, { recursive: true });\n }\n\n // Remove existing uloop completion and add new one\n let content = '';\n if (existsSync(configPath)) {\n content = readFileSync(configPath, 'utf-8');\n // Remove existing uloop completion block using markers\n content = content.replace(\n /\\n?# >>> uloop completion >>>[\\s\\S]*?# <<< uloop completion <<<\\n?/g,\n '',\n );\n }\n\n // Add new completion with markers\n const startMarker = '# >>> uloop completion >>>';\n const endMarker = '# <<< uloop completion <<<';\n\n if (shell === 'powershell') {\n const lineToAdd = `\\n${startMarker}\\n${script}\\n${endMarker}\\n`;\n writeFileSync(configPath, content + lineToAdd, 'utf-8');\n } else {\n // Include --shell option to ensure correct shell detection\n const evalLine = `eval \"$(uloop completion --shell ${shell})\"`;\n const lineToAdd = `\\n${startMarker}\\n${evalLine}\\n${endMarker}\\n`;\n writeFileSync(configPath, content + lineToAdd, 'utf-8');\n }\n\n console.log(`Completion installed to ${configPath}`);\n if (shell === 'powershell') {\n console.log('Restart PowerShell to enable completion.');\n } else {\n console.log(`Run 'source ${configPath}' or restart your shell to enable completion.`);\n }\n}\n\n/**\n * Handle --list-commands and --list-options before parsing.\n */\nfunction handleCompletionOptions(): boolean {\n const args = process.argv.slice(2);\n\n if (args.includes('--list-commands')) {\n const tools = loadToolsCache();\n const allCommands = [...BUILTIN_COMMANDS, ...tools.tools.map((t) => t.name)];\n console.log(allCommands.join('\\n'));\n return true;\n }\n\n const listOptionsIdx = args.indexOf('--list-options');\n if (listOptionsIdx !== -1 && args[listOptionsIdx + 1]) {\n const cmdName = args[listOptionsIdx + 1];\n listOptionsForCommand(cmdName);\n return true;\n }\n\n return false;\n}\n\n/**\n * List options for a specific command.\n */\nfunction listOptionsForCommand(cmdName: string): void {\n // Built-in commands have no tool-specific options\n if (BUILTIN_COMMANDS.includes(cmdName as (typeof BUILTIN_COMMANDS)[number])) {\n return;\n }\n\n // Tool commands - only output tool-specific options\n const tools = loadToolsCache();\n const tool = tools.tools.find((t) => t.name === cmdName);\n if (!tool) {\n return;\n }\n\n const options: string[] = [];\n for (const propName of Object.keys(tool.inputSchema.properties)) {\n const kebabName = pascalToKebabCase(propName);\n options.push(`--${kebabName}`);\n }\n\n console.log(options.join('\\n'));\n}\n\n// Handle completion options first (before commander parsing)\nif (!handleCompletionOptions()) {\n program.parse();\n}\n", "import commander from './index.js';\n\n// wrapper to provide named exports for ESM.\nexport const {\n program,\n createCommand,\n createArgument,\n createOption,\n CommanderError,\n InvalidArgumentError,\n InvalidOptionArgumentError, // deprecated old name\n Command,\n Argument,\n Option,\n Help,\n} = commander;\n", "/**\n * Direct Unity TCP client for CLI usage.\n * Establishes one-shot TCP connections to Unity without going through MCP server.\n */\n\nimport * as net from 'net';\nimport { createFrame, parseFrameFromBuffer, extractFrameFromBuffer } from './simple-framer.js';\n\nconst JSONRPC_VERSION = '2.0';\nconst DEFAULT_HOST = '127.0.0.1';\nconst NETWORK_TIMEOUT_MS = 180000;\n\nexport interface JsonRpcRequest {\n jsonrpc: string;\n method: string;\n params?: Record<string, unknown>;\n id: number;\n}\n\nexport interface JsonRpcResponse {\n jsonrpc: string;\n result?: unknown;\n error?: {\n code: number;\n message: string;\n data?: unknown;\n };\n id: number;\n}\n\nexport class DirectUnityClient {\n private socket: net.Socket | null = null;\n private requestId: number = 0;\n private receiveBuffer: Buffer = Buffer.alloc(0);\n\n constructor(\n private readonly port: number,\n private readonly host: string = DEFAULT_HOST,\n ) {}\n\n async connect(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.socket = new net.Socket();\n\n this.socket.on('error', (error: Error) => {\n reject(new Error(`Connection error: ${error.message}`));\n });\n\n this.socket.connect(this.port, this.host, () => {\n resolve();\n });\n });\n }\n\n async sendRequest<T>(method: string, params?: Record<string, unknown>): Promise<T> {\n if (!this.socket) {\n throw new Error('Not connected to Unity');\n }\n\n const request: JsonRpcRequest = {\n jsonrpc: JSONRPC_VERSION,\n method,\n params: params ?? {},\n id: ++this.requestId,\n };\n\n const requestJson = JSON.stringify(request);\n const framedMessage = createFrame(requestJson);\n\n return new Promise((resolve, reject) => {\n const socket = this.socket!;\n const timeoutId = setTimeout(() => {\n reject(new Error(`Request timed out after ${NETWORK_TIMEOUT_MS}ms`));\n }, NETWORK_TIMEOUT_MS);\n\n const onData = (chunk: Buffer): void => {\n this.receiveBuffer = Buffer.concat([this.receiveBuffer, chunk]);\n\n const parseResult = parseFrameFromBuffer(this.receiveBuffer);\n if (!parseResult.isComplete) {\n return;\n }\n\n const extractResult = extractFrameFromBuffer(\n this.receiveBuffer,\n parseResult.contentLength,\n parseResult.headerLength,\n );\n\n if (extractResult.jsonContent === null) {\n return;\n }\n\n clearTimeout(timeoutId);\n socket.off('data', onData);\n\n this.receiveBuffer = extractResult.remainingData;\n\n const response = JSON.parse(extractResult.jsonContent) as JsonRpcResponse;\n\n if (response.error) {\n reject(new Error(`Unity error: ${response.error.message}`));\n return;\n }\n\n resolve(response.result as T);\n };\n\n socket.on('data', onData);\n socket.write(framedMessage);\n });\n }\n\n disconnect(): void {\n if (this.socket) {\n this.socket.destroy();\n this.socket = null;\n }\n this.receiveBuffer = Buffer.alloc(0);\n }\n\n isConnected(): boolean {\n return this.socket !== null && !this.socket.destroyed;\n }\n}\n", "/**\n * Simple Content-Length framer for CLI usage.\n * Minimal implementation without external dependencies.\n */\n\nconst CONTENT_LENGTH_HEADER = 'Content-Length:';\nconst HEADER_SEPARATOR = '\\r\\n\\r\\n';\n\nexport function createFrame(jsonContent: string): string {\n const contentLength = Buffer.byteLength(jsonContent, 'utf8');\n return `${CONTENT_LENGTH_HEADER} ${contentLength}${HEADER_SEPARATOR}${jsonContent}`;\n}\n\nexport interface FrameParseResult {\n contentLength: number;\n headerLength: number;\n isComplete: boolean;\n}\n\nexport function parseFrameFromBuffer(data: Buffer): FrameParseResult {\n if (!data || data.length === 0) {\n return { contentLength: -1, headerLength: -1, isComplete: false };\n }\n\n const separatorBuffer = Buffer.from(HEADER_SEPARATOR, 'utf8');\n const separatorIndex = data.indexOf(separatorBuffer);\n\n if (separatorIndex === -1) {\n return { contentLength: -1, headerLength: -1, isComplete: false };\n }\n\n const headerSection = data.subarray(0, separatorIndex).toString('utf8');\n const headerLength = separatorIndex + separatorBuffer.length;\n\n const contentLength = parseContentLength(headerSection);\n if (contentLength === -1) {\n return { contentLength: -1, headerLength: -1, isComplete: false };\n }\n\n const expectedTotalLength = headerLength + contentLength;\n const isComplete = data.length >= expectedTotalLength;\n\n return { contentLength, headerLength, isComplete };\n}\n\nexport interface FrameExtractionResult {\n jsonContent: string | null;\n remainingData: Buffer;\n}\n\nexport function extractFrameFromBuffer(\n data: Buffer,\n contentLength: number,\n headerLength: number,\n): FrameExtractionResult {\n if (!data || data.length === 0 || contentLength < 0 || headerLength < 0) {\n return { jsonContent: null, remainingData: data || Buffer.alloc(0) };\n }\n\n const expectedTotalLength = headerLength + contentLength;\n\n if (data.length < expectedTotalLength) {\n return { jsonContent: null, remainingData: data };\n }\n\n const jsonContent = data.subarray(headerLength, headerLength + contentLength).toString('utf8');\n const remainingData = data.subarray(expectedTotalLength);\n\n return { jsonContent, remainingData };\n}\n\nfunction parseContentLength(headerSection: string): number {\n const lines = headerSection.split(/\\r?\\n/);\n\n for (const line of lines) {\n const trimmedLine = line.trim();\n const lowerLine = trimmedLine.toLowerCase();\n\n if (lowerLine.startsWith('content-length:')) {\n const colonIndex = trimmedLine.indexOf(':');\n if (colonIndex === -1 || colonIndex >= trimmedLine.length - 1) {\n continue;\n }\n\n const valueString = trimmedLine.substring(colonIndex + 1).trim();\n const parsedValue = parseInt(valueString, 10);\n\n if (isNaN(parsedValue) || parsedValue < 0) {\n return -1;\n }\n\n return parsedValue;\n }\n }\n\n return -1;\n}\n", "/**\n * Port resolution utility for CLI.\n * Resolves Unity server port from various sources.\n */\n\nimport { readFile } from 'fs/promises';\nimport { join } from 'path';\nimport { findUnityProjectRoot } from './project-root.js';\n\nconst DEFAULT_PORT = 8700;\n\ninterface UnityMcpSettings {\n serverPort?: number;\n customPort?: number;\n}\n\nexport async function resolveUnityPort(explicitPort?: number): Promise<number> {\n if (explicitPort !== undefined) {\n return explicitPort;\n }\n\n const settingsPort = await readPortFromSettings();\n if (settingsPort !== null) {\n return settingsPort;\n }\n\n return DEFAULT_PORT;\n}\n\nasync function readPortFromSettings(): Promise<number | null> {\n const projectRoot = findUnityProjectRoot();\n if (projectRoot === null) {\n return null;\n }\n const settingsPath = join(projectRoot, 'UserSettings/UnityMcpSettings.json');\n\n let content: string;\n try {\n content = await readFile(settingsPath, 'utf-8');\n } catch {\n return null;\n }\n\n let settings: UnityMcpSettings;\n try {\n settings = JSON.parse(content) as UnityMcpSettings;\n } catch {\n return null;\n }\n\n if (typeof settings.serverPort === 'number') {\n return settings.serverPort;\n }\n\n if (typeof settings.customPort === 'number') {\n return settings.customPort;\n }\n\n return null;\n}\n", "/**\n * Unity project root detection utility.\n * Searches upward from current directory to find Unity project markers.\n */\n\nimport { existsSync } from 'fs';\nimport { join, dirname } from 'path';\n\n/**\n * Find Unity project root by searching upward from start path.\n * A Unity project is identified by having both Assets/ and ProjectSettings/ directories.\n * Returns null if not inside a Unity project.\n */\nexport function findUnityProjectRoot(startPath: string = process.cwd()): string | null {\n let currentPath = startPath;\n\n while (true) {\n const hasAssets = existsSync(join(currentPath, 'Assets'));\n const hasProjectSettings = existsSync(join(currentPath, 'ProjectSettings'));\n\n if (hasAssets && hasProjectSettings) {\n return currentPath;\n }\n\n const parentPath = dirname(currentPath);\n if (parentPath === currentPath) {\n return null;\n }\n currentPath = parentPath;\n }\n}\n", "/**\n * Tool cache management for CLI.\n * Handles loading/saving tool definitions from .uloop/tools.json cache.\n */\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport defaultToolsData from './default-tools.json';\nimport { findUnityProjectRoot } from './project-root.js';\n\nexport interface ToolProperty {\n type: string;\n description?: string;\n default?: unknown;\n enum?: string[];\n items?: { type: string };\n}\n\nexport interface ToolInputSchema {\n type: string;\n properties: Record<string, ToolProperty>;\n required?: string[];\n}\n\nexport interface ToolDefinition {\n name: string;\n description: string;\n inputSchema: ToolInputSchema;\n}\n\nexport interface ToolsCache {\n version: string;\n updatedAt?: string;\n tools: ToolDefinition[];\n}\n\nconst CACHE_DIR = '.uloop';\nconst CACHE_FILE = 'tools.json';\n\nfunction getCacheDir(): string {\n const projectRoot = findUnityProjectRoot();\n if (projectRoot === null) {\n return join(process.cwd(), CACHE_DIR);\n }\n return join(projectRoot, CACHE_DIR);\n}\n\nfunction getCachePath(): string {\n return join(getCacheDir(), CACHE_FILE);\n}\n\n/**\n * Load default tools bundled with npm package.\n */\nexport function getDefaultTools(): ToolsCache {\n return defaultToolsData as ToolsCache;\n}\n\n/**\n * Load tools from cache file, falling back to default tools if cache doesn't exist.\n */\nexport function loadToolsCache(): ToolsCache {\n const cachePath = getCachePath();\n\n if (existsSync(cachePath)) {\n try {\n const content = readFileSync(cachePath, 'utf-8');\n return JSON.parse(content) as ToolsCache;\n } catch {\n return getDefaultTools();\n }\n }\n\n return getDefaultTools();\n}\n\n/**\n * Save tools to cache file.\n */\nexport function saveToolsCache(cache: ToolsCache): void {\n const cacheDir = getCacheDir();\n const cachePath = getCachePath();\n\n if (!existsSync(cacheDir)) {\n mkdirSync(cacheDir, { recursive: true });\n }\n\n const content = JSON.stringify(cache, null, 2);\n writeFileSync(cachePath, content, 'utf-8');\n}\n\n/**\n * Check if cache file exists.\n */\nexport function hasCacheFile(): boolean {\n return existsSync(getCachePath());\n}\n\n/**\n * Get the cache file path for display purposes.\n */\nexport function getCacheFilePath(): string {\n return getCachePath();\n}\n", "{\n \"version\": \"0.44.1\",\n \"tools\": [\n {\n \"name\": \"compile\",\n \"description\": \"Execute Unity project compilation\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ForceRecompile\": {\n \"type\": \"boolean\",\n \"description\": \"Force full recompilation\"\n }\n }\n }\n },\n {\n \"name\": \"get-logs\",\n \"description\": \"Retrieve logs from Unity Console\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"LogType\": {\n \"type\": \"string\",\n \"description\": \"Log type filter\",\n \"enum\": [\n \"Error\",\n \"Warning\",\n \"Log\",\n \"All\"\n ],\n \"default\": \"All\"\n },\n \"MaxCount\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of logs to retrieve\",\n \"default\": 100\n },\n \"SearchText\": {\n \"type\": \"string\",\n \"description\": \"Text to search within logs\"\n },\n \"IncludeStackTrace\": {\n \"type\": \"boolean\",\n \"description\": \"Include stack trace in output\",\n \"default\": true\n },\n \"UseRegex\": {\n \"type\": \"boolean\",\n \"description\": \"Use regex for search\"\n },\n \"SearchInStackTrace\": {\n \"type\": \"boolean\",\n \"description\": \"Search within stack trace\"\n }\n }\n }\n },\n {\n \"name\": \"run-tests\",\n \"description\": \"Execute Unity Test Runner\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"TestMode\": {\n \"type\": \"string\",\n \"description\": \"Test mode\",\n \"enum\": [\n \"EditMode\",\n \"PlayMode\"\n ],\n \"default\": \"EditMode\"\n },\n \"FilterType\": {\n \"type\": \"string\",\n \"description\": \"Filter type\",\n \"enum\": [\n \"all\",\n \"exact\",\n \"regex\",\n \"assembly\"\n ],\n \"default\": \"all\"\n },\n \"FilterValue\": {\n \"type\": \"string\",\n \"description\": \"Filter value\"\n },\n \"SaveXml\": {\n \"type\": \"boolean\",\n \"description\": \"Save test results as XML\"\n }\n }\n }\n },\n {\n \"name\": \"clear-console\",\n \"description\": \"Clear Unity console logs\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"AddConfirmationMessage\": {\n \"type\": \"boolean\",\n \"description\": \"Add confirmation message after clearing\"\n }\n }\n }\n },\n {\n \"name\": \"focus-window\",\n \"description\": \"Bring Unity Editor window to front\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {}\n }\n },\n {\n \"name\": \"get-hierarchy\",\n \"description\": \"Get Unity Hierarchy structure\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"RootPath\": {\n \"type\": \"string\",\n \"description\": \"Root GameObject path\"\n },\n \"MaxDepth\": {\n \"type\": \"integer\",\n \"description\": \"Maximum depth (-1 for unlimited)\",\n \"default\": -1\n },\n \"IncludeComponents\": {\n \"type\": \"boolean\",\n \"description\": \"Include component information\",\n \"default\": true\n },\n \"IncludeInactive\": {\n \"type\": \"boolean\",\n \"description\": \"Include inactive GameObjects\",\n \"default\": true\n },\n \"IncludePaths\": {\n \"type\": \"boolean\",\n \"description\": \"Include path information\"\n }\n }\n }\n },\n {\n \"name\": \"unity-search\",\n \"description\": \"Search Unity project\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"SearchQuery\": {\n \"type\": \"string\",\n \"description\": \"Search query\"\n },\n \"Providers\": {\n \"type\": \"array\",\n \"description\": \"Search providers\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"MaxResults\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of results\",\n \"default\": 50\n },\n \"SaveToFile\": {\n \"type\": \"boolean\",\n \"description\": \"Save results to file\"\n }\n }\n }\n },\n {\n \"name\": \"get-menu-items\",\n \"description\": \"Retrieve Unity MenuItems\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"FilterText\": {\n \"type\": \"string\",\n \"description\": \"Filter text\"\n },\n \"FilterType\": {\n \"type\": \"string\",\n \"description\": \"Filter type\",\n \"enum\": [\n \"contains\",\n \"exact\",\n \"startswith\"\n ],\n \"default\": \"contains\"\n },\n \"MaxCount\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of items\",\n \"default\": 200\n },\n \"IncludeValidation\": {\n \"type\": \"boolean\",\n \"description\": \"Include validation functions\"\n }\n }\n }\n },\n {\n \"name\": \"execute-menu-item\",\n \"description\": \"Execute Unity MenuItem\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"MenuItemPath\": {\n \"type\": \"string\",\n \"description\": \"Menu item path (e.g., \\\"GameObject/Create Empty\\\")\"\n },\n \"UseReflectionFallback\": {\n \"type\": \"boolean\",\n \"description\": \"Use reflection fallback\",\n \"default\": true\n }\n }\n }\n },\n {\n \"name\": \"find-game-objects\",\n \"description\": \"Find GameObjects with search criteria\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"NamePattern\": {\n \"type\": \"string\",\n \"description\": \"Name pattern to search\"\n },\n \"SearchMode\": {\n \"type\": \"string\",\n \"description\": \"Search mode\",\n \"enum\": [\n \"Exact\",\n \"Path\",\n \"Regex\",\n \"Contains\"\n ],\n \"default\": \"Contains\"\n },\n \"RequiredComponents\": {\n \"type\": \"array\",\n \"description\": \"Required components\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"Tag\": {\n \"type\": \"string\",\n \"description\": \"Tag filter\"\n },\n \"Layer\": {\n \"type\": \"string\",\n \"description\": \"Layer filter\"\n },\n \"MaxResults\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of results\",\n \"default\": 20\n },\n \"IncludeInactive\": {\n \"type\": \"boolean\",\n \"description\": \"Include inactive GameObjects\"\n }\n }\n }\n },\n {\n \"name\": \"capture-gameview\",\n \"description\": \"Capture Unity Game View as PNG\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ResolutionScale\": {\n \"type\": \"number\",\n \"description\": \"Resolution scale (0.1 to 1.0)\",\n \"default\": 1\n }\n }\n }\n },\n {\n \"name\": \"execute-dynamic-code\",\n \"description\": \"Execute C# code in Unity Editor\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"Code\": {\n \"type\": \"string\",\n \"description\": \"C# code to execute\"\n },\n \"CompileOnly\": {\n \"type\": \"boolean\",\n \"description\": \"Compile only without execution\"\n },\n \"AutoQualifyUnityTypesOnce\": {\n \"type\": \"boolean\",\n \"description\": \"Auto-qualify Unity types\"\n }\n }\n }\n },\n {\n \"name\": \"get-provider-details\",\n \"description\": \"Get Unity Search provider details\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ProviderId\": {\n \"type\": \"string\",\n \"description\": \"Specific provider ID\"\n },\n \"ActiveOnly\": {\n \"type\": \"boolean\",\n \"description\": \"Only active providers\"\n },\n \"IncludeDescriptions\": {\n \"type\": \"boolean\",\n \"description\": \"Include descriptions\",\n \"default\": true\n },\n \"SortByPriority\": {\n \"type\": \"boolean\",\n \"description\": \"Sort by priority\",\n \"default\": true\n }\n }\n }\n },\n {\n \"name\": \"get-project-info\",\n \"description\": \"Get Unity project information\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {}\n }\n },\n {\n \"name\": \"get-version\",\n \"description\": \"Get uLoopMCP version information\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {}\n }\n }\n ]\n}\n", "/**\n * CLI version\n *\n * This file exists to avoid bundling the entire package.json into the CLI bundle.\n * This version is automatically updated by release-please.\n */\nexport const VERSION = '0.44.1'; // x-release-please-version\n", "/**\n * Tool execution logic for CLI.\n * Handles dynamic tool execution by connecting to Unity and sending requests.\n */\n\nimport { DirectUnityClient } from './direct-unity-client.js';\nimport { resolveUnityPort } from './port-resolver.js';\nimport { saveToolsCache, getCacheFilePath, ToolsCache, ToolDefinition } from './tool-cache.js';\nimport { VERSION } from './version.js';\n\nexport interface GlobalOptions {\n port?: string;\n}\n\nexport async function executeToolCommand(\n toolName: string,\n params: Record<string, unknown>,\n globalOptions: GlobalOptions,\n): Promise<void> {\n let portNumber: number | undefined;\n if (globalOptions.port) {\n const parsed = parseInt(globalOptions.port, 10);\n if (isNaN(parsed)) {\n throw new Error(`Invalid port number: ${globalOptions.port}`);\n }\n portNumber = parsed;\n }\n const port = await resolveUnityPort(portNumber);\n\n const client = new DirectUnityClient(port);\n\n try {\n await client.connect();\n\n const result = await client.sendRequest(toolName, params);\n\n // Always output JSON to match MCP response format\n console.log(JSON.stringify(result, null, 2));\n } finally {\n client.disconnect();\n }\n}\n\nexport async function listAvailableTools(globalOptions: GlobalOptions): Promise<void> {\n let portNumber: number | undefined;\n if (globalOptions.port) {\n const parsed = parseInt(globalOptions.port, 10);\n if (isNaN(parsed)) {\n throw new Error(`Invalid port number: ${globalOptions.port}`);\n }\n portNumber = parsed;\n }\n const port = await resolveUnityPort(portNumber);\n\n const client = new DirectUnityClient(port);\n\n try {\n await client.connect();\n\n const result = await client.sendRequest<{\n Tools: Array<{ name: string; description: string }>;\n }>('get-tool-details', { IncludeDevelopmentOnly: false });\n\n if (!result.Tools || !Array.isArray(result.Tools)) {\n throw new Error('Unexpected response from Unity: missing Tools array');\n }\n\n for (const tool of result.Tools) {\n console.log(` - ${tool.name}`);\n }\n } finally {\n client.disconnect();\n }\n}\n\ninterface UnityToolInfo {\n name: string;\n description: string;\n parameterSchema: {\n Properties: Record<string, UnityPropertyInfo>;\n Required?: string[];\n };\n}\n\ninterface UnityPropertyInfo {\n Type: string;\n Description?: string;\n DefaultValue?: unknown;\n Enum?: string[] | null;\n}\n\nfunction convertProperties(\n unityProps: Record<string, UnityPropertyInfo>,\n): Record<string, ToolDefinition['inputSchema']['properties'][string]> {\n const result: Record<string, ToolDefinition['inputSchema']['properties'][string]> = {};\n for (const [key, prop] of Object.entries(unityProps)) {\n result[key] = {\n type: prop.Type?.toLowerCase() ?? 'string',\n description: prop.Description,\n default: prop.DefaultValue,\n enum: prop.Enum ?? undefined,\n };\n }\n return result;\n}\n\nexport async function syncTools(globalOptions: GlobalOptions): Promise<void> {\n let portNumber: number | undefined;\n if (globalOptions.port) {\n const parsed = parseInt(globalOptions.port, 10);\n if (isNaN(parsed)) {\n throw new Error(`Invalid port number: ${globalOptions.port}`);\n }\n portNumber = parsed;\n }\n const port = await resolveUnityPort(portNumber);\n\n const client = new DirectUnityClient(port);\n\n try {\n await client.connect();\n\n const result = await client.sendRequest<{\n Tools: UnityToolInfo[];\n }>('get-tool-details', { IncludeDevelopmentOnly: false });\n\n if (!result.Tools || !Array.isArray(result.Tools)) {\n throw new Error('Unexpected response from Unity: missing Tools array');\n }\n\n const cache: ToolsCache = {\n version: VERSION,\n updatedAt: new Date().toISOString(),\n tools: result.Tools.map((tool) => ({\n name: tool.name,\n description: tool.description,\n inputSchema: {\n type: 'object',\n properties: convertProperties(tool.parameterSchema.Properties),\n required: tool.parameterSchema.Required,\n },\n })),\n };\n\n saveToolsCache(cache);\n\n console.log(`Synced ${cache.tools.length} tools to ${getCacheFilePath()}`);\n console.log('\\nTools:');\n for (const tool of cache.tools) {\n console.log(` - ${tool.name}`);\n }\n } finally {\n client.disconnect();\n }\n}\n", "/**\n * CLI argument parser for tool parameters.\n * Converts CLI options to Unity tool parameters.\n */\n\nexport interface ToolParameter {\n Type: string;\n Description: string;\n DefaultValue?: unknown;\n Enum?: string[];\n}\n\nexport interface ToolSchema {\n properties: Record<string, ToolParameter>;\n}\n\n/**\n * Converts kebab-case CLI option name to PascalCase parameter name.\n * e.g., \"force-recompile\" -> \"ForceRecompile\"\n */\nexport function kebabToPascalCase(kebab: string): string {\n return kebab\n .split('-')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n}\n\n/**\n * Converts PascalCase parameter name to kebab-case CLI option name.\n * e.g., \"ForceRecompile\" -> \"force-recompile\"\n */\nexport function pascalToKebabCase(pascal: string): string {\n const kebab = pascal.replace(/([A-Z])/g, '-$1').toLowerCase();\n return kebab.startsWith('-') ? kebab.slice(1) : kebab;\n}\n\n/**\n * Parses CLI arguments into tool parameters based on the tool schema.\n */\nexport function parseToolArgs(\n args: string[],\n schema: ToolSchema,\n cliOptions: Record<string, unknown>,\n): Record<string, unknown> {\n const params: Record<string, unknown> = {};\n\n for (const [paramName, paramInfo] of Object.entries(schema.properties)) {\n const kebabName = pascalToKebabCase(paramName);\n const cliValue = cliOptions[kebabName];\n\n if (cliValue === undefined) {\n if (paramInfo.DefaultValue !== undefined) {\n params[paramName] = paramInfo.DefaultValue;\n }\n continue;\n }\n\n params[paramName] = convertValue(cliValue, paramInfo.Type);\n }\n\n return params;\n}\n\nfunction convertValue(value: unknown, type: string): unknown {\n if (value === undefined || value === null) {\n return value;\n }\n\n const lowerType = type.toLowerCase();\n\n switch (lowerType) {\n case 'boolean':\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'string') {\n return value.toLowerCase() === 'true';\n }\n return Boolean(value);\n\n case 'number':\n case 'integer':\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = parseFloat(value);\n return isNaN(parsed) ? 0 : parsed;\n }\n return Number(value);\n\n case 'string':\n if (typeof value === 'string') {\n return value;\n }\n if (typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n return JSON.stringify(value);\n\n case 'array':\n if (Array.isArray(value)) {\n return value;\n }\n if (typeof value === 'string') {\n return value.split(',').map((s) => s.trim());\n }\n return [value];\n\n default:\n return value;\n }\n}\n\n/**\n * Generates commander.js option string from parameter info.\n * e.g., \"--force-recompile\" for boolean, \"--max-count <value>\" for others\n */\nexport function generateOptionString(paramName: string, paramInfo: ToolParameter): string {\n const kebabName = pascalToKebabCase(paramName);\n const lowerType = paramInfo.Type.toLowerCase();\n\n if (lowerType === 'boolean') {\n return `--${kebabName}`;\n }\n\n return `--${kebabName} <value>`;\n}\n", "/**\n * Skills manager for installing/uninstalling/listing uloop skills.\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync, rmSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\nimport { BUNDLED_SKILLS, BundledSkill } from './bundled-skills.js';\n\nexport type SkillStatus = 'installed' | 'not_installed' | 'outdated';\n\nexport interface SkillInfo {\n name: string;\n status: SkillStatus;\n path?: string;\n}\n\nfunction getGlobalSkillsDir(): string {\n return join(homedir(), '.claude', 'skills');\n}\n\nfunction getProjectSkillsDir(): string {\n return join(process.cwd(), '.claude', 'skills');\n}\n\nfunction getSkillPath(skillDirName: string, global: boolean): string {\n const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();\n return join(baseDir, skillDirName, 'SKILL.md');\n}\n\nfunction isSkillInstalled(skill: BundledSkill, global: boolean): boolean {\n const skillPath = getSkillPath(skill.dirName, global);\n return existsSync(skillPath);\n}\n\nfunction isSkillOutdated(skill: BundledSkill, global: boolean): boolean {\n const skillPath = getSkillPath(skill.dirName, global);\n if (!existsSync(skillPath)) {\n return false;\n }\n const installedContent = readFileSync(skillPath, 'utf-8');\n return installedContent !== skill.content;\n}\n\nexport function getSkillStatus(skill: BundledSkill, global: boolean): SkillStatus {\n if (!isSkillInstalled(skill, global)) {\n return 'not_installed';\n }\n if (isSkillOutdated(skill, global)) {\n return 'outdated';\n }\n return 'installed';\n}\n\nexport function getAllSkillStatuses(global: boolean): SkillInfo[] {\n return BUNDLED_SKILLS.map((skill) => ({\n name: skill.name,\n status: getSkillStatus(skill, global),\n path: isSkillInstalled(skill, global) ? getSkillPath(skill.dirName, global) : undefined,\n }));\n}\n\nexport function installSkill(skill: BundledSkill, global: boolean): void {\n const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();\n const skillDir = join(baseDir, skill.dirName);\n const skillPath = join(skillDir, 'SKILL.md');\n\n mkdirSync(skillDir, { recursive: true });\n writeFileSync(skillPath, skill.content, 'utf-8');\n}\n\nexport function uninstallSkill(skill: BundledSkill, global: boolean): boolean {\n const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();\n const skillDir = join(baseDir, skill.dirName);\n\n if (!existsSync(skillDir)) {\n return false;\n }\n\n rmSync(skillDir, { recursive: true, force: true });\n return true;\n}\n\nexport interface InstallResult {\n installed: number;\n updated: number;\n skipped: number;\n}\n\nexport function installAllSkills(global: boolean): InstallResult {\n const result: InstallResult = { installed: 0, updated: 0, skipped: 0 };\n\n for (const skill of BUNDLED_SKILLS) {\n const status = getSkillStatus(skill, global);\n\n if (status === 'not_installed') {\n installSkill(skill, global);\n result.installed++;\n } else if (status === 'outdated') {\n installSkill(skill, global);\n result.updated++;\n } else {\n result.skipped++;\n }\n }\n\n return result;\n}\n\nexport interface UninstallResult {\n removed: number;\n notFound: number;\n}\n\nexport function uninstallAllSkills(global: boolean): UninstallResult {\n const result: UninstallResult = { removed: 0, notFound: 0 };\n\n for (const skill of BUNDLED_SKILLS) {\n if (uninstallSkill(skill, global)) {\n result.removed++;\n } else {\n result.notFound++;\n }\n }\n\n return result;\n}\n\nexport function getInstallDir(global: boolean): string {\n return global ? getGlobalSkillsDir() : getProjectSkillsDir();\n}\n\nexport function getTotalSkillCount(): number {\n return BUNDLED_SKILLS.length;\n}\n", "---\nname: uloop-compile\ndescription: Compile Unity project via uloop CLI. Use when you need to: (1) Verify C# code compiles successfully after editing scripts, (2) Check for compile errors or warnings, (3) Validate script changes before running tests.\n---\n\n# uloop compile\n\nExecute Unity project compilation.\n\n## Usage\n\n```bash\nuloop compile [--force-recompile]\n```\n\n## Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `--force-recompile` | boolean | Force full recompilation (triggers Domain Reload) |\n\n## Examples\n\n```bash\n# Check compilation\nuloop compile\n\n# Force full recompilation\nuloop compile --force-recompile\n```\n\n## Output\n\nReturns JSON:\n- `Success`: boolean\n- `ErrorCount`: number\n- `WarningCount`: number\n", "---\nname: uloop-get-logs\ndescription: Retrieve Unity Console logs via uloop CLI. Use when you need to: (1) Check for errors or warnings after operations, (2) Debug runtime issues in Unity Editor, (3) Investigate unexpected behavior or exceptions.\n---\n\n# uloop get-logs\n\nRetrieve logs from Unity Console.\n\n## Usage\n\n```bash\nuloop get-logs [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--log-type` | string | `All` | Log type filter: `Error`, `Warning`, `Log`, `All` |\n| `--max-count` | integer | `100` | Maximum number of logs to retrieve |\n| `--search-text` | string | - | Text to search within logs |\n| `--include-stack-trace` | boolean | `true` | Include stack trace in output |\n| `--use-regex` | boolean | `false` | Use regex for search |\n| `--search-in-stack-trace` | boolean | `false` | Search within stack trace |\n\n## Examples\n\n```bash\n# Get all logs\nuloop get-logs\n\n# Get only errors\nuloop get-logs --log-type Error\n\n# Search for specific text\nuloop get-logs --search-text \"NullReference\"\n\n# Regex search\nuloop get-logs --search-text \"Missing.*Component\" --use-regex\n```\n\n## Output\n\nReturns JSON array of log entries with message, type, and optional stack trace.\n", "---\nname: uloop-run-tests\ndescription: Execute Unity Test Runner via uloop CLI. Use when you need to: (1) Run unit tests (EditMode tests), (2) Run integration tests (PlayMode tests), (3) Verify code changes don't break existing functionality.\n---\n\n# uloop run-tests\n\nExecute Unity Test Runner.\n\n## Usage\n\n```bash\nuloop run-tests [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--test-mode` | string | `EditMode` | Test mode: `EditMode`, `PlayMode` |\n| `--filter-type` | string | `all` | Filter type: `all`, `exact`, `regex`, `assembly` |\n| `--filter-value` | string | - | Filter value (test name, pattern, or assembly) |\n| `--save-xml` | boolean | `false` | Save test results as XML |\n\n## Examples\n\n```bash\n# Run all EditMode tests\nuloop run-tests\n\n# Run PlayMode tests\nuloop run-tests --test-mode PlayMode\n\n# Run specific test\nuloop run-tests --filter-type exact --filter-value \"MyTest.TestMethod\"\n\n# Run tests matching pattern\nuloop run-tests --filter-type regex --filter-value \".*Integration.*\"\n```\n\n## Output\n\nReturns JSON with test results including pass/fail counts and details.\n", "---\nname: uloop-clear-console\ndescription: Clear Unity console logs via uloop CLI. Use when you need to: (1) Clear the console before running tests, (2) Start a fresh debugging session, (3) Clean up log output for better readability.\n---\n\n# uloop clear-console\n\nClear Unity console logs.\n\n## Usage\n\n```bash\nuloop clear-console [--add-confirmation-message]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--add-confirmation-message` | boolean | `false` | Add confirmation message after clearing |\n\n## Examples\n\n```bash\n# Clear console\nuloop clear-console\n\n# Clear with confirmation\nuloop clear-console --add-confirmation-message\n```\n\n## Output\n\nReturns JSON confirming the console was cleared.\n", "---\nname: uloop-focus-window\ndescription: Bring Unity Editor window to front via uloop CLI. Use when you need to: (1) Focus Unity Editor before capturing screenshots, (2) Ensure Unity window is visible for visual checks, (3) Bring Unity to foreground for user interaction.\n---\n\n# uloop focus-window\n\nBring Unity Editor window to front.\n\n## Usage\n\n```bash\nuloop focus-window\n```\n\n## Parameters\n\nNone.\n\n## Examples\n\n```bash\n# Focus Unity Editor\nuloop focus-window\n```\n\n## Output\n\nReturns JSON confirming the window was focused.\n\n## Notes\n\n- Useful before `uloop capture-gameview` to ensure Game View is visible\n- Brings the main Unity Editor window to the foreground\n", "---\nname: uloop-get-hierarchy\ndescription: Get Unity Hierarchy structure via uloop CLI. Use when you need to: (1) Inspect scene structure and GameObject tree, (2) Find GameObjects and their parent-child relationships, (3) Check component attachments on objects.\n---\n\n# uloop get-hierarchy\n\nGet Unity Hierarchy structure.\n\n## Usage\n\n```bash\nuloop get-hierarchy [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--root-path` | string | - | Root GameObject path to start from |\n| `--max-depth` | integer | `-1` | Maximum depth (-1 for unlimited) |\n| `--include-components` | boolean | `true` | Include component information |\n| `--include-inactive` | boolean | `true` | Include inactive GameObjects |\n| `--include-paths` | boolean | `false` | Include full path information |\n\n## Examples\n\n```bash\n# Get entire hierarchy\nuloop get-hierarchy\n\n# Get hierarchy from specific root\nuloop get-hierarchy --root-path \"Canvas/UI\"\n\n# Limit depth\nuloop get-hierarchy --max-depth 2\n\n# Without components\nuloop get-hierarchy --include-components false\n```\n\n## Output\n\nReturns JSON with hierarchical structure of GameObjects and their components.\n", "---\nname: uloop-unity-search\ndescription: Search Unity project via uloop CLI. Use when you need to: (1) Find assets by name or type (scenes, prefabs, scripts, materials), (2) Search for project resources using Unity's search system, (3) Locate files within the Unity project.\n---\n\n# uloop unity-search\n\nSearch Unity project using Unity Search.\n\n## Usage\n\n```bash\nuloop unity-search [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--search-query` | string | - | Search query |\n| `--providers` | array | - | Search providers (e.g., `asset`, `scene`, `find`) |\n| `--max-results` | integer | `50` | Maximum number of results |\n| `--save-to-file` | boolean | `false` | Save results to file |\n\n## Examples\n\n```bash\n# Search for assets\nuloop unity-search --search-query \"Player\"\n\n# Search with specific provider\nuloop unity-search --search-query \"t:Prefab\" --providers asset\n\n# Limit results\nuloop unity-search --search-query \"*.cs\" --max-results 20\n```\n\n## Output\n\nReturns JSON array of search results with paths and metadata.\n\n## Notes\n\nUse `uloop get-provider-details` to discover available search providers.\n", "---\nname: uloop-get-menu-items\ndescription: Retrieve Unity MenuItems via uloop CLI. Use when you need to: (1) Discover available menu commands in Unity Editor, (2) Find menu paths for automation, (3) Prepare for executing menu items programmatically.\n---\n\n# uloop get-menu-items\n\nRetrieve Unity MenuItems.\n\n## Usage\n\n```bash\nuloop get-menu-items [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--filter-text` | string | - | Filter text |\n| `--filter-type` | string | `contains` | Filter type: `contains`, `exact`, `startswith` |\n| `--max-count` | integer | `200` | Maximum number of items |\n| `--include-validation` | boolean | `false` | Include validation functions |\n\n## Examples\n\n```bash\n# List all menu items\nuloop get-menu-items\n\n# Filter by text\nuloop get-menu-items --filter-text \"GameObject\"\n\n# Exact match\nuloop get-menu-items --filter-text \"File/Save\" --filter-type exact\n```\n\n## Output\n\nReturns JSON array of menu items with paths and metadata.\n\n## Notes\n\nUse with `uloop execute-menu-item` to run discovered menu commands.\n", "---\nname: uloop-execute-menu-item\ndescription: Execute Unity MenuItem via uloop CLI. Use when you need to: (1) Trigger menu commands programmatically, (2) Automate editor actions (save, build, refresh), (3) Run custom menu items defined in scripts.\n---\n\n# uloop execute-menu-item\n\nExecute Unity MenuItem.\n\n## Usage\n\n```bash\nuloop execute-menu-item --menu-item-path \"<path>\"\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--menu-item-path` | string | - | Menu item path (e.g., \"GameObject/Create Empty\") |\n| `--use-reflection-fallback` | boolean | `true` | Use reflection fallback |\n\n## Examples\n\n```bash\n# Create empty GameObject\nuloop execute-menu-item --menu-item-path \"GameObject/Create Empty\"\n\n# Save scene\nuloop execute-menu-item --menu-item-path \"File/Save\"\n\n# Open project settings\nuloop execute-menu-item --menu-item-path \"Edit/Project Settings...\"\n```\n\n## Output\n\nReturns JSON with execution result.\n\n## Notes\n\n- Use `uloop get-menu-items` to discover available menu paths\n- Some menu items may require specific context or selection\n", "---\nname: uloop-find-game-objects\ndescription: Find GameObjects with search criteria via uloop CLI. Use when you need to: (1) Locate GameObjects by name pattern, (2) Find objects by tag or layer, (3) Search for objects with specific component types.\n---\n\n# uloop find-game-objects\n\nFind GameObjects with search criteria.\n\n## Usage\n\n```bash\nuloop find-game-objects [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--name-pattern` | string | - | Name pattern to search |\n| `--search-mode` | string | `Contains` | Search mode: `Exact`, `Path`, `Regex`, `Contains` |\n| `--required-components` | array | - | Required components |\n| `--tag` | string | - | Tag filter |\n| `--layer` | string | - | Layer filter |\n| `--max-results` | integer | `20` | Maximum number of results |\n| `--include-inactive` | boolean | `false` | Include inactive GameObjects |\n\n## Examples\n\n```bash\n# Find by name\nuloop find-game-objects --name-pattern \"Player\"\n\n# Find with component\nuloop find-game-objects --required-components Rigidbody\n\n# Find by tag\nuloop find-game-objects --tag \"Enemy\"\n\n# Regex search\nuloop find-game-objects --name-pattern \"UI_.*\" --search-mode Regex\n```\n\n## Output\n\nReturns JSON array of matching GameObjects with paths and components.\n", "---\nname: uloop-capture-gameview\ndescription: Capture Unity Game View as PNG via uloop CLI. Use when you need to: (1) Take a screenshot of the current Game View, (2) Capture visual state for debugging or verification, (3) Save game output as an image file.\n---\n\n# uloop capture-gameview\n\nCapture Unity Game View and save as PNG image.\n\n## Usage\n\n```bash\nuloop capture-gameview [--resolution-scale <scale>]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--resolution-scale` | number | `1.0` | Resolution scale (0.1 to 1.0) |\n\n## Examples\n\n```bash\n# Capture at full resolution\nuloop capture-gameview\n\n# Capture at half resolution\nuloop capture-gameview --resolution-scale 0.5\n```\n\n## Output\n\nReturns JSON with file path to the saved PNG image.\n\n## Notes\n\n- Use `uloop focus-window` first if needed\n- Game View must be visible in Unity Editor\n", "---\nname: uloop-execute-dynamic-code\ndescription: Execute C# code dynamically in Unity Editor via uloop CLI. Use for editor automation: (1) Prefab/material wiring and AddComponent operations, (2) Reference wiring with SerializedObject, (3) Scene/hierarchy edits and batch operations. NOT for file I/O or script authoring.\n---\n\n# uloop execute-dynamic-code\n\nExecute C# code dynamically in Unity Editor.\n\n## Usage\n\n```bash\nuloop execute-dynamic-code --code '<c# code>'\n```\n\n## Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `--code` | string | C# code to execute (direct statements, no class wrapper) |\n| `--compile-only` | boolean | Compile without execution |\n| `--auto-qualify-unity-types-once` | boolean | Auto-qualify Unity types |\n\n## Code Format\n\nWrite direct statements only (no classes/namespaces/methods). Return is optional.\n\n```csharp\n// Using directives at top are hoisted\nusing UnityEngine;\nvar x = Mathf.PI;\nreturn x;\n```\n\n## String Literals (Shell-specific)\n\n| Shell | Method |\n|-------|--------|\n| bash/zsh/MINGW64/Git Bash | `'Debug.Log(\"Hello!\");'` |\n| PowerShell | `'Debug.Log(\"\"Hello!\"\");'` |\n\n## Allowed Operations\n\n- Prefab/material wiring (PrefabUtility)\n- AddComponent + reference wiring (SerializedObject)\n- Scene/hierarchy edits\n- Inspector modifications\n\n## Forbidden Operations\n\n- System.IO.* (File/Directory/Path)\n- AssetDatabase.CreateFolder / file writes\n- Create/edit .cs/.asmdef files\n\n## Examples\n\n### bash / zsh / MINGW64 / Git Bash\n\n```bash\nuloop execute-dynamic-code --code 'return Selection.activeGameObject?.name;'\nuloop execute-dynamic-code --code 'new GameObject(\"MyObject\");'\nuloop execute-dynamic-code --code 'UnityEngine.Debug.Log(\"Hello from CLI!\");'\n```\n\n### PowerShell\n\n```powershell\nuloop execute-dynamic-code --code 'return Selection.activeGameObject?.name;'\nuloop execute-dynamic-code --code 'new GameObject(\"\"MyObject\"\");'\nuloop execute-dynamic-code --code 'UnityEngine.Debug.Log(\"\"Hello from CLI!\"\");'\n```\n\n## Output\n\nReturns JSON with execution result or compile errors.\n\n## Notes\n\nFor file/directory operations, use terminal commands instead.\n", "---\nname: uloop-get-provider-details\ndescription: Get Unity Search provider details via uloop CLI. Use when you need to: (1) Discover available search providers, (2) Understand search capabilities and filters, (3) Configure searches with specific provider options.\n---\n\n# uloop get-provider-details\n\nGet detailed information about Unity Search providers.\n\n## Usage\n\n```bash\nuloop get-provider-details [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--provider-id` | string | - | Specific provider ID to query |\n| `--active-only` | boolean | `false` | Only show active providers |\n| `--include-descriptions` | boolean | `true` | Include descriptions |\n| `--sort-by-priority` | boolean | `true` | Sort by priority |\n\n## Examples\n\n```bash\n# List all providers\nuloop get-provider-details\n\n# Get specific provider\nuloop get-provider-details --provider-id asset\n\n# Active providers only\nuloop get-provider-details --active-only\n```\n\n## Output\n\nReturns JSON:\n- `Providers`: array of provider info (ID, name, description, priority)\n\n## Notes\n\nUse provider IDs with `uloop unity-search --providers` option.\n", "/**\n * Bundled skill definitions for uloop CLI.\n * These skills are embedded at build time via esbuild --loader:.md=text\n */\n\nimport compileSkill from './skill-definitions/uloop-compile/SKILL.md';\nimport getLogsSkill from './skill-definitions/uloop-get-logs/SKILL.md';\nimport runTestsSkill from './skill-definitions/uloop-run-tests/SKILL.md';\nimport clearConsoleSkill from './skill-definitions/uloop-clear-console/SKILL.md';\nimport focusWindowSkill from './skill-definitions/uloop-focus-window/SKILL.md';\nimport getHierarchySkill from './skill-definitions/uloop-get-hierarchy/SKILL.md';\nimport unitySearchSkill from './skill-definitions/uloop-unity-search/SKILL.md';\nimport getMenuItemsSkill from './skill-definitions/uloop-get-menu-items/SKILL.md';\nimport executeMenuItemSkill from './skill-definitions/uloop-execute-menu-item/SKILL.md';\nimport findGameObjectsSkill from './skill-definitions/uloop-find-game-objects/SKILL.md';\nimport captureGameviewSkill from './skill-definitions/uloop-capture-gameview/SKILL.md';\nimport executeDynamicCodeSkill from './skill-definitions/uloop-execute-dynamic-code/SKILL.md';\nimport getProviderDetailsSkill from './skill-definitions/uloop-get-provider-details/SKILL.md';\n\nexport interface BundledSkill {\n name: string;\n dirName: string;\n content: string;\n}\n\nexport const BUNDLED_SKILLS: BundledSkill[] = [\n { name: 'uloop-compile', dirName: 'uloop-compile', content: compileSkill },\n { name: 'uloop-get-logs', dirName: 'uloop-get-logs', content: getLogsSkill },\n { name: 'uloop-run-tests', dirName: 'uloop-run-tests', content: runTestsSkill },\n { name: 'uloop-clear-console', dirName: 'uloop-clear-console', content: clearConsoleSkill },\n { name: 'uloop-focus-window', dirName: 'uloop-focus-window', content: focusWindowSkill },\n { name: 'uloop-get-hierarchy', dirName: 'uloop-get-hierarchy', content: getHierarchySkill },\n { name: 'uloop-unity-search', dirName: 'uloop-unity-search', content: unitySearchSkill },\n { name: 'uloop-get-menu-items', dirName: 'uloop-get-menu-items', content: getMenuItemsSkill },\n {\n name: 'uloop-execute-menu-item',\n dirName: 'uloop-execute-menu-item',\n content: executeMenuItemSkill,\n },\n {\n name: 'uloop-find-game-objects',\n dirName: 'uloop-find-game-objects',\n content: findGameObjectsSkill,\n },\n {\n name: 'uloop-capture-gameview',\n dirName: 'uloop-capture-gameview',\n content: captureGameviewSkill,\n },\n {\n name: 'uloop-execute-dynamic-code',\n dirName: 'uloop-execute-dynamic-code',\n content: executeDynamicCodeSkill,\n },\n {\n name: 'uloop-get-provider-details',\n dirName: 'uloop-get-provider-details',\n content: getProviderDetailsSkill,\n },\n];\n\nexport function getBundledSkillByName(name: string): BundledSkill | undefined {\n return BUNDLED_SKILLS.find((skill) => skill.name === name);\n}\n", "/**\n * CLI command definitions for skills management.\n */\n\nimport { Command } from 'commander';\nimport {\n getAllSkillStatuses,\n installAllSkills,\n uninstallAllSkills,\n getInstallDir,\n getTotalSkillCount,\n} from './skills-manager.js';\n\nexport function registerSkillsCommand(program: Command): void {\n const skillsCmd = program.command('skills').description('Manage uloop skills for Claude Code');\n\n skillsCmd\n .command('list')\n .description('List all uloop skills and their installation status')\n .option('-g, --global', 'Check global installation (~/.claude/skills/)')\n .action((options: { global?: boolean }) => {\n listSkills(options.global ?? false);\n });\n\n skillsCmd\n .command('install')\n .description('Install all uloop skills')\n .option('-g, --global', 'Install to global location (~/.claude/skills/)')\n .action((options: { global?: boolean }) => {\n installSkills(options.global ?? false);\n });\n\n skillsCmd\n .command('uninstall')\n .description('Uninstall all uloop skills')\n .option('-g, --global', 'Uninstall from global location (~/.claude/skills/)')\n .action((options: { global?: boolean }) => {\n uninstallSkills(options.global ?? false);\n });\n}\n\nfunction listSkills(global: boolean): void {\n const location = global ? 'Global' : 'Project';\n const dir = getInstallDir(global);\n\n console.log(`\\nuloop Skills Status (${location}):`);\n console.log(`Location: ${dir}`);\n console.log('='.repeat(50));\n console.log('');\n\n const statuses = getAllSkillStatuses(global);\n\n for (const skill of statuses) {\n const icon = getStatusIcon(skill.status);\n const statusText = getStatusText(skill.status);\n console.log(` ${icon} ${skill.name} (${statusText})`);\n }\n\n console.log('');\n console.log(`Total: ${getTotalSkillCount()} bundled skills`);\n}\n\nfunction getStatusIcon(status: string): string {\n switch (status) {\n case 'installed':\n return '\\x1b[32m\u2713\\x1b[0m';\n case 'outdated':\n return '\\x1b[33m\u2191\\x1b[0m';\n case 'not_installed':\n return '\\x1b[31m\u2717\\x1b[0m';\n default:\n return '?';\n }\n}\n\nfunction getStatusText(status: string): string {\n switch (status) {\n case 'installed':\n return 'installed';\n case 'outdated':\n return 'outdated';\n case 'not_installed':\n return 'not installed';\n default:\n return 'unknown';\n }\n}\n\nfunction installSkills(global: boolean): void {\n const location = global ? 'global' : 'project';\n const dir = getInstallDir(global);\n\n console.log(`\\nInstalling uloop skills (${location})...`);\n console.log('');\n\n const result = installAllSkills(global);\n\n console.log(`\\x1b[32m\u2713\\x1b[0m Installed: ${result.installed}`);\n console.log(`\\x1b[33m\u2191\\x1b[0m Updated: ${result.updated}`);\n console.log(`\\x1b[90m-\\x1b[0m Skipped (up-to-date): ${result.skipped}`);\n console.log('');\n console.log(`Skills installed to ${dir}`);\n}\n\nfunction uninstallSkills(global: boolean): void {\n const location = global ? 'global' : 'project';\n const dir = getInstallDir(global);\n\n console.log(`\\nUninstalling uloop skills (${location})...`);\n console.log('');\n\n const result = uninstallAllSkills(global);\n\n console.log(`\\x1b[31m\u2717\\x1b[0m Removed: ${result.removed}`);\n console.log(`\\x1b[90m-\\x1b[0m Not found: ${result.notFound}`);\n console.log('');\n console.log(`Skills removed from ${dir}`);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,wCAAAA,UAAA;AAGA,QAAMC,kBAAN,cAA6B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOjC,YAAY,UAAU,MAAM,SAAS;AACnC,cAAM,OAAO;AAEb,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,aAAK,OAAO,KAAK,YAAY;AAC7B,aAAK,OAAO;AACZ,aAAK,WAAW;AAChB,aAAK,cAAc;AAAA,MACrB;AAAA,IACF;AAKA,QAAMC,wBAAN,cAAmCD,gBAAe;AAAA;AAAA;AAAA;AAAA;AAAA,MAKhD,YAAY,SAAS;AACnB,cAAM,GAAG,6BAA6B,OAAO;AAE7C,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,aAAK,OAAO,KAAK,YAAY;AAAA,MAC/B;AAAA,IACF;AAEA,IAAAD,SAAQ,iBAAiBC;AACzB,IAAAD,SAAQ,uBAAuBE;AAAA;AAAA;;;ACtC/B;AAAA,2CAAAC,UAAA;AAAA,QAAM,EAAE,sBAAAC,sBAAqB,IAAI;AAEjC,QAAMC,YAAN,MAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUb,YAAY,MAAM,aAAa;AAC7B,aAAK,cAAc,eAAe;AAClC,aAAK,WAAW;AAChB,aAAK,WAAW;AAChB,aAAK,eAAe;AACpB,aAAK,0BAA0B;AAC/B,aAAK,aAAa;AAElB,gBAAQ,KAAK,CAAC,GAAG;AAAA,UACf,KAAK;AACH,iBAAK,WAAW;AAChB,iBAAK,QAAQ,KAAK,MAAM,GAAG,EAAE;AAC7B;AAAA,UACF,KAAK;AACH,iBAAK,WAAW;AAChB,iBAAK,QAAQ,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T;AAAA,EACF;AAEA,QAAM,UAAoB,CAAC;AAC3B,aAAW,YAAY,OAAO,KAAK,KAAK,YAAY,UAAU,GAAG;AAC/D,UAAM,YAAY,kBAAkB,QAAQ;AAC5C,YAAQ,KAAK,KAAK,SAAS,EAAE;AAAA,EAC/B;AAEA,UAAQ,IAAI,QAAQ,KAAK,IAAI,CAAC;AAChC;AAGA,IAAI,CAAC,wBAAwB,GAAG;AAC9B,EAAAA,SAAQ,MAAM;AAChB;",
6
- "names": ["exports", "CommanderError", "InvalidArgumentError", "exports", "InvalidArgumentError", "Argument", "exports", "Help", "cmd", "exports", "InvalidArgumentError", "Option", "str", "exports", "exports", "process", "Argument", "CommanderError", "Help", "Option", "Command", "option", "path", "exports", "Argument", "Command", "CommanderError", "InvalidArgumentError", "Help", "Option", "import_fs", "import_path", "import_os", "commander", "import_path", "import_fs", "import_path", "import_fs", "import_path", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "program", "program"]
3
+ "sources": ["../node_modules/commander/lib/error.js", "../node_modules/commander/lib/argument.js", "../node_modules/commander/lib/help.js", "../node_modules/commander/lib/option.js", "../node_modules/commander/lib/suggestSimilar.js", "../node_modules/commander/lib/command.js", "../node_modules/commander/index.js", "../src/cli.ts", "../node_modules/commander/esm.mjs", "../src/execute-tool.ts", "../src/direct-unity-client.ts", "../src/simple-framer.ts", "../src/port-resolver.ts", "../src/project-root.ts", "../src/tool-cache.ts", "../src/default-tools.json", "../src/version.ts", "../src/spinner.ts", "../src/arg-parser.ts", "../src/skills/skills-manager.ts", "../src/skills/skill-definitions/uloop-compile/SKILL.md", "../src/skills/skill-definitions/uloop-get-logs/SKILL.md", "../src/skills/skill-definitions/uloop-run-tests/SKILL.md", "../src/skills/skill-definitions/uloop-clear-console/SKILL.md", "../src/skills/skill-definitions/uloop-focus-window/SKILL.md", "../src/skills/skill-definitions/uloop-get-hierarchy/SKILL.md", "../src/skills/skill-definitions/uloop-unity-search/SKILL.md", "../src/skills/skill-definitions/uloop-get-menu-items/SKILL.md", "../src/skills/skill-definitions/uloop-execute-menu-item/SKILL.md", "../src/skills/skill-definitions/uloop-find-game-objects/SKILL.md", "../src/skills/skill-definitions/uloop-capture-gameview/SKILL.md", "../src/skills/skill-definitions/uloop-execute-dynamic-code/SKILL.md", "../src/skills/skill-definitions/uloop-get-provider-details/SKILL.md", "../src/skills/bundled-skills.ts", "../src/skills/skills-command.ts"],
4
+ "sourcesContent": ["/**\n * CommanderError class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n", "const { InvalidArgumentError } = require('./error.js');\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.endsWith('...')) {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n", "const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map<string, Command[] | Option[]>}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripColor(str).length;\n }\n\n /**\n * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.\n *\n * @param {string} str\n * @returns {string}\n */\n styleTitle(str) {\n return str;\n }\n\n styleUsage(str) {\n // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:\n // command subcommand [options] [command] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word === '[command]') return this.styleSubcommandText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleCommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleCommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleOptionDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleSubcommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleArgumentDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleDescriptionText(str) {\n return str;\n }\n styleOptionTerm(str) {\n return this.styleOptionText(str);\n }\n styleSubcommandTerm(str) {\n // This is very like usage with lots of parts! Assume default string which is formed like:\n // subcommand [options] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleSubcommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleArgumentTerm(str) {\n return this.styleArgumentText(str);\n }\n styleOptionText(str) {\n return str;\n }\n styleArgumentText(str) {\n return str;\n }\n styleSubcommandText(str) {\n return str;\n }\n styleCommandText(str) {\n return str;\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper),\n );\n }\n\n /**\n * Detect manually wrapped and indented strings by checking for line break followed by whitespace.\n *\n * @param {string} str\n * @returns {boolean}\n */\n preformatted(str) {\n return /\\n[^\\S\\r\\n]/.test(str);\n }\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n *\n * @param {string} term\n * @param {number} termWidth\n * @param {string} description\n * @param {Help} helper\n * @returns {string}\n */\n formatItem(term, termWidth, description, helper) {\n const itemIndent = 2;\n const itemIndentStr = ' '.repeat(itemIndent);\n if (!description) return itemIndentStr + term;\n\n // Pad the term out to a consistent width, so descriptions are aligned.\n const paddedTerm = term.padEnd(\n termWidth + term.length - helper.displayWidth(term),\n );\n\n // Format the description.\n const spacerWidth = 2; // between term and description\n const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called\n const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;\n let formattedDescription;\n if (\n remainingWidth < this.minWidthToWrap ||\n helper.preformatted(description)\n ) {\n formattedDescription = description;\n } else {\n const wrappedDescription = helper.boxWrap(description, remainingWidth);\n formattedDescription = wrappedDescription.replace(\n /\\n/g,\n '\\n' + ' '.repeat(termWidth + spacerWidth),\n );\n }\n\n // Construct and overall indent.\n return (\n itemIndentStr +\n paddedTerm +\n ' '.repeat(spacerWidth) +\n formattedDescription.replace(/\\n/g, `\\n${itemIndentStr}`)\n );\n }\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n *\n * @param {string} str\n * @param {number} width\n * @returns {string}\n */\n boxWrap(str, width) {\n if (width < this.minWidthToWrap) return str;\n\n const rawLines = str.split(/\\r\\n|\\n/);\n // split up text by whitespace\n const chunkPattern = /[\\s]*[^\\s]+/g;\n const wrappedLines = [];\n rawLines.forEach((line) => {\n const chunks = line.match(chunkPattern);\n if (chunks === null) {\n wrappedLines.push('');\n return;\n }\n\n let sumChunks = [chunks.shift()];\n let sumWidth = this.displayWidth(sumChunks[0]);\n chunks.forEach((chunk) => {\n const visibleWidth = this.displayWidth(chunk);\n // Accumulate chunks while they fit into width.\n if (sumWidth + visibleWidth <= width) {\n sumChunks.push(chunk);\n sumWidth += visibleWidth;\n return;\n }\n wrappedLines.push(sumChunks.join(''));\n\n const nextChunk = chunk.trimStart(); // trim space at line break\n sumChunks = [nextChunk];\n sumWidth = this.displayWidth(nextChunk);\n });\n wrappedLines.push(sumChunks.join(''));\n });\n\n return wrappedLines.join('\\n');\n }\n}\n\n/**\n * Strip style ANSI escape sequences from the string. In particular, SGR (Select Graphic Rendition) codes.\n *\n * @param {string} str\n * @returns {string}\n * @package\n */\n\nfunction stripColor(str) {\n // eslint-disable-next-line no-control-regex\n const sgrPattern = /\\x1b\\[\\d*(;\\d*)*m/g;\n return str.replace(sgrPattern, '');\n}\n\nexports.Help = Help;\nexports.stripColor = stripColor;\n", "const { InvalidArgumentError } = require('./error.js');\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nclass DualOptions {\n /**\n * @param {Option[]} options\n */\n constructor(options) {\n this.positiveOptions = new Map();\n this.negativeOptions = new Map();\n this.dualOptions = new Set();\n options.forEach((option) => {\n if (option.negate) {\n this.negativeOptions.set(option.attributeName(), option);\n } else {\n this.positiveOptions.set(option.attributeName(), option);\n }\n });\n this.negativeOptions.forEach((value, key) => {\n if (this.positiveOptions.has(key)) {\n this.dualOptions.add(key);\n }\n });\n }\n\n /**\n * Did the value come from the option, and not from possible matching dual option?\n *\n * @param {*} value\n * @param {Option} option\n * @returns {boolean}\n */\n valueFromOption(value, option) {\n const optionKey = option.attributeName();\n if (!this.dualOptions.has(optionKey)) return true;\n\n // Use the value to deduce if (probably) came from the option.\n const preset = this.negativeOptions.get(optionKey).presetArg;\n const negativeValue = preset !== undefined ? preset : false;\n return option.negate === (negativeValue === value);\n }\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // short flag, single dash and single character\n const shortFlagExp = /^-[^-]$/;\n // long flag, double dash and at least one character\n const longFlagExp = /^--[^-]/;\n\n const flagParts = flags.split(/[ |,]+/).concat('guard');\n // Normal is short and/or long.\n if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();\n if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();\n // Long then short. Rarely used but fine.\n if (!shortFlag && shortFlagExp.test(flagParts[0]))\n shortFlag = flagParts.shift();\n // Allow two long flags, like '--ws, --workspace'\n // This is the supported way to have a shortish option flag.\n if (!shortFlag && longFlagExp.test(flagParts[0])) {\n shortFlag = longFlag;\n longFlag = flagParts.shift();\n }\n\n // Check for unprocessed flag. Fail noisily rather than silently ignore.\n if (flagParts[0].startsWith('-')) {\n const unsupportedFlag = flagParts[0];\n const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;\n if (/^-[^-][^-]/.test(unsupportedFlag))\n throw new Error(\n `${baseError}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`,\n );\n if (shortFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many short flags`);\n if (longFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many long flags`);\n\n throw new Error(`${baseError}\n- unrecognised flag format`);\n }\n if (shortFlag === undefined && longFlag === undefined)\n throw new Error(\n `option creation failed due to no flags found in '${flags}'.`,\n );\n\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.DualOptions = DualOptions;\n", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance)\n return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost, // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map((candidate) => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map((candidate) => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n", "const EventEmitter = require('node:events').EventEmitter;\nconst childProcess = require('node:child_process');\nconst path = require('node:path');\nconst fs = require('node:fs');\nconst process = require('node:process');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help, stripColor } = require('./help.js');\nconst { Option, DualOptions } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = false;\n /** @type {Argument[]} */\n this.registeredArguments = [];\n this._args = this.registeredArguments; // deprecated old name\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default, env, cli etc\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._executableDir = null; // custom search directory for subcommands\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._summary = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {(boolean | string)} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = true;\n this._savedState = null; // used in save/restoreStateBeforeParse\n\n // see configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n outputError: (str, write) => write(str),\n getOutHelpWidth: () =>\n process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () =>\n process.stderr.isTTY ? process.stderr.columns : undefined,\n getOutHasColors: () =>\n useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),\n getErrHasColors: () =>\n useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),\n stripColor: (str) => stripColor(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = {\n ...this._outputConfiguration,\n ...configuration,\n };\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument?.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.negate) {\n // --no-foo is special and defaults foo to true, unless a --foo option is already defined\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n name,\n option.defaultValue === undefined ? true : option.defaultValue,\n 'default',\n );\n }\n } else if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._collectValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, parseArg, defaultValue) {\n return this._optionEx({}, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, parseArg, defaultValue) {\n return this._optionEx(\n { mandatory: true },\n flags,\n description,\n parseArg,\n defaultValue,\n );\n }\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.\n * @return {Command} `this` command for chaining\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n }\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.\n * @return {Command} `this` command for chaining\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n }\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.\n * @return {Command} `this` command for chaining\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n }\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {boolean} [positional]\n * @return {Command} `this` command for chaining\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n }\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {boolean} [passThrough] for unknown options.\n * @return {Command} `this` command for chaining\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n this._checkForBrokenPassThrough();\n return this;\n }\n\n /**\n * @private\n */\n\n _checkForBrokenPassThrough() {\n if (\n this.parent &&\n this._passThroughOptions &&\n !this.parent._enablePositionalOptions\n ) {\n throw new Error(\n `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`,\n );\n }\n }\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n if (Object.keys(this._optionValues).length) {\n throw new Error(\n 'call .storeOptionsAsProperties() before setting option values',\n );\n }\n this._storeOptionsAsProperties = !!storeAsProperties;\n return this;\n }\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n }\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n return this.setOptionValueWithSource(key, value, undefined);\n }\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {object} value\n * @param {string} source - expected values are default/config/env/cli/implied\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n }\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSourceWithGlobals(key) {\n // global overwrites local, like optsWithGlobals\n let source;\n this._getCommandAndAncestors().forEach((cmd) => {\n if (cmd.getOptionValueSource(key) !== undefined) {\n source = cmd.getOptionValueSource(key);\n }\n });\n return source;\n }\n\n /**\n * Get user arguments from implied or explicit arguments.\n * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.\n *\n * @private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // auto-detect argument conventions if nothing supplied\n if (argv === undefined && parseOptions.from === undefined) {\n if (process.versions?.electron) {\n parseOptions.from = 'electron';\n }\n // check node specific options for scenarios where user CLI args follow executable without scriptname\n const execArgv = process.execArgv ?? [];\n if (\n execArgv.includes('-e') ||\n execArgv.includes('--eval') ||\n execArgv.includes('-p') ||\n execArgv.includes('--print')\n ) {\n parseOptions.from = 'eval'; // internal usage, not documented\n }\n }\n\n // default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n }\n this.rawArgs = argv.slice();\n\n // extract the user args and scriptPath\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: because defaultApp is an unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n case 'eval':\n userArgs = argv.slice(1);\n break;\n default:\n throw new Error(\n `unexpected parse option { from: '${parseOptions.from}' }`,\n );\n }\n\n // Find default name for program from arguments.\n if (!this._name && this._scriptPath)\n this.nameFromFilename(this._scriptPath);\n this._name = this._name || 'program';\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n }\n\n _prepareForParse() {\n if (this._savedState === null) {\n this.saveStateBeforeParse();\n } else {\n this.restoreStateBeforeParse();\n }\n }\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse() {\n this._savedState = {\n // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing\n _name: this._name,\n // option values before parse have default values (including false for negated options)\n // shallow clones\n _optionValues: { ...this._optionValues },\n _optionValueSources: { ...this._optionValueSources },\n };\n }\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse() {\n if (this._storeOptionsAsProperties)\n throw new Error(`Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties`);\n\n // clear state from _prepareUserArgs\n this._name = this._savedState._name;\n this._scriptPath = null;\n this.rawArgs = [];\n // clear state from setOptionValueWithSource\n this._optionValues = { ...this._savedState._optionValues };\n this._optionValueSources = { ...this._savedState._optionValueSources };\n // clear state from _parseCommand\n this.args = [];\n // clear state from _processArguments\n this.processedArgs = [];\n }\n\n /**\n * Throw if expected executable is missing. Add lots of help for author.\n *\n * @param {string} executableFile\n * @param {string} executableDir\n * @param {string} subcommandName\n */\n _checkForMissingExecutable(executableFile, executableDir, subcommandName) {\n if (fs.existsSync(executableFile)) return;\n\n const executableDirMessage = executableDir\n ? `searched for local subcommand relative to directory '${executableDir}'`\n : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';\n const executableMissing = `'${executableFile}' does not exist\n - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`;\n throw new Error(executableMissing);\n }\n\n /**\n * Execute a sub-command executable.\n *\n * @private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for specified file\n const localBin = path.resolve(baseDir, baseName);\n if (fs.existsSync(localBin)) return localBin;\n\n // Stop looking if candidate already has an expected extension.\n if (sourceExt.includes(path.extname(baseName))) return undefined;\n\n // Try all the extensions.\n const foundExt = sourceExt.find((ext) =>\n fs.existsSync(`${localBin}${ext}`),\n );\n if (foundExt) return `${localBin}${foundExt}`;\n\n return undefined;\n }\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // executableFile and executableDir might be full path, or just a name\n let executableFile =\n subcommand._executableFile || `${this._name}-${subcommand._name}`;\n let executableDir = this._executableDir || '';\n if (this._scriptPath) {\n let resolvedScriptPath; // resolve possible symlink for installed npm binary\n try {\n resolvedScriptPath = fs.realpathSync(this._scriptPath);\n } catch {\n resolvedScriptPath = this._scriptPath;\n }\n executableDir = path.resolve(\n path.dirname(resolvedScriptPath),\n executableDir,\n );\n }\n\n // Look for a local file in preference to a command in PATH.\n if (executableDir) {\n let localFile = findFile(executableDir, executableFile);\n\n // Legacy search using prefix of script name instead of command name\n if (!localFile && !subcommand._executableFile && this._scriptPath) {\n const legacyName = path.basename(\n this._scriptPath,\n path.extname(this._scriptPath),\n );\n if (legacyName !== this._name) {\n localFile = findFile(\n executableDir,\n `${legacyName}-${subcommand._name}`,\n );\n }\n }\n executableFile = localFile || executableFile;\n }\n\n launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise?.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent?.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} args\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(args) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-(\\d+|\\d*\\.\\d+)(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n let activeGroup = null; // working through group of short options, like -abc\n let i = 0;\n while (i < args.length || activeGroup) {\n const arg = activeGroup ?? args[i++];\n activeGroup = null;\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args.slice(i));\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args[i++];\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n i < args.length &&\n (!maybeOption(args[i]) || negativeNumberArg(args[i]))\n ) {\n value = args[i++];\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option\n this.emit(`option:${option.name()}`);\n // remove the processed option and keep processing group\n activeGroup = `-${arg.slice(2)}`;\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n unknown.push(...args.slice(i));\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg, ...args.slice(i));\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg, ...args.slice(i));\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg, ...args.slice(i));\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(require.main.filename);\n *\n * @param {string} filename\n * @return {Command}\n */\n\n nameFromFilename(filename) {\n this._name = path.basename(filename, path.extname(filename));\n\n return this;\n }\n\n /**\n * Get or set the directory for searching for executable subcommands of this command.\n *\n * @example\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * @returns {boolean | undefined}\n * @package\n */\nfunction useColor() {\n // Test for common conventions.\n // NB: the observed behaviour is in combination with how author adds color! For example:\n // - we do not test NODE_DISABLE_COLORS, but util:styletext does\n // - we do test NO_COLOR, but Chalk does not\n //\n // References:\n // https://no-color.org\n // https://bixense.com/clicolors/\n // https://github.com/nodejs/node/blob/0a00217a5f67ef4a22384cfc80eb6dd9a917fdc1/lib/internal/tty.js#L109\n // https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L33\n // (https://force-color.org recent web page from 2023, does not match major javascript implementations)\n\n if (\n process.env.NO_COLOR ||\n process.env.FORCE_COLOR === '0' ||\n process.env.FORCE_COLOR === 'false'\n )\n return false;\n if (process.env.FORCE_COLOR || process.env.CLICOLOR_FORCE !== undefined)\n return true;\n return undefined;\n}\n\nexports.Command = Command;\nexports.useColor = useColor; // exporting for tests\n", "const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\nexports.program = new Command();\n\nexports.createCommand = (name) => new Command(name);\nexports.createOption = (flags, description) => new Option(flags, description);\nexports.createArgument = (name, description) => new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexports.Command = Command;\nexports.Option = Option;\nexports.Argument = Argument;\nexports.Help = Help;\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\n", "/**\n * CLI entry point for uloop command.\n * Provides direct Unity communication without MCP server.\n * Commands are dynamically registered from tools.json cache.\n */\n\n// CLI tools output to console by design, file paths are constructed from trusted sources (project root detection),\n// and object keys come from tool definitions which are internal trusted data\n/* eslint-disable no-console, security/detect-non-literal-fs-filename, security/detect-object-injection */\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs';\nimport { join, basename, dirname } from 'path';\nimport { homedir } from 'os';\nimport { spawn } from 'child_process';\nimport { Command } from 'commander';\nimport {\n executeToolCommand,\n listAvailableTools,\n GlobalOptions,\n syncTools,\n} from './execute-tool.js';\nimport { loadToolsCache, ToolDefinition, ToolProperty } from './tool-cache.js';\nimport { pascalToKebabCase } from './arg-parser.js';\nimport { registerSkillsCommand } from './skills/skills-command.js';\nimport { VERSION } from './version.js';\nimport { findUnityProjectRoot } from './project-root.js';\n\ninterface CliOptions extends GlobalOptions {\n [key: string]: unknown;\n}\n\nconst BUILTIN_COMMANDS = ['list', 'sync', 'completion', 'update', 'fix', 'skills'] as const;\n\nconst program = new Command();\n\nprogram\n .name('uloop')\n .description('Unity MCP CLI - Direct communication with Unity Editor')\n .version(VERSION, '-v, --version', 'Output the version number');\n\n// --list-commands: Output command names for shell completion\nprogram.option('--list-commands', 'List all command names (for shell completion)');\n\n// --list-options <cmd>: Output options for a specific command (for shell completion)\nprogram.option('--list-options <cmd>', 'List options for a command (for shell completion)');\n\n// Built-in commands (not from tools.json)\nprogram\n .command('list')\n .description('List all available tools from Unity')\n .option('-p, --port <port>', 'Unity TCP port')\n .action(async (options: CliOptions) => {\n await runWithErrorHandling(() => listAvailableTools(options));\n });\n\nprogram\n .command('sync')\n .description('Sync tool definitions from Unity to local cache')\n .option('-p, --port <port>', 'Unity TCP port')\n .action(async (options: CliOptions) => {\n await runWithErrorHandling(() => syncTools(options));\n });\n\nprogram\n .command('completion')\n .description('Setup shell completion')\n .option('--install', 'Install completion to shell config file')\n .option('--shell <type>', 'Shell type: bash, zsh, or powershell')\n .action((options: { install?: boolean; shell?: string }) => {\n handleCompletion(options.install ?? false, options.shell);\n });\n\nprogram\n .command('update')\n .description('Update uloop CLI to the latest version')\n .action(() => {\n updateCli();\n });\n\nprogram\n .command('fix')\n .description('Clean up stale lock files that may prevent CLI from connecting')\n .action(() => {\n cleanupLockFiles();\n });\n\n// Register skills subcommand\nregisterSkillsCommand(program);\n\n// Load tools from cache and register commands dynamically\nconst toolsCache = loadToolsCache();\nfor (const tool of toolsCache.tools) {\n registerToolCommand(tool);\n}\n\n/**\n * Register a tool as a CLI command dynamically.\n */\nfunction registerToolCommand(tool: ToolDefinition): void {\n const cmd = program.command(tool.name).description(tool.description);\n\n // Add options from inputSchema.properties\n const properties = tool.inputSchema.properties;\n for (const [propName, propInfo] of Object.entries(properties)) {\n const optionStr = generateOptionString(propName, propInfo);\n const description = buildOptionDescription(propInfo);\n const defaultValue = propInfo.default as string | boolean | undefined;\n if (defaultValue !== undefined) {\n cmd.option(optionStr, description, defaultValue);\n } else {\n cmd.option(optionStr, description);\n }\n }\n\n // Add global options\n cmd.option('-p, --port <port>', 'Unity TCP port');\n\n cmd.action(async (options: CliOptions) => {\n const params = buildParams(options, properties);\n\n // Unescape \\! to ! for execute-dynamic-code\n // Some shells (e.g., Claude Code's bash wrapper) escape ! as \\!\n if (tool.name === 'execute-dynamic-code' && params['Code']) {\n const code = params['Code'] as string;\n params['Code'] = code.replace(/\\\\!/g, '!');\n }\n\n await runWithErrorHandling(() =>\n executeToolCommand(tool.name, params, extractGlobalOptions(options)),\n );\n });\n}\n\n/**\n * Generate commander.js option string from property info.\n */\nfunction generateOptionString(propName: string, propInfo: ToolProperty): string {\n const kebabName = pascalToKebabCase(propName);\n const lowerType = propInfo.type.toLowerCase();\n\n if (lowerType === 'boolean') {\n return `--${kebabName}`;\n }\n\n return `--${kebabName} <value>`;\n}\n\n/**\n * Build option description with enum values if present.\n */\nfunction buildOptionDescription(propInfo: ToolProperty): string {\n let desc = propInfo.description || '';\n if (propInfo.enum && propInfo.enum.length > 0) {\n desc += ` (${propInfo.enum.join(', ')})`;\n }\n return desc;\n}\n\n/**\n * Build parameters from CLI options.\n */\nfunction buildParams(\n options: Record<string, unknown>,\n properties: Record<string, ToolProperty>,\n): Record<string, unknown> {\n const params: Record<string, unknown> = {};\n\n for (const propName of Object.keys(properties)) {\n const camelName = propName.charAt(0).toLowerCase() + propName.slice(1);\n const value = options[camelName];\n\n if (value !== undefined) {\n const propInfo = properties[propName];\n params[propName] = convertValue(value, propInfo);\n }\n }\n\n return params;\n}\n\n/**\n * Convert CLI value to appropriate type based on property info.\n */\nfunction convertValue(value: unknown, propInfo: ToolProperty): unknown {\n const lowerType = propInfo.type.toLowerCase();\n\n if (lowerType === 'array' && typeof value === 'string') {\n return value.split(',').map((s) => s.trim());\n }\n\n if (lowerType === 'integer' && typeof value === 'string') {\n const parsed = parseInt(value, 10);\n if (isNaN(parsed)) {\n throw new Error(`Invalid integer value: ${value}`);\n }\n return parsed;\n }\n\n if (lowerType === 'number' && typeof value === 'string') {\n const parsed = parseFloat(value);\n if (isNaN(parsed)) {\n throw new Error(`Invalid number value: ${value}`);\n }\n return parsed;\n }\n\n return value;\n}\n\nfunction extractGlobalOptions(options: Record<string, unknown>): GlobalOptions {\n return {\n port: options['port'] as string | undefined,\n };\n}\n\nasync function runWithErrorHandling(fn: () => Promise<void>): Promise<void> {\n try {\n await fn();\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n\n if (message === 'UNITY_COMPILING') {\n console.error('\\x1b[33m\u23F3 Unity is compiling scripts.\\x1b[0m');\n console.error('Please wait for compilation to finish and try again.');\n process.exit(1);\n }\n\n if (message === 'UNITY_DOMAIN_RELOAD') {\n console.error('\\x1b[33m\u23F3 Unity is reloading (Domain Reload in progress).\\x1b[0m');\n console.error('Please wait a moment and try again.');\n process.exit(1);\n }\n\n if (message === 'UNITY_SERVER_STARTING') {\n console.error('\\x1b[33m\u23F3 Unity server is starting.\\x1b[0m');\n console.error('Please wait a moment and try again.');\n process.exit(1);\n }\n\n if (message === 'UNITY_NO_RESPONSE') {\n console.error('\\x1b[33m\u23F3 Unity is busy (no response received).\\x1b[0m');\n console.error('Unity may be compiling, reloading, or starting. Please wait and try again.');\n process.exit(1);\n }\n\n if (message.includes('ECONNREFUSED')) {\n console.error('\\x1b[31mError: Cannot connect to Unity.\\x1b[0m');\n console.error('Make sure Unity is running with uLoopMCP installed.');\n process.exit(1);\n }\n\n console.error(`\\x1b[31mError: ${message}\\x1b[0m`);\n process.exit(1);\n }\n}\n\n/**\n * Detect shell type from environment.\n */\nfunction detectShell(): 'bash' | 'zsh' | 'powershell' | null {\n // Check $SHELL first (works for bash/zsh including MINGW64)\n const shell = process.env['SHELL'] || '';\n const shellName = basename(shell).replace(/\\.exe$/i, ''); // Remove .exe for Windows\n if (shellName === 'zsh') {\n return 'zsh';\n }\n if (shellName === 'bash') {\n return 'bash';\n }\n\n // Check for PowerShell (only if $SHELL is not set)\n if (process.env['PSModulePath']) {\n return 'powershell';\n }\n\n return null;\n}\n\n/**\n * Get shell config file path.\n */\nfunction getShellConfigPath(shell: 'bash' | 'zsh' | 'powershell'): string {\n const home = homedir();\n if (shell === 'zsh') {\n return join(home, '.zshrc');\n }\n if (shell === 'powershell') {\n // PowerShell profile path\n return join(home, 'Documents', 'WindowsPowerShell', 'Microsoft.PowerShell_profile.ps1');\n }\n return join(home, '.bashrc');\n}\n\n/**\n * Get completion script for a shell.\n */\nfunction getCompletionScript(shell: 'bash' | 'zsh' | 'powershell'): string {\n if (shell === 'bash') {\n return `# uloop bash completion\n_uloop_completions() {\n local cur=\"\\${COMP_WORDS[COMP_CWORD]}\"\n local cmd=\"\\${COMP_WORDS[1]}\"\n\n if [[ \\${COMP_CWORD} -eq 1 ]]; then\n COMPREPLY=($(compgen -W \"$(uloop --list-commands 2>/dev/null)\" -- \"\\${cur}\"))\n elif [[ \\${COMP_CWORD} -ge 2 ]]; then\n COMPREPLY=($(compgen -W \"$(uloop --list-options \\${cmd} 2>/dev/null)\" -- \"\\${cur}\"))\n fi\n}\ncomplete -F _uloop_completions uloop`;\n }\n\n if (shell === 'powershell') {\n return `# uloop PowerShell completion\nRegister-ArgumentCompleter -Native -CommandName uloop -ScriptBlock {\n param($wordToComplete, $commandAst, $cursorPosition)\n $commands = $commandAst.CommandElements\n if ($commands.Count -eq 1) {\n uloop --list-commands 2>$null | Where-Object { $_ -like \"$wordToComplete*\" } | ForEach-Object {\n [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)\n }\n } elseif ($commands.Count -ge 2) {\n $cmd = $commands[1].ToString()\n uloop --list-options $cmd 2>$null | Where-Object { $_ -like \"$wordToComplete*\" } | ForEach-Object {\n [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)\n }\n }\n}`;\n }\n\n /* eslint-disable no-useless-escape */\n return `# uloop zsh completion\n_uloop() {\n local -a commands\n local -a options\n local -a used_options\n\n if (( CURRENT == 2 )); then\n commands=(\\${(f)\"$(uloop --list-commands 2>/dev/null)\"})\n _describe 'command' commands\n elif (( CURRENT >= 3 )); then\n options=(\\${(f)\"$(uloop --list-options \\${words[2]} 2>/dev/null)\"})\n used_options=(\\${words:2})\n for opt in \\${used_options}; do\n options=(\\${options:#\\$opt})\n done\n _describe 'option' options\n fi\n}\ncompdef _uloop uloop`;\n /* eslint-enable no-useless-escape */\n}\n\n/**\n * Update uloop CLI to the latest version using npm.\n */\nfunction updateCli(): void {\n console.log('Updating uloop-cli to the latest version...');\n\n const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';\n const child = spawn(npmCommand, ['install', '-g', 'uloop-cli@latest'], {\n stdio: 'inherit',\n shell: true,\n });\n\n child.on('close', (code) => {\n if (code === 0) {\n console.log('\\n\u2705 uloop-cli has been updated successfully!');\n console.log('Run \"uloop --version\" to check the new version.');\n } else {\n console.error(`\\n\u274C Update failed with exit code ${code}`);\n process.exit(1);\n }\n });\n\n child.on('error', (err) => {\n console.error(`\u274C Failed to run npm: ${err.message}`);\n process.exit(1);\n });\n}\n\nconst LOCK_FILES = ['compiling.lock', 'domainreload.lock', 'serverstarting.lock'] as const;\n\n/**\n * Clean up stale lock files that may prevent CLI from connecting to Unity.\n */\nfunction cleanupLockFiles(): void {\n const projectRoot = findUnityProjectRoot();\n if (projectRoot === null) {\n console.error('Could not find Unity project root.');\n process.exit(1);\n }\n\n const tempDir = join(projectRoot, 'Temp');\n let cleaned = 0;\n\n for (const lockFile of LOCK_FILES) {\n const lockPath = join(tempDir, lockFile);\n if (existsSync(lockPath)) {\n unlinkSync(lockPath);\n console.log(`Removed: ${lockFile}`);\n cleaned++;\n }\n }\n\n if (cleaned === 0) {\n console.log('No lock files found.');\n } else {\n console.log(`\\n\u2705 Cleaned up ${cleaned} lock file(s).`);\n }\n}\n\n/**\n * Handle completion command.\n */\nfunction handleCompletion(install: boolean, shellOverride?: string): void {\n let shell: 'bash' | 'zsh' | 'powershell' | null;\n\n if (shellOverride) {\n const normalized = shellOverride.toLowerCase();\n if (normalized === 'bash' || normalized === 'zsh' || normalized === 'powershell') {\n shell = normalized;\n } else {\n console.error(`Unknown shell: ${shellOverride}. Supported: bash, zsh, powershell`);\n process.exit(1);\n }\n } else {\n shell = detectShell();\n }\n\n if (!shell) {\n console.error('Could not detect shell. Use --shell option: bash, zsh, or powershell');\n process.exit(1);\n }\n\n const script = getCompletionScript(shell);\n\n if (!install) {\n console.log(script);\n return;\n }\n\n // Install to shell config file\n const configPath = getShellConfigPath(shell);\n\n // PowerShell profile directory may not exist on fresh installations\n const configDir = dirname(configPath);\n if (!existsSync(configDir)) {\n mkdirSync(configDir, { recursive: true });\n }\n\n // Remove existing uloop completion and add new one\n let content = '';\n if (existsSync(configPath)) {\n content = readFileSync(configPath, 'utf-8');\n // Remove existing uloop completion block using markers\n content = content.replace(\n /\\n?# >>> uloop completion >>>[\\s\\S]*?# <<< uloop completion <<<\\n?/g,\n '',\n );\n }\n\n // Add new completion with markers\n const startMarker = '# >>> uloop completion >>>';\n const endMarker = '# <<< uloop completion <<<';\n\n if (shell === 'powershell') {\n const lineToAdd = `\\n${startMarker}\\n${script}\\n${endMarker}\\n`;\n writeFileSync(configPath, content + lineToAdd, 'utf-8');\n } else {\n // Include --shell option to ensure correct shell detection\n const evalLine = `eval \"$(uloop completion --shell ${shell})\"`;\n const lineToAdd = `\\n${startMarker}\\n${evalLine}\\n${endMarker}\\n`;\n writeFileSync(configPath, content + lineToAdd, 'utf-8');\n }\n\n console.log(`Completion installed to ${configPath}`);\n if (shell === 'powershell') {\n console.log('Restart PowerShell to enable completion.');\n } else {\n console.log(`Run 'source ${configPath}' or restart your shell to enable completion.`);\n }\n}\n\n/**\n * Handle --list-commands and --list-options before parsing.\n */\nfunction handleCompletionOptions(): boolean {\n const args = process.argv.slice(2);\n\n if (args.includes('--list-commands')) {\n const tools = loadToolsCache();\n const allCommands = [...BUILTIN_COMMANDS, ...tools.tools.map((t) => t.name)];\n console.log(allCommands.join('\\n'));\n return true;\n }\n\n const listOptionsIdx = args.indexOf('--list-options');\n if (listOptionsIdx !== -1 && args[listOptionsIdx + 1]) {\n const cmdName = args[listOptionsIdx + 1];\n listOptionsForCommand(cmdName);\n return true;\n }\n\n return false;\n}\n\n/**\n * List options for a specific command.\n */\nfunction listOptionsForCommand(cmdName: string): void {\n // Built-in commands have no tool-specific options\n if (BUILTIN_COMMANDS.includes(cmdName as (typeof BUILTIN_COMMANDS)[number])) {\n return;\n }\n\n // Tool commands - only output tool-specific options\n const tools = loadToolsCache();\n const tool = tools.tools.find((t) => t.name === cmdName);\n if (!tool) {\n return;\n }\n\n const options: string[] = [];\n for (const propName of Object.keys(tool.inputSchema.properties)) {\n const kebabName = pascalToKebabCase(propName);\n options.push(`--${kebabName}`);\n }\n\n console.log(options.join('\\n'));\n}\n\n// Handle completion options first (before commander parsing)\nif (!handleCompletionOptions()) {\n program.parse();\n}\n", "import commander from './index.js';\n\n// wrapper to provide named exports for ESM.\nexport const {\n program,\n createCommand,\n createArgument,\n createOption,\n CommanderError,\n InvalidArgumentError,\n InvalidOptionArgumentError, // deprecated old name\n Command,\n Argument,\n Option,\n Help,\n} = commander;\n", "/**\n * Tool execution logic for CLI.\n * Handles dynamic tool execution by connecting to Unity and sending requests.\n */\n\n// CLI tools output to console by design, object keys come from Unity tool responses which are trusted,\n// and lock file paths are constructed from trusted project root detection\n/* eslint-disable no-console, security/detect-object-injection, security/detect-non-literal-fs-filename */\n\nimport * as readline from 'readline';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport { DirectUnityClient } from './direct-unity-client.js';\nimport { resolveUnityPort } from './port-resolver.js';\nimport { saveToolsCache, getCacheFilePath, ToolsCache, ToolDefinition } from './tool-cache.js';\nimport { VERSION } from './version.js';\nimport { createSpinner } from './spinner.js';\nimport { findUnityProjectRoot } from './project-root.js';\n\n/**\n * Suppress stdin echo during async operation to prevent escape sequences from being displayed.\n * Returns a cleanup function to restore stdin state.\n */\nfunction suppressStdinEcho(): () => void {\n if (!process.stdin.isTTY) {\n return () => {};\n }\n\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false,\n });\n\n process.stdin.setRawMode(true);\n process.stdin.resume();\n\n const onData = (data: Buffer): void => {\n // Ctrl+C (0x03) should trigger process exit\n if (data[0] === 0x03) {\n process.exit(130);\n }\n };\n process.stdin.on('data', onData);\n\n return () => {\n process.stdin.off('data', onData);\n process.stdin.setRawMode(false);\n process.stdin.pause();\n rl.close();\n };\n}\n\nexport interface GlobalOptions {\n port?: string;\n}\n\nconst RETRY_DELAY_MS = 500;\nconst MAX_RETRIES = 3;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction isRetryableError(error: unknown): boolean {\n if (!(error instanceof Error)) {\n return false;\n }\n const message = error.message;\n return message.includes('ECONNREFUSED') || message === 'UNITY_NO_RESPONSE';\n}\n\n/**\n * Check if Unity is in a busy state (compiling, reloading, or server starting).\n * Throws an error with appropriate message if busy.\n */\nfunction checkUnityBusyState(): void {\n const projectRoot = findUnityProjectRoot();\n if (projectRoot === null) {\n return;\n }\n\n const compilingLock = join(projectRoot, 'Temp', 'compiling.lock');\n if (existsSync(compilingLock)) {\n throw new Error('UNITY_COMPILING');\n }\n\n const domainReloadLock = join(projectRoot, 'Temp', 'domainreload.lock');\n if (existsSync(domainReloadLock)) {\n throw new Error('UNITY_DOMAIN_RELOAD');\n }\n\n const serverStartingLock = join(projectRoot, 'Temp', 'serverstarting.lock');\n if (existsSync(serverStartingLock)) {\n throw new Error('UNITY_SERVER_STARTING');\n }\n}\n\nexport async function executeToolCommand(\n toolName: string,\n params: Record<string, unknown>,\n globalOptions: GlobalOptions,\n): Promise<void> {\n let portNumber: number | undefined;\n if (globalOptions.port) {\n const parsed = parseInt(globalOptions.port, 10);\n if (isNaN(parsed)) {\n throw new Error(`Invalid port number: ${globalOptions.port}`);\n }\n portNumber = parsed;\n }\n const port = await resolveUnityPort(portNumber);\n\n const restoreStdin = suppressStdinEcho();\n const spinner = createSpinner('Connecting to Unity...');\n\n let lastError: unknown;\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n checkUnityBusyState();\n\n const client = new DirectUnityClient(port);\n try {\n await client.connect();\n\n spinner.update(`Executing ${toolName}...`);\n const result = await client.sendRequest(toolName, params);\n\n if (result === undefined || result === null) {\n throw new Error('UNITY_NO_RESPONSE');\n }\n\n // Success - stop spinner and output result\n spinner.stop();\n restoreStdin();\n console.log(JSON.stringify(result, null, 2));\n return;\n } catch (error) {\n lastError = error;\n client.disconnect();\n\n if (!isRetryableError(error) || attempt >= MAX_RETRIES) {\n break;\n }\n spinner.update('Retrying connection...');\n await sleep(RETRY_DELAY_MS);\n } finally {\n client.disconnect();\n }\n }\n\n spinner.stop();\n restoreStdin();\n throw lastError;\n}\n\nexport async function listAvailableTools(globalOptions: GlobalOptions): Promise<void> {\n let portNumber: number | undefined;\n if (globalOptions.port) {\n const parsed = parseInt(globalOptions.port, 10);\n if (isNaN(parsed)) {\n throw new Error(`Invalid port number: ${globalOptions.port}`);\n }\n portNumber = parsed;\n }\n const port = await resolveUnityPort(portNumber);\n\n const restoreStdin = suppressStdinEcho();\n const spinner = createSpinner('Connecting to Unity...');\n\n let lastError: unknown;\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n checkUnityBusyState();\n\n const client = new DirectUnityClient(port);\n try {\n await client.connect();\n\n spinner.update('Fetching tool list...');\n const result = await client.sendRequest<{\n Tools: Array<{ name: string; description: string }>;\n }>('get-tool-details', { IncludeDevelopmentOnly: false });\n\n if (!result.Tools || !Array.isArray(result.Tools)) {\n throw new Error('Unexpected response from Unity: missing Tools array');\n }\n\n // Success - stop spinner and output result\n spinner.stop();\n restoreStdin();\n for (const tool of result.Tools) {\n console.log(` - ${tool.name}`);\n }\n return;\n } catch (error) {\n lastError = error;\n client.disconnect();\n\n if (!isRetryableError(error) || attempt >= MAX_RETRIES) {\n break;\n }\n spinner.update('Retrying connection...');\n await sleep(RETRY_DELAY_MS);\n } finally {\n client.disconnect();\n }\n }\n\n spinner.stop();\n restoreStdin();\n throw lastError;\n}\n\ninterface UnityToolInfo {\n name: string;\n description: string;\n parameterSchema: {\n Properties: Record<string, UnityPropertyInfo>;\n Required?: string[];\n };\n}\n\ninterface UnityPropertyInfo {\n Type: string;\n Description?: string;\n DefaultValue?: unknown;\n Enum?: string[] | null;\n}\n\nfunction convertProperties(\n unityProps: Record<string, UnityPropertyInfo>,\n): Record<string, ToolDefinition['inputSchema']['properties'][string]> {\n const result: Record<string, ToolDefinition['inputSchema']['properties'][string]> = {};\n for (const [key, prop] of Object.entries(unityProps)) {\n result[key] = {\n type: prop.Type?.toLowerCase() ?? 'string',\n description: prop.Description,\n default: prop.DefaultValue,\n enum: prop.Enum ?? undefined,\n };\n }\n return result;\n}\n\nexport async function syncTools(globalOptions: GlobalOptions): Promise<void> {\n let portNumber: number | undefined;\n if (globalOptions.port) {\n const parsed = parseInt(globalOptions.port, 10);\n if (isNaN(parsed)) {\n throw new Error(`Invalid port number: ${globalOptions.port}`);\n }\n portNumber = parsed;\n }\n const port = await resolveUnityPort(portNumber);\n\n const restoreStdin = suppressStdinEcho();\n const spinner = createSpinner('Connecting to Unity...');\n\n let lastError: unknown;\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n checkUnityBusyState();\n\n const client = new DirectUnityClient(port);\n try {\n await client.connect();\n\n spinner.update('Syncing tools...');\n const result = await client.sendRequest<{\n Tools: UnityToolInfo[];\n }>('get-tool-details', { IncludeDevelopmentOnly: false });\n\n spinner.stop();\n if (!result.Tools || !Array.isArray(result.Tools)) {\n restoreStdin();\n throw new Error('Unexpected response from Unity: missing Tools array');\n }\n\n const cache: ToolsCache = {\n version: VERSION,\n updatedAt: new Date().toISOString(),\n tools: result.Tools.map((tool) => ({\n name: tool.name,\n description: tool.description,\n inputSchema: {\n type: 'object',\n properties: convertProperties(tool.parameterSchema.Properties),\n required: tool.parameterSchema.Required,\n },\n })),\n };\n\n saveToolsCache(cache);\n\n console.log(`Synced ${cache.tools.length} tools to ${getCacheFilePath()}`);\n console.log('\\nTools:');\n for (const tool of cache.tools) {\n console.log(` - ${tool.name}`);\n }\n restoreStdin();\n return;\n } catch (error) {\n lastError = error;\n client.disconnect();\n\n if (!isRetryableError(error) || attempt >= MAX_RETRIES) {\n break;\n }\n spinner.update('Retrying connection...');\n await sleep(RETRY_DELAY_MS);\n } finally {\n client.disconnect();\n }\n }\n\n spinner.stop();\n restoreStdin();\n throw lastError;\n}\n", "/**\n * Direct Unity TCP client for CLI usage.\n * Establishes one-shot TCP connections to Unity without going through MCP server.\n */\n\n// Non-null assertions are used after TCP frame parsing where data existence is guaranteed by protocol\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\nimport * as net from 'net';\nimport { createFrame, parseFrameFromBuffer, extractFrameFromBuffer } from './simple-framer.js';\n\nconst JSONRPC_VERSION = '2.0';\nconst DEFAULT_HOST = '127.0.0.1';\nconst NETWORK_TIMEOUT_MS = 180000;\n\nexport interface JsonRpcRequest {\n jsonrpc: string;\n method: string;\n params?: Record<string, unknown>;\n id: number;\n}\n\nexport interface JsonRpcResponse {\n jsonrpc: string;\n result?: unknown;\n error?: {\n code: number;\n message: string;\n data?: unknown;\n };\n id: number;\n}\n\nexport class DirectUnityClient {\n private socket: net.Socket | null = null;\n private requestId: number = 0;\n private receiveBuffer: Buffer = Buffer.alloc(0);\n\n constructor(\n private readonly port: number,\n private readonly host: string = DEFAULT_HOST,\n ) {}\n\n async connect(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.socket = new net.Socket();\n\n this.socket.on('error', (error: Error) => {\n reject(new Error(`Connection error: ${error.message}`));\n });\n\n this.socket.connect(this.port, this.host, () => {\n resolve();\n });\n });\n }\n\n async sendRequest<T>(method: string, params?: Record<string, unknown>): Promise<T> {\n if (!this.socket) {\n throw new Error('Not connected to Unity');\n }\n\n const request: JsonRpcRequest = {\n jsonrpc: JSONRPC_VERSION,\n method,\n params: params ?? {},\n id: ++this.requestId,\n };\n\n const requestJson = JSON.stringify(request);\n const framedMessage = createFrame(requestJson);\n\n return new Promise((resolve, reject) => {\n const socket = this.socket!;\n const timeoutId = setTimeout(() => {\n reject(new Error(`Request timed out after ${NETWORK_TIMEOUT_MS}ms`));\n }, NETWORK_TIMEOUT_MS);\n\n const onData = (chunk: Buffer): void => {\n this.receiveBuffer = Buffer.concat([this.receiveBuffer, chunk]);\n\n const parseResult = parseFrameFromBuffer(this.receiveBuffer);\n if (!parseResult.isComplete) {\n return;\n }\n\n const extractResult = extractFrameFromBuffer(\n this.receiveBuffer,\n parseResult.contentLength,\n parseResult.headerLength,\n );\n\n if (extractResult.jsonContent === null) {\n return;\n }\n\n clearTimeout(timeoutId);\n socket.off('data', onData);\n\n this.receiveBuffer = extractResult.remainingData;\n\n const response = JSON.parse(extractResult.jsonContent) as JsonRpcResponse;\n\n if (response.error) {\n reject(new Error(`Unity error: ${response.error.message}`));\n return;\n }\n\n resolve(response.result as T);\n };\n\n socket.on('data', onData);\n socket.write(framedMessage);\n });\n }\n\n disconnect(): void {\n if (this.socket) {\n this.socket.destroy();\n this.socket = null;\n }\n this.receiveBuffer = Buffer.alloc(0);\n }\n\n isConnected(): boolean {\n return this.socket !== null && !this.socket.destroyed;\n }\n}\n", "/**\n * Simple Content-Length framer for CLI usage.\n * Minimal implementation without external dependencies.\n */\n\nconst CONTENT_LENGTH_HEADER = 'Content-Length:';\nconst HEADER_SEPARATOR = '\\r\\n\\r\\n';\n\nexport function createFrame(jsonContent: string): string {\n const contentLength = Buffer.byteLength(jsonContent, 'utf8');\n return `${CONTENT_LENGTH_HEADER} ${contentLength}${HEADER_SEPARATOR}${jsonContent}`;\n}\n\nexport interface FrameParseResult {\n contentLength: number;\n headerLength: number;\n isComplete: boolean;\n}\n\nexport function parseFrameFromBuffer(data: Buffer): FrameParseResult {\n if (!data || data.length === 0) {\n return { contentLength: -1, headerLength: -1, isComplete: false };\n }\n\n const separatorBuffer = Buffer.from(HEADER_SEPARATOR, 'utf8');\n const separatorIndex = data.indexOf(separatorBuffer);\n\n if (separatorIndex === -1) {\n return { contentLength: -1, headerLength: -1, isComplete: false };\n }\n\n const headerSection = data.subarray(0, separatorIndex).toString('utf8');\n const headerLength = separatorIndex + separatorBuffer.length;\n\n const contentLength = parseContentLength(headerSection);\n if (contentLength === -1) {\n return { contentLength: -1, headerLength: -1, isComplete: false };\n }\n\n const expectedTotalLength = headerLength + contentLength;\n const isComplete = data.length >= expectedTotalLength;\n\n return { contentLength, headerLength, isComplete };\n}\n\nexport interface FrameExtractionResult {\n jsonContent: string | null;\n remainingData: Buffer;\n}\n\nexport function extractFrameFromBuffer(\n data: Buffer,\n contentLength: number,\n headerLength: number,\n): FrameExtractionResult {\n if (!data || data.length === 0 || contentLength < 0 || headerLength < 0) {\n return { jsonContent: null, remainingData: data || Buffer.alloc(0) };\n }\n\n const expectedTotalLength = headerLength + contentLength;\n\n if (data.length < expectedTotalLength) {\n return { jsonContent: null, remainingData: data };\n }\n\n const jsonContent = data.subarray(headerLength, headerLength + contentLength).toString('utf8');\n const remainingData = data.subarray(expectedTotalLength);\n\n return { jsonContent, remainingData };\n}\n\nfunction parseContentLength(headerSection: string): number {\n const lines = headerSection.split(/\\r?\\n/);\n\n for (const line of lines) {\n const trimmedLine = line.trim();\n const lowerLine = trimmedLine.toLowerCase();\n\n if (lowerLine.startsWith('content-length:')) {\n const colonIndex = trimmedLine.indexOf(':');\n if (colonIndex === -1 || colonIndex >= trimmedLine.length - 1) {\n continue;\n }\n\n const valueString = trimmedLine.substring(colonIndex + 1).trim();\n const parsedValue = parseInt(valueString, 10);\n\n if (isNaN(parsedValue) || parsedValue < 0) {\n return -1;\n }\n\n return parsedValue;\n }\n }\n\n return -1;\n}\n", "/**\n * Port resolution utility for CLI.\n * Resolves Unity server port from various sources.\n */\n\n// File paths are constructed from Unity project root detection, not from user input\n/* eslint-disable security/detect-non-literal-fs-filename */\n\nimport { readFile } from 'fs/promises';\nimport { join } from 'path';\nimport { findUnityProjectRoot } from './project-root.js';\n\nconst DEFAULT_PORT = 8700;\n\ninterface UnityMcpSettings {\n serverPort?: number;\n customPort?: number;\n}\n\nexport async function resolveUnityPort(explicitPort?: number): Promise<number> {\n if (explicitPort !== undefined) {\n return explicitPort;\n }\n\n const settingsPort = await readPortFromSettings();\n if (settingsPort !== null) {\n return settingsPort;\n }\n\n return DEFAULT_PORT;\n}\n\nasync function readPortFromSettings(): Promise<number | null> {\n const projectRoot = findUnityProjectRoot();\n if (projectRoot === null) {\n return null;\n }\n const settingsPath = join(projectRoot, 'UserSettings/UnityMcpSettings.json');\n\n let content: string;\n try {\n content = await readFile(settingsPath, 'utf-8');\n } catch {\n return null;\n }\n\n let settings: UnityMcpSettings;\n try {\n settings = JSON.parse(content) as UnityMcpSettings;\n } catch {\n return null;\n }\n\n if (typeof settings.serverPort === 'number') {\n return settings.serverPort;\n }\n\n if (typeof settings.customPort === 'number') {\n return settings.customPort;\n }\n\n return null;\n}\n", "/**\n * Unity project root detection utility.\n * Searches upward from current directory to find Unity project markers.\n */\n\n// Path traversal is intentional for finding Unity project root by walking up directory tree\n/* eslint-disable security/detect-non-literal-fs-filename */\n\nimport { existsSync } from 'fs';\nimport { join, dirname } from 'path';\n\n/**\n * Find Unity project root by searching upward from start path.\n * A Unity project is identified by having both Assets/ and ProjectSettings/ directories.\n * Returns null if not inside a Unity project.\n */\nexport function findUnityProjectRoot(startPath: string = process.cwd()): string | null {\n let currentPath = startPath;\n\n while (true) {\n const hasAssets = existsSync(join(currentPath, 'Assets'));\n const hasProjectSettings = existsSync(join(currentPath, 'ProjectSettings'));\n\n if (hasAssets && hasProjectSettings) {\n return currentPath;\n }\n\n const parentPath = dirname(currentPath);\n if (parentPath === currentPath) {\n return null;\n }\n currentPath = parentPath;\n }\n}\n", "/**\n * Tool cache management for CLI.\n * Handles loading/saving tool definitions from .uloop/tools.json cache.\n */\n\n// File paths are constructed from Unity project root, not from untrusted user input\n/* eslint-disable security/detect-non-literal-fs-filename */\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport defaultToolsData from './default-tools.json';\nimport { findUnityProjectRoot } from './project-root.js';\n\nexport interface ToolProperty {\n type: string;\n description?: string;\n default?: unknown;\n enum?: string[];\n items?: { type: string };\n}\n\nexport interface ToolInputSchema {\n type: string;\n properties: Record<string, ToolProperty>;\n required?: string[];\n}\n\nexport interface ToolDefinition {\n name: string;\n description: string;\n inputSchema: ToolInputSchema;\n}\n\nexport interface ToolsCache {\n version: string;\n updatedAt?: string;\n tools: ToolDefinition[];\n}\n\nconst CACHE_DIR = '.uloop';\nconst CACHE_FILE = 'tools.json';\n\nfunction getCacheDir(): string {\n const projectRoot = findUnityProjectRoot();\n if (projectRoot === null) {\n return join(process.cwd(), CACHE_DIR);\n }\n return join(projectRoot, CACHE_DIR);\n}\n\nfunction getCachePath(): string {\n return join(getCacheDir(), CACHE_FILE);\n}\n\n/**\n * Load default tools bundled with npm package.\n */\nexport function getDefaultTools(): ToolsCache {\n return defaultToolsData as ToolsCache;\n}\n\n/**\n * Load tools from cache file, falling back to default tools if cache doesn't exist.\n */\nexport function loadToolsCache(): ToolsCache {\n const cachePath = getCachePath();\n\n if (existsSync(cachePath)) {\n try {\n const content = readFileSync(cachePath, 'utf-8');\n return JSON.parse(content) as ToolsCache;\n } catch {\n return getDefaultTools();\n }\n }\n\n return getDefaultTools();\n}\n\n/**\n * Save tools to cache file.\n */\nexport function saveToolsCache(cache: ToolsCache): void {\n const cacheDir = getCacheDir();\n const cachePath = getCachePath();\n\n if (!existsSync(cacheDir)) {\n mkdirSync(cacheDir, { recursive: true });\n }\n\n const content = JSON.stringify(cache, null, 2);\n writeFileSync(cachePath, content, 'utf-8');\n}\n\n/**\n * Check if cache file exists.\n */\nexport function hasCacheFile(): boolean {\n return existsSync(getCachePath());\n}\n\n/**\n * Get the cache file path for display purposes.\n */\nexport function getCacheFilePath(): string {\n return getCachePath();\n}\n", "{\n \"version\": \"0.45.0\",\n \"tools\": [\n {\n \"name\": \"compile\",\n \"description\": \"Execute Unity project compilation\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ForceRecompile\": {\n \"type\": \"boolean\",\n \"description\": \"Force full recompilation\"\n }\n }\n }\n },\n {\n \"name\": \"get-logs\",\n \"description\": \"Retrieve logs from Unity Console\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"LogType\": {\n \"type\": \"string\",\n \"description\": \"Log type filter\",\n \"enum\": [\n \"Error\",\n \"Warning\",\n \"Log\",\n \"All\"\n ],\n \"default\": \"All\"\n },\n \"MaxCount\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of logs to retrieve\",\n \"default\": 100\n },\n \"SearchText\": {\n \"type\": \"string\",\n \"description\": \"Text to search within logs\"\n },\n \"IncludeStackTrace\": {\n \"type\": \"boolean\",\n \"description\": \"Include stack trace in output\",\n \"default\": true\n },\n \"UseRegex\": {\n \"type\": \"boolean\",\n \"description\": \"Use regex for search\"\n },\n \"SearchInStackTrace\": {\n \"type\": \"boolean\",\n \"description\": \"Search within stack trace\"\n }\n }\n }\n },\n {\n \"name\": \"run-tests\",\n \"description\": \"Execute Unity Test Runner\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"TestMode\": {\n \"type\": \"string\",\n \"description\": \"Test mode\",\n \"enum\": [\n \"EditMode\",\n \"PlayMode\"\n ],\n \"default\": \"EditMode\"\n },\n \"FilterType\": {\n \"type\": \"string\",\n \"description\": \"Filter type\",\n \"enum\": [\n \"all\",\n \"exact\",\n \"regex\",\n \"assembly\"\n ],\n \"default\": \"all\"\n },\n \"FilterValue\": {\n \"type\": \"string\",\n \"description\": \"Filter value\"\n },\n \"SaveXml\": {\n \"type\": \"boolean\",\n \"description\": \"Save test results as XML\"\n }\n }\n }\n },\n {\n \"name\": \"clear-console\",\n \"description\": \"Clear Unity console logs\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"AddConfirmationMessage\": {\n \"type\": \"boolean\",\n \"description\": \"Add confirmation message after clearing\"\n }\n }\n }\n },\n {\n \"name\": \"focus-window\",\n \"description\": \"Bring Unity Editor window to front\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {}\n }\n },\n {\n \"name\": \"get-hierarchy\",\n \"description\": \"Get Unity Hierarchy structure\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"RootPath\": {\n \"type\": \"string\",\n \"description\": \"Root GameObject path\"\n },\n \"MaxDepth\": {\n \"type\": \"integer\",\n \"description\": \"Maximum depth (-1 for unlimited)\",\n \"default\": -1\n },\n \"IncludeComponents\": {\n \"type\": \"boolean\",\n \"description\": \"Include component information\",\n \"default\": true\n },\n \"IncludeInactive\": {\n \"type\": \"boolean\",\n \"description\": \"Include inactive GameObjects\",\n \"default\": true\n },\n \"IncludePaths\": {\n \"type\": \"boolean\",\n \"description\": \"Include path information\"\n }\n }\n }\n },\n {\n \"name\": \"unity-search\",\n \"description\": \"Search Unity project\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"SearchQuery\": {\n \"type\": \"string\",\n \"description\": \"Search query\"\n },\n \"Providers\": {\n \"type\": \"array\",\n \"description\": \"Search providers\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"MaxResults\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of results\",\n \"default\": 50\n },\n \"SaveToFile\": {\n \"type\": \"boolean\",\n \"description\": \"Save results to file\"\n }\n }\n }\n },\n {\n \"name\": \"get-menu-items\",\n \"description\": \"Retrieve Unity MenuItems\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"FilterText\": {\n \"type\": \"string\",\n \"description\": \"Filter text\"\n },\n \"FilterType\": {\n \"type\": \"string\",\n \"description\": \"Filter type\",\n \"enum\": [\n \"contains\",\n \"exact\",\n \"startswith\"\n ],\n \"default\": \"contains\"\n },\n \"MaxCount\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of items\",\n \"default\": 200\n },\n \"IncludeValidation\": {\n \"type\": \"boolean\",\n \"description\": \"Include validation functions\"\n }\n }\n }\n },\n {\n \"name\": \"execute-menu-item\",\n \"description\": \"Execute Unity MenuItem\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"MenuItemPath\": {\n \"type\": \"string\",\n \"description\": \"Menu item path (e.g., \\\"GameObject/Create Empty\\\")\"\n },\n \"UseReflectionFallback\": {\n \"type\": \"boolean\",\n \"description\": \"Use reflection fallback\",\n \"default\": true\n }\n }\n }\n },\n {\n \"name\": \"find-game-objects\",\n \"description\": \"Find GameObjects with search criteria\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"NamePattern\": {\n \"type\": \"string\",\n \"description\": \"Name pattern to search\"\n },\n \"SearchMode\": {\n \"type\": \"string\",\n \"description\": \"Search mode\",\n \"enum\": [\n \"Exact\",\n \"Path\",\n \"Regex\",\n \"Contains\"\n ],\n \"default\": \"Contains\"\n },\n \"RequiredComponents\": {\n \"type\": \"array\",\n \"description\": \"Required components\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"Tag\": {\n \"type\": \"string\",\n \"description\": \"Tag filter\"\n },\n \"Layer\": {\n \"type\": \"string\",\n \"description\": \"Layer filter\"\n },\n \"MaxResults\": {\n \"type\": \"integer\",\n \"description\": \"Maximum number of results\",\n \"default\": 20\n },\n \"IncludeInactive\": {\n \"type\": \"boolean\",\n \"description\": \"Include inactive GameObjects\"\n }\n }\n }\n },\n {\n \"name\": \"capture-gameview\",\n \"description\": \"Capture Unity Game View as PNG\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ResolutionScale\": {\n \"type\": \"number\",\n \"description\": \"Resolution scale (0.1 to 1.0)\",\n \"default\": 1\n }\n }\n }\n },\n {\n \"name\": \"execute-dynamic-code\",\n \"description\": \"Execute C# code in Unity Editor\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"Code\": {\n \"type\": \"string\",\n \"description\": \"C# code to execute\"\n },\n \"CompileOnly\": {\n \"type\": \"boolean\",\n \"description\": \"Compile only without execution\"\n },\n \"AutoQualifyUnityTypesOnce\": {\n \"type\": \"boolean\",\n \"description\": \"Auto-qualify Unity types\"\n }\n }\n }\n },\n {\n \"name\": \"get-provider-details\",\n \"description\": \"Get Unity Search provider details\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ProviderId\": {\n \"type\": \"string\",\n \"description\": \"Specific provider ID\"\n },\n \"ActiveOnly\": {\n \"type\": \"boolean\",\n \"description\": \"Only active providers\"\n },\n \"IncludeDescriptions\": {\n \"type\": \"boolean\",\n \"description\": \"Include descriptions\",\n \"default\": true\n },\n \"SortByPriority\": {\n \"type\": \"boolean\",\n \"description\": \"Sort by priority\",\n \"default\": true\n }\n }\n }\n },\n {\n \"name\": \"get-project-info\",\n \"description\": \"Get Unity project information\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {}\n }\n },\n {\n \"name\": \"get-version\",\n \"description\": \"Get uLoopMCP version information\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {}\n }\n }\n ]\n}\n", "/**\n * CLI version\n *\n * This file exists to avoid bundling the entire package.json into the CLI bundle.\n * This version is automatically updated by release-please.\n */\nexport const VERSION = '0.45.0'; // x-release-please-version\n", "/**\n * Terminal spinner for showing loading state during async operations.\n */\n\n// Array index access is safe here (modulo operation keeps it in bounds)\n/* eslint-disable security/detect-object-injection */\n\nconst SPINNER_FRAMES = ['\u280B', '\u2819', '\u2839', '\u2838', '\u283C', '\u2834', '\u2826', '\u2827', '\u2807', '\u280F'] as const;\nconst FRAME_INTERVAL_MS = 80;\n\nexport interface Spinner {\n update(message: string): void;\n stop(): void;\n}\n\n/**\n * Create a terminal spinner that displays a rotating animation with a message.\n * Returns a Spinner object with update() and stop() methods.\n */\nexport function createSpinner(initialMessage: string): Spinner {\n if (!process.stderr.isTTY) {\n return {\n update: (): void => {},\n stop: (): void => {},\n };\n }\n\n let frameIndex = 0;\n let currentMessage = initialMessage;\n\n const render = (): void => {\n const frame = SPINNER_FRAMES[frameIndex];\n process.stderr.write(`\\r\\x1b[K${frame} ${currentMessage}`);\n frameIndex = (frameIndex + 1) % SPINNER_FRAMES.length;\n };\n\n render();\n const intervalId = setInterval(render, FRAME_INTERVAL_MS);\n\n return {\n update(message: string): void {\n currentMessage = message;\n },\n stop(): void {\n clearInterval(intervalId);\n process.stderr.write('\\r\\x1b[K');\n },\n };\n}\n", "/**\n * CLI argument parser for tool parameters.\n * Converts CLI options to Unity tool parameters.\n */\n\n// Object keys come from tool schema definitions which are internal trusted data\n/* eslint-disable security/detect-object-injection */\n\nexport interface ToolParameter {\n Type: string;\n Description: string;\n DefaultValue?: unknown;\n Enum?: string[];\n}\n\nexport interface ToolSchema {\n properties: Record<string, ToolParameter>;\n}\n\n/**\n * Converts kebab-case CLI option name to PascalCase parameter name.\n * e.g., \"force-recompile\" -> \"ForceRecompile\"\n */\nexport function kebabToPascalCase(kebab: string): string {\n return kebab\n .split('-')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n}\n\n/**\n * Converts PascalCase parameter name to kebab-case CLI option name.\n * e.g., \"ForceRecompile\" -> \"force-recompile\"\n */\nexport function pascalToKebabCase(pascal: string): string {\n const kebab = pascal.replace(/([A-Z])/g, '-$1').toLowerCase();\n return kebab.startsWith('-') ? kebab.slice(1) : kebab;\n}\n\n/**\n * Parses CLI arguments into tool parameters based on the tool schema.\n */\nexport function parseToolArgs(\n args: string[],\n schema: ToolSchema,\n cliOptions: Record<string, unknown>,\n): Record<string, unknown> {\n const params: Record<string, unknown> = {};\n\n for (const [paramName, paramInfo] of Object.entries(schema.properties)) {\n const kebabName = pascalToKebabCase(paramName);\n const cliValue = cliOptions[kebabName];\n\n if (cliValue === undefined) {\n if (paramInfo.DefaultValue !== undefined) {\n params[paramName] = paramInfo.DefaultValue;\n }\n continue;\n }\n\n params[paramName] = convertValue(cliValue, paramInfo.Type);\n }\n\n return params;\n}\n\nfunction convertValue(value: unknown, type: string): unknown {\n if (value === undefined || value === null) {\n return value;\n }\n\n const lowerType = type.toLowerCase();\n\n switch (lowerType) {\n case 'boolean':\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'string') {\n return value.toLowerCase() === 'true';\n }\n return Boolean(value);\n\n case 'number':\n case 'integer':\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = parseFloat(value);\n return isNaN(parsed) ? 0 : parsed;\n }\n return Number(value);\n\n case 'string':\n if (typeof value === 'string') {\n return value;\n }\n if (typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n return JSON.stringify(value);\n\n case 'array':\n if (Array.isArray(value)) {\n return value;\n }\n if (typeof value === 'string') {\n return value.split(',').map((s) => s.trim());\n }\n return [value];\n\n default:\n return value;\n }\n}\n\n/**\n * Generates commander.js option string from parameter info.\n * e.g., \"--force-recompile\" for boolean, \"--max-count <value>\" for others\n */\nexport function generateOptionString(paramName: string, paramInfo: ToolParameter): string {\n const kebabName = pascalToKebabCase(paramName);\n const lowerType = paramInfo.Type.toLowerCase();\n\n if (lowerType === 'boolean') {\n return `--${kebabName}`;\n }\n\n return `--${kebabName} <value>`;\n}\n", "/**\n * Skills manager for installing/uninstalling/listing uloop skills.\n */\n\n// File paths are constructed from home directory and skill names, not from untrusted user input\n/* eslint-disable security/detect-non-literal-fs-filename */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync, rmSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\nimport { BUNDLED_SKILLS, BundledSkill } from './bundled-skills.js';\n\nexport type SkillStatus = 'installed' | 'not_installed' | 'outdated';\n\nexport interface SkillInfo {\n name: string;\n status: SkillStatus;\n path?: string;\n}\n\nfunction getGlobalSkillsDir(): string {\n return join(homedir(), '.claude', 'skills');\n}\n\nfunction getProjectSkillsDir(): string {\n return join(process.cwd(), '.claude', 'skills');\n}\n\nfunction getSkillPath(skillDirName: string, global: boolean): string {\n const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();\n return join(baseDir, skillDirName, 'SKILL.md');\n}\n\nfunction isSkillInstalled(skill: BundledSkill, global: boolean): boolean {\n const skillPath = getSkillPath(skill.dirName, global);\n return existsSync(skillPath);\n}\n\nfunction isSkillOutdated(skill: BundledSkill, global: boolean): boolean {\n const skillPath = getSkillPath(skill.dirName, global);\n if (!existsSync(skillPath)) {\n return false;\n }\n const installedContent = readFileSync(skillPath, 'utf-8');\n return installedContent !== skill.content;\n}\n\nexport function getSkillStatus(skill: BundledSkill, global: boolean): SkillStatus {\n if (!isSkillInstalled(skill, global)) {\n return 'not_installed';\n }\n if (isSkillOutdated(skill, global)) {\n return 'outdated';\n }\n return 'installed';\n}\n\nexport function getAllSkillStatuses(global: boolean): SkillInfo[] {\n return BUNDLED_SKILLS.map((skill) => ({\n name: skill.name,\n status: getSkillStatus(skill, global),\n path: isSkillInstalled(skill, global) ? getSkillPath(skill.dirName, global) : undefined,\n }));\n}\n\nexport function installSkill(skill: BundledSkill, global: boolean): void {\n const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();\n const skillDir = join(baseDir, skill.dirName);\n const skillPath = join(skillDir, 'SKILL.md');\n\n mkdirSync(skillDir, { recursive: true });\n writeFileSync(skillPath, skill.content, 'utf-8');\n}\n\nexport function uninstallSkill(skill: BundledSkill, global: boolean): boolean {\n const baseDir = global ? getGlobalSkillsDir() : getProjectSkillsDir();\n const skillDir = join(baseDir, skill.dirName);\n\n if (!existsSync(skillDir)) {\n return false;\n }\n\n rmSync(skillDir, { recursive: true, force: true });\n return true;\n}\n\nexport interface InstallResult {\n installed: number;\n updated: number;\n skipped: number;\n}\n\nexport function installAllSkills(global: boolean): InstallResult {\n const result: InstallResult = { installed: 0, updated: 0, skipped: 0 };\n\n for (const skill of BUNDLED_SKILLS) {\n const status = getSkillStatus(skill, global);\n\n if (status === 'not_installed') {\n installSkill(skill, global);\n result.installed++;\n } else if (status === 'outdated') {\n installSkill(skill, global);\n result.updated++;\n } else {\n result.skipped++;\n }\n }\n\n return result;\n}\n\nexport interface UninstallResult {\n removed: number;\n notFound: number;\n}\n\nexport function uninstallAllSkills(global: boolean): UninstallResult {\n const result: UninstallResult = { removed: 0, notFound: 0 };\n\n for (const skill of BUNDLED_SKILLS) {\n if (uninstallSkill(skill, global)) {\n result.removed++;\n } else {\n result.notFound++;\n }\n }\n\n return result;\n}\n\nexport function getInstallDir(global: boolean): string {\n return global ? getGlobalSkillsDir() : getProjectSkillsDir();\n}\n\nexport function getTotalSkillCount(): number {\n return BUNDLED_SKILLS.length;\n}\n", "---\nname: uloop-compile\ndescription: Compile Unity project via uloop CLI. Use when you need to: (1) Verify C# code compiles successfully after editing scripts, (2) Check for compile errors or warnings, (3) Validate script changes before running tests.\n---\n\n# uloop compile\n\nExecute Unity project compilation.\n\n## Usage\n\n```bash\nuloop compile [--force-recompile]\n```\n\n## Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `--force-recompile` | boolean | Force full recompilation (triggers Domain Reload) |\n\n## Examples\n\n```bash\n# Check compilation\nuloop compile\n\n# Force full recompilation\nuloop compile --force-recompile\n```\n\n## Output\n\nReturns JSON:\n- `Success`: boolean\n- `ErrorCount`: number\n- `WarningCount`: number\n\n## Troubleshooting\n\nIf CLI hangs or shows \"Unity is busy\" errors after compilation, stale lock files may be preventing connection. Run the following to clean them up:\n\n```bash\nuloop fix\n```\n\nThis removes any leftover lock files (`compiling.lock`, `domainreload.lock`, `serverstarting.lock`) from the Unity project's Temp directory.\n", "---\nname: uloop-get-logs\ndescription: Retrieve Unity Console logs via uloop CLI. Use when you need to: (1) Check for errors or warnings after operations, (2) Debug runtime issues in Unity Editor, (3) Investigate unexpected behavior or exceptions.\n---\n\n# uloop get-logs\n\nRetrieve logs from Unity Console.\n\n## Usage\n\n```bash\nuloop get-logs [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--log-type` | string | `All` | Log type filter: `Error`, `Warning`, `Log`, `All` |\n| `--max-count` | integer | `100` | Maximum number of logs to retrieve |\n| `--search-text` | string | - | Text to search within logs |\n| `--include-stack-trace` | boolean | `true` | Include stack trace in output |\n| `--use-regex` | boolean | `false` | Use regex for search |\n| `--search-in-stack-trace` | boolean | `false` | Search within stack trace |\n\n## Examples\n\n```bash\n# Get all logs\nuloop get-logs\n\n# Get only errors\nuloop get-logs --log-type Error\n\n# Search for specific text\nuloop get-logs --search-text \"NullReference\"\n\n# Regex search\nuloop get-logs --search-text \"Missing.*Component\" --use-regex\n```\n\n## Output\n\nReturns JSON array of log entries with message, type, and optional stack trace.\n", "---\nname: uloop-run-tests\ndescription: Execute Unity Test Runner via uloop CLI. Use when you need to: (1) Run unit tests (EditMode tests), (2) Run integration tests (PlayMode tests), (3) Verify code changes don't break existing functionality.\n---\n\n# uloop run-tests\n\nExecute Unity Test Runner.\n\n## Usage\n\n```bash\nuloop run-tests [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--test-mode` | string | `EditMode` | Test mode: `EditMode`, `PlayMode` |\n| `--filter-type` | string | `all` | Filter type: `all`, `exact`, `regex`, `assembly` |\n| `--filter-value` | string | - | Filter value (test name, pattern, or assembly) |\n| `--save-xml` | boolean | `false` | Save test results as XML |\n\n## Examples\n\n```bash\n# Run all EditMode tests\nuloop run-tests\n\n# Run PlayMode tests\nuloop run-tests --test-mode PlayMode\n\n# Run specific test\nuloop run-tests --filter-type exact --filter-value \"MyTest.TestMethod\"\n\n# Run tests matching pattern\nuloop run-tests --filter-type regex --filter-value \".*Integration.*\"\n```\n\n## Output\n\nReturns JSON with test results including pass/fail counts and details.\n", "---\nname: uloop-clear-console\ndescription: Clear Unity console logs via uloop CLI. Use when you need to: (1) Clear the console before running tests, (2) Start a fresh debugging session, (3) Clean up log output for better readability.\n---\n\n# uloop clear-console\n\nClear Unity console logs.\n\n## Usage\n\n```bash\nuloop clear-console [--add-confirmation-message]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--add-confirmation-message` | boolean | `false` | Add confirmation message after clearing |\n\n## Examples\n\n```bash\n# Clear console\nuloop clear-console\n\n# Clear with confirmation\nuloop clear-console --add-confirmation-message\n```\n\n## Output\n\nReturns JSON confirming the console was cleared.\n", "---\nname: uloop-focus-window\ndescription: Bring Unity Editor window to front via uloop CLI. Use when you need to: (1) Focus Unity Editor before capturing screenshots, (2) Ensure Unity window is visible for visual checks, (3) Bring Unity to foreground for user interaction.\n---\n\n# uloop focus-window\n\nBring Unity Editor window to front.\n\n## Usage\n\n```bash\nuloop focus-window\n```\n\n## Parameters\n\nNone.\n\n## Examples\n\n```bash\n# Focus Unity Editor\nuloop focus-window\n```\n\n## Output\n\nReturns JSON confirming the window was focused.\n\n## Notes\n\n- Useful before `uloop capture-gameview` to ensure Game View is visible\n- Brings the main Unity Editor window to the foreground\n", "---\nname: uloop-get-hierarchy\ndescription: Get Unity Hierarchy structure via uloop CLI. Use when you need to: (1) Inspect scene structure and GameObject tree, (2) Find GameObjects and their parent-child relationships, (3) Check component attachments on objects.\n---\n\n# uloop get-hierarchy\n\nGet Unity Hierarchy structure.\n\n## Usage\n\n```bash\nuloop get-hierarchy [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--root-path` | string | - | Root GameObject path to start from |\n| `--max-depth` | integer | `-1` | Maximum depth (-1 for unlimited) |\n| `--include-components` | boolean | `true` | Include component information |\n| `--include-inactive` | boolean | `true` | Include inactive GameObjects |\n| `--include-paths` | boolean | `false` | Include full path information |\n\n## Examples\n\n```bash\n# Get entire hierarchy\nuloop get-hierarchy\n\n# Get hierarchy from specific root\nuloop get-hierarchy --root-path \"Canvas/UI\"\n\n# Limit depth\nuloop get-hierarchy --max-depth 2\n\n# Without components\nuloop get-hierarchy --include-components false\n```\n\n## Output\n\nReturns JSON with hierarchical structure of GameObjects and their components.\n", "---\nname: uloop-unity-search\ndescription: Search Unity project via uloop CLI. Use when you need to: (1) Find assets by name or type (scenes, prefabs, scripts, materials), (2) Search for project resources using Unity's search system, (3) Locate files within the Unity project.\n---\n\n# uloop unity-search\n\nSearch Unity project using Unity Search.\n\n## Usage\n\n```bash\nuloop unity-search [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--search-query` | string | - | Search query |\n| `--providers` | array | - | Search providers (e.g., `asset`, `scene`, `find`) |\n| `--max-results` | integer | `50` | Maximum number of results |\n| `--save-to-file` | boolean | `false` | Save results to file |\n\n## Examples\n\n```bash\n# Search for assets\nuloop unity-search --search-query \"Player\"\n\n# Search with specific provider\nuloop unity-search --search-query \"t:Prefab\" --providers asset\n\n# Limit results\nuloop unity-search --search-query \"*.cs\" --max-results 20\n```\n\n## Output\n\nReturns JSON array of search results with paths and metadata.\n\n## Notes\n\nUse `uloop get-provider-details` to discover available search providers.\n", "---\nname: uloop-get-menu-items\ndescription: Retrieve Unity MenuItems via uloop CLI. Use when you need to: (1) Discover available menu commands in Unity Editor, (2) Find menu paths for automation, (3) Prepare for executing menu items programmatically.\n---\n\n# uloop get-menu-items\n\nRetrieve Unity MenuItems.\n\n## Usage\n\n```bash\nuloop get-menu-items [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--filter-text` | string | - | Filter text |\n| `--filter-type` | string | `contains` | Filter type: `contains`, `exact`, `startswith` |\n| `--max-count` | integer | `200` | Maximum number of items |\n| `--include-validation` | boolean | `false` | Include validation functions |\n\n## Examples\n\n```bash\n# List all menu items\nuloop get-menu-items\n\n# Filter by text\nuloop get-menu-items --filter-text \"GameObject\"\n\n# Exact match\nuloop get-menu-items --filter-text \"File/Save\" --filter-type exact\n```\n\n## Output\n\nReturns JSON array of menu items with paths and metadata.\n\n## Notes\n\nUse with `uloop execute-menu-item` to run discovered menu commands.\n", "---\nname: uloop-execute-menu-item\ndescription: Execute Unity MenuItem via uloop CLI. Use when you need to: (1) Trigger menu commands programmatically, (2) Automate editor actions (save, build, refresh), (3) Run custom menu items defined in scripts.\n---\n\n# uloop execute-menu-item\n\nExecute Unity MenuItem.\n\n## Usage\n\n```bash\nuloop execute-menu-item --menu-item-path \"<path>\"\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--menu-item-path` | string | - | Menu item path (e.g., \"GameObject/Create Empty\") |\n| `--use-reflection-fallback` | boolean | `true` | Use reflection fallback |\n\n## Examples\n\n```bash\n# Create empty GameObject\nuloop execute-menu-item --menu-item-path \"GameObject/Create Empty\"\n\n# Save scene\nuloop execute-menu-item --menu-item-path \"File/Save\"\n\n# Open project settings\nuloop execute-menu-item --menu-item-path \"Edit/Project Settings...\"\n```\n\n## Output\n\nReturns JSON with execution result.\n\n## Notes\n\n- Use `uloop get-menu-items` to discover available menu paths\n- Some menu items may require specific context or selection\n", "---\nname: uloop-find-game-objects\ndescription: Find GameObjects with search criteria via uloop CLI. Use when you need to: (1) Locate GameObjects by name pattern, (2) Find objects by tag or layer, (3) Search for objects with specific component types.\n---\n\n# uloop find-game-objects\n\nFind GameObjects with search criteria.\n\n## Usage\n\n```bash\nuloop find-game-objects [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--name-pattern` | string | - | Name pattern to search |\n| `--search-mode` | string | `Contains` | Search mode: `Exact`, `Path`, `Regex`, `Contains` |\n| `--required-components` | array | - | Required components |\n| `--tag` | string | - | Tag filter |\n| `--layer` | string | - | Layer filter |\n| `--max-results` | integer | `20` | Maximum number of results |\n| `--include-inactive` | boolean | `false` | Include inactive GameObjects |\n\n## Examples\n\n```bash\n# Find by name\nuloop find-game-objects --name-pattern \"Player\"\n\n# Find with component\nuloop find-game-objects --required-components Rigidbody\n\n# Find by tag\nuloop find-game-objects --tag \"Enemy\"\n\n# Regex search\nuloop find-game-objects --name-pattern \"UI_.*\" --search-mode Regex\n```\n\n## Output\n\nReturns JSON array of matching GameObjects with paths and components.\n", "---\nname: uloop-capture-gameview\ndescription: Capture Unity Game View as PNG via uloop CLI. Use when you need to: (1) Take a screenshot of the current Game View, (2) Capture visual state for debugging or verification, (3) Save game output as an image file.\n---\n\n# uloop capture-gameview\n\nCapture Unity Game View and save as PNG image.\n\n## Usage\n\n```bash\nuloop capture-gameview [--resolution-scale <scale>]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--resolution-scale` | number | `1.0` | Resolution scale (0.1 to 1.0) |\n\n## Examples\n\n```bash\n# Capture at full resolution\nuloop capture-gameview\n\n# Capture at half resolution\nuloop capture-gameview --resolution-scale 0.5\n```\n\n## Output\n\nReturns JSON with file path to the saved PNG image.\n\n## Notes\n\n- Use `uloop focus-window` first if needed\n- Game View must be visible in Unity Editor\n", "---\nname: uloop-execute-dynamic-code\ndescription: Execute C# code dynamically in Unity Editor via uloop CLI. Use for editor automation: (1) Prefab/material wiring and AddComponent operations, (2) Reference wiring with SerializedObject, (3) Scene/hierarchy edits and batch operations. NOT for file I/O or script authoring.\n---\n\n# uloop execute-dynamic-code\n\nExecute C# code dynamically in Unity Editor.\n\n## Usage\n\n```bash\nuloop execute-dynamic-code --code '<c# code>'\n```\n\n## Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `--code` | string | C# code to execute (direct statements, no class wrapper) |\n| `--compile-only` | boolean | Compile without execution |\n| `--auto-qualify-unity-types-once` | boolean | Auto-qualify Unity types |\n\n## Code Format\n\nWrite direct statements only (no classes/namespaces/methods). Return is optional.\n\n```csharp\n// Using directives at top are hoisted\nusing UnityEngine;\nvar x = Mathf.PI;\nreturn x;\n```\n\n## String Literals (Shell-specific)\n\n| Shell | Method |\n|-------|--------|\n| bash/zsh/MINGW64/Git Bash | `'Debug.Log(\"Hello!\");'` |\n| PowerShell | `'Debug.Log(\"\"Hello!\"\");'` |\n\n## Allowed Operations\n\n- Prefab/material wiring (PrefabUtility)\n- AddComponent + reference wiring (SerializedObject)\n- Scene/hierarchy edits\n- Inspector modifications\n\n## Forbidden Operations\n\n- System.IO.* (File/Directory/Path)\n- AssetDatabase.CreateFolder / file writes\n- Create/edit .cs/.asmdef files\n\n## Examples\n\n### bash / zsh / MINGW64 / Git Bash\n\n```bash\nuloop execute-dynamic-code --code 'return Selection.activeGameObject?.name;'\nuloop execute-dynamic-code --code 'new GameObject(\"MyObject\");'\nuloop execute-dynamic-code --code 'UnityEngine.Debug.Log(\"Hello from CLI!\");'\n```\n\n### PowerShell\n\n```powershell\nuloop execute-dynamic-code --code 'return Selection.activeGameObject?.name;'\nuloop execute-dynamic-code --code 'new GameObject(\"\"MyObject\"\");'\nuloop execute-dynamic-code --code 'UnityEngine.Debug.Log(\"\"Hello from CLI!\"\");'\n```\n\n## Output\n\nReturns JSON with execution result or compile errors.\n\n## Notes\n\nFor file/directory operations, use terminal commands instead.\n", "---\nname: uloop-get-provider-details\ndescription: Get Unity Search provider details via uloop CLI. Use when you need to: (1) Discover available search providers, (2) Understand search capabilities and filters, (3) Configure searches with specific provider options.\n---\n\n# uloop get-provider-details\n\nGet detailed information about Unity Search providers.\n\n## Usage\n\n```bash\nuloop get-provider-details [options]\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `--provider-id` | string | - | Specific provider ID to query |\n| `--active-only` | boolean | `false` | Only show active providers |\n| `--include-descriptions` | boolean | `true` | Include descriptions |\n| `--sort-by-priority` | boolean | `true` | Sort by priority |\n\n## Examples\n\n```bash\n# List all providers\nuloop get-provider-details\n\n# Get specific provider\nuloop get-provider-details --provider-id asset\n\n# Active providers only\nuloop get-provider-details --active-only\n```\n\n## Output\n\nReturns JSON:\n- `Providers`: array of provider info (ID, name, description, priority)\n\n## Notes\n\nUse provider IDs with `uloop unity-search --providers` option.\n", "/**\n * Bundled skill definitions for uloop CLI.\n * These skills are embedded at build time via esbuild --loader:.md=text\n */\n\nimport compileSkill from './skill-definitions/uloop-compile/SKILL.md';\nimport getLogsSkill from './skill-definitions/uloop-get-logs/SKILL.md';\nimport runTestsSkill from './skill-definitions/uloop-run-tests/SKILL.md';\nimport clearConsoleSkill from './skill-definitions/uloop-clear-console/SKILL.md';\nimport focusWindowSkill from './skill-definitions/uloop-focus-window/SKILL.md';\nimport getHierarchySkill from './skill-definitions/uloop-get-hierarchy/SKILL.md';\nimport unitySearchSkill from './skill-definitions/uloop-unity-search/SKILL.md';\nimport getMenuItemsSkill from './skill-definitions/uloop-get-menu-items/SKILL.md';\nimport executeMenuItemSkill from './skill-definitions/uloop-execute-menu-item/SKILL.md';\nimport findGameObjectsSkill from './skill-definitions/uloop-find-game-objects/SKILL.md';\nimport captureGameviewSkill from './skill-definitions/uloop-capture-gameview/SKILL.md';\nimport executeDynamicCodeSkill from './skill-definitions/uloop-execute-dynamic-code/SKILL.md';\nimport getProviderDetailsSkill from './skill-definitions/uloop-get-provider-details/SKILL.md';\n\nexport interface BundledSkill {\n name: string;\n dirName: string;\n content: string;\n}\n\nexport const BUNDLED_SKILLS: BundledSkill[] = [\n { name: 'uloop-compile', dirName: 'uloop-compile', content: compileSkill },\n { name: 'uloop-get-logs', dirName: 'uloop-get-logs', content: getLogsSkill },\n { name: 'uloop-run-tests', dirName: 'uloop-run-tests', content: runTestsSkill },\n { name: 'uloop-clear-console', dirName: 'uloop-clear-console', content: clearConsoleSkill },\n { name: 'uloop-focus-window', dirName: 'uloop-focus-window', content: focusWindowSkill },\n { name: 'uloop-get-hierarchy', dirName: 'uloop-get-hierarchy', content: getHierarchySkill },\n { name: 'uloop-unity-search', dirName: 'uloop-unity-search', content: unitySearchSkill },\n { name: 'uloop-get-menu-items', dirName: 'uloop-get-menu-items', content: getMenuItemsSkill },\n {\n name: 'uloop-execute-menu-item',\n dirName: 'uloop-execute-menu-item',\n content: executeMenuItemSkill,\n },\n {\n name: 'uloop-find-game-objects',\n dirName: 'uloop-find-game-objects',\n content: findGameObjectsSkill,\n },\n {\n name: 'uloop-capture-gameview',\n dirName: 'uloop-capture-gameview',\n content: captureGameviewSkill,\n },\n {\n name: 'uloop-execute-dynamic-code',\n dirName: 'uloop-execute-dynamic-code',\n content: executeDynamicCodeSkill,\n },\n {\n name: 'uloop-get-provider-details',\n dirName: 'uloop-get-provider-details',\n content: getProviderDetailsSkill,\n },\n];\n\nexport function getBundledSkillByName(name: string): BundledSkill | undefined {\n return BUNDLED_SKILLS.find((skill) => skill.name === name);\n}\n", "/**\n * CLI command definitions for skills management.\n */\n\n// CLI commands output to console by design\n/* eslint-disable no-console */\n\nimport { Command } from 'commander';\nimport {\n getAllSkillStatuses,\n installAllSkills,\n uninstallAllSkills,\n getInstallDir,\n getTotalSkillCount,\n} from './skills-manager.js';\n\nexport function registerSkillsCommand(program: Command): void {\n const skillsCmd = program.command('skills').description('Manage uloop skills for Claude Code');\n\n skillsCmd\n .command('list')\n .description('List all uloop skills and their installation status')\n .option('-g, --global', 'Check global installation (~/.claude/skills/)')\n .action((options: { global?: boolean }) => {\n listSkills(options.global ?? false);\n });\n\n skillsCmd\n .command('install')\n .description('Install all uloop skills')\n .option('-g, --global', 'Install to global location (~/.claude/skills/)')\n .action((options: { global?: boolean }) => {\n installSkills(options.global ?? false);\n });\n\n skillsCmd\n .command('uninstall')\n .description('Uninstall all uloop skills')\n .option('-g, --global', 'Uninstall from global location (~/.claude/skills/)')\n .action((options: { global?: boolean }) => {\n uninstallSkills(options.global ?? false);\n });\n}\n\nfunction listSkills(global: boolean): void {\n const location = global ? 'Global' : 'Project';\n const dir = getInstallDir(global);\n\n console.log(`\\nuloop Skills Status (${location}):`);\n console.log(`Location: ${dir}`);\n console.log('='.repeat(50));\n console.log('');\n\n const statuses = getAllSkillStatuses(global);\n\n for (const skill of statuses) {\n const icon = getStatusIcon(skill.status);\n const statusText = getStatusText(skill.status);\n console.log(` ${icon} ${skill.name} (${statusText})`);\n }\n\n console.log('');\n console.log(`Total: ${getTotalSkillCount()} bundled skills`);\n}\n\nfunction getStatusIcon(status: string): string {\n switch (status) {\n case 'installed':\n return '\\x1b[32m\u2713\\x1b[0m';\n case 'outdated':\n return '\\x1b[33m\u2191\\x1b[0m';\n case 'not_installed':\n return '\\x1b[31m\u2717\\x1b[0m';\n default:\n return '?';\n }\n}\n\nfunction getStatusText(status: string): string {\n switch (status) {\n case 'installed':\n return 'installed';\n case 'outdated':\n return 'outdated';\n case 'not_installed':\n return 'not installed';\n default:\n return 'unknown';\n }\n}\n\nfunction installSkills(global: boolean): void {\n const location = global ? 'global' : 'project';\n const dir = getInstallDir(global);\n\n console.log(`\\nInstalling uloop skills (${location})...`);\n console.log('');\n\n const result = installAllSkills(global);\n\n console.log(`\\x1b[32m\u2713\\x1b[0m Installed: ${result.installed}`);\n console.log(`\\x1b[33m\u2191\\x1b[0m Updated: ${result.updated}`);\n console.log(`\\x1b[90m-\\x1b[0m Skipped (up-to-date): ${result.skipped}`);\n console.log('');\n console.log(`Skills installed to ${dir}`);\n}\n\nfunction uninstallSkills(global: boolean): void {\n const location = global ? 'global' : 'project';\n const dir = getInstallDir(global);\n\n console.log(`\\nUninstalling uloop skills (${location})...`);\n console.log('');\n\n const result = uninstallAllSkills(global);\n\n console.log(`\\x1b[31m\u2717\\x1b[0m Removed: ${result.removed}`);\n console.log(`\\x1b[90m-\\x1b[0m Not found: ${result.notFound}`);\n console.log('');\n console.log(`Skills removed from ${dir}`);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,wCAAAA,UAAA;AAGA,QAAMC,kBAAN,cAA6B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOjC,YAAY,UAAU,MAAM,SAAS;AACnC,cAAM,OAAO;AAEb,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,aAAK,OAAO,KAAK,YAAY;AAC7B,aAAK,OAAO;AACZ,aAAK,WAAW;AAChB,aAAK,cAAc;AAAA,MACrB;AAAA,IACF;AAKA,QAAMC,wBAAN,cAAmCD,gBAAe;AAAA;AAAA;AAAA;AAAA;AAAA,MAKhD,YAAY,SAAS;AACnB,cAAM,GAAG,6BAA6B,OAAO;AAE7C,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,aAAK,OAAO,KAAK,YAAY;AAAA,MAC/B;AAAA,IACF;AAEA,IAAAD,SAAQ,iBAAiBC;AACzB,IAAAD,SAAQ,uBAAuBE;AAAA;AAAA;;;ACtC/B;AAAA,2CAAAC,UAAA;AAAA,QAAM,EAAE,sBAAAC,sBAAqB,IAAI;AAEjC,QAAMC,YAAN,MAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUb,YAAY,MAAM,aAAa;AAC7B,aAAK,cAAc,eAAe;AAClC,aAAK,WAAW;AAChB,aAAK,WAAW;AAChB,aAAK,eAAe;AACpB,aAAK,0BAA0B;AAC/B,aAAK,aAAa;AAElB,gBAAQ,KAAK,CAAC,GAAG;AAAA,UACf,KAAK;AACH,iBAAK,WAAW;AAChB,iBAAK,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AAmC;AAC1C,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,MAAI,KAAK,SAAS,iBAAiB,GAAG;AACpC,UAAM,QAAQ,eAAe;AAC7B,UAAM,cAAc,CAAC,GAAG,kBAAkB,GAAG,MAAM,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;AAC3E,YAAQ,IAAI,YAAY,KAAK,IAAI,CAAC;AAClC,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB,KAAK,QAAQ,gBAAgB;AACpD,MAAI,mBAAmB,MAAM,KAAK,iBAAiB,CAAC,GAAG;AACrD,UAAM,UAAU,KAAK,iBAAiB,CAAC;AACvC,0BAAsB,OAAO;AAC7B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKA,SAAS,sBAAsB,SAAuB;AAEpD,MAAI,iBAAiB,SAAS,OAA4C,GAAG;AAC3E;AAAA,EACF;AAGA,QAAM,QAAQ,eAAe;AAC7B,QAAM,OAAO,MAAM,MAAM,KAAK,CAAC,MAAM,EAAE,SAAS,OAAO;AACvD,MAAI,CAAC,MAAM;AACT;AAAA,EACF;AAEA,QAAM,UAAoB,CAAC;AAC3B,aAAW,YAAY,OAAO,KAAK,KAAK,YAAY,UAAU,GAAG;AAC/D,UAAM,YAAY,kBAAkB,QAAQ;AAC5C,YAAQ,KAAK,KAAK,SAAS,EAAE;AAAA,EAC/B;AAEA,UAAQ,IAAI,QAAQ,KAAK,IAAI,CAAC;AAChC;AAGA,IAAI,CAAC,wBAAwB,GAAG;AAC9B,EAAAA,SAAQ,MAAM;AAChB;",
6
+ "names": ["exports", "CommanderError", "InvalidArgumentError", "exports", "InvalidArgumentError", "Argument", "exports", "Help", "cmd", "exports", "InvalidArgumentError", "Option", "str", "exports", "exports", "process", "Argument", "CommanderError", "Help", "Option", "Command", "option", "path", "exports", "Argument", "Command", "CommanderError", "InvalidArgumentError", "Help", "Option", "import_fs", "import_path", "import_os", "commander", "import_fs", "import_path", "import_path", "import_fs", "import_path", "import_fs", "import_path", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "SKILL_default", "program", "program"]
7
7
  }