skill-creator 1.5.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/LICENSE +21 -0
  3. package/README.md +248 -275
  4. package/dist/cli.js +51129 -0
  5. package/dist/cli.js.map +7 -0
  6. package/dist/daemon.js +52163 -0
  7. package/dist/daemon.js.map +7 -0
  8. package/dist/package.json +5 -0
  9. package/dist/webui/_app/immutable/assets/0.0XN00VKF.css +2 -0
  10. package/dist/webui/_app/immutable/assets/ProviderView.DEH95hqa.css +1 -0
  11. package/dist/webui/_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
  12. package/dist/webui/_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
  13. package/dist/webui/_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
  14. package/dist/webui/_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
  15. package/dist/webui/_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
  16. package/dist/webui/_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
  17. package/dist/webui/_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
  18. package/dist/webui/_app/immutable/assets/shell.U4CQV8re.css +1 -0
  19. package/dist/webui/_app/immutable/chunks/0umLG1IN.js +1 -0
  20. package/dist/webui/_app/immutable/chunks/B2zyE4XX.js +1 -0
  21. package/dist/webui/_app/immutable/chunks/BD9g8Udg.js +1 -0
  22. package/dist/webui/_app/immutable/chunks/BEPs9Z9s.js +1 -0
  23. package/dist/webui/_app/immutable/chunks/BEsyQXpe.js +1 -0
  24. package/dist/webui/_app/immutable/chunks/BIfnT_mK.js +1 -0
  25. package/dist/webui/_app/immutable/chunks/BYNWtKcf.js +259 -0
  26. package/dist/webui/_app/immutable/chunks/B_YFzSAv.js +2 -0
  27. package/dist/webui/_app/immutable/chunks/BaH4uqzh.js +1 -0
  28. package/dist/webui/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  29. package/dist/webui/_app/immutable/chunks/BkEnd9_Z.js +1 -0
  30. package/dist/webui/_app/immutable/chunks/BrDKAjtR.js +1 -0
  31. package/dist/webui/_app/immutable/chunks/Bs27XW8_.js +1 -0
  32. package/dist/webui/_app/immutable/chunks/BySEbwqx.js +1 -0
  33. package/dist/webui/_app/immutable/chunks/C3mlWJXx.js +1 -0
  34. package/dist/webui/_app/immutable/chunks/CEpOi93z.js +2 -0
  35. package/dist/webui/_app/immutable/chunks/CIFG41pU.js +1 -0
  36. package/dist/webui/_app/immutable/chunks/CNPsST_i.js +1 -0
  37. package/dist/webui/_app/immutable/chunks/CQD9uzpA.js +1 -0
  38. package/dist/webui/_app/immutable/chunks/CeR4do8T.js +1 -0
  39. package/dist/webui/_app/immutable/chunks/Ckw1quWt.js +1 -0
  40. package/dist/webui/_app/immutable/chunks/CmCJ0SKP.js +3 -0
  41. package/dist/webui/_app/immutable/chunks/D-V0xBeS.js +1 -0
  42. package/dist/webui/_app/immutable/chunks/D-ecV3TD.js +1 -0
  43. package/dist/webui/_app/immutable/chunks/D0xHg31U.js +1 -0
  44. package/dist/webui/_app/immutable/chunks/D25cXQtk.js +1 -0
  45. package/dist/webui/_app/immutable/chunks/D8Der6oM.js +1 -0
  46. package/dist/webui/_app/immutable/chunks/DEtYLPO4.js +8 -0
  47. package/dist/webui/_app/immutable/chunks/DJNLWtK-.js +1 -0
  48. package/dist/webui/_app/immutable/chunks/DLuJKUyD.js +1 -0
  49. package/dist/webui/_app/immutable/chunks/DWcQbrnv.js +52 -0
  50. package/dist/webui/_app/immutable/chunks/DZ_Kltd5.js +1 -0
  51. package/dist/webui/_app/immutable/chunks/DecrR9TK.js +1 -0
  52. package/dist/webui/_app/immutable/chunks/Dl8eQ129.js +5 -0
  53. package/dist/webui/_app/immutable/chunks/Dnkino9G.js +1 -0
  54. package/dist/webui/_app/immutable/chunks/HclGiUj8.js +1 -0
  55. package/dist/webui/_app/immutable/chunks/IYkYSIV6.js +1 -0
  56. package/dist/webui/_app/immutable/chunks/J36u8XLO.js +1 -0
  57. package/dist/webui/_app/immutable/chunks/UeEccMjN.js +1 -0
  58. package/dist/webui/_app/immutable/chunks/Y--VMh3y.js +1 -0
  59. package/dist/webui/_app/immutable/chunks/iicbWqXp.js +3 -0
  60. package/dist/webui/_app/immutable/chunks/s48N5eaK.js +67 -0
  61. package/dist/webui/_app/immutable/chunks/xihTtKlq.js +1 -0
  62. package/dist/webui/_app/immutable/entry/app.CbFi8HIH.js +2 -0
  63. package/dist/webui/_app/immutable/entry/start.C3bV1TCO.js +1 -0
  64. package/dist/webui/_app/immutable/nodes/0.C7-AKGsj.js +231 -0
  65. package/dist/webui/_app/immutable/nodes/1.raBmjc20.js +1 -0
  66. package/dist/webui/_app/immutable/nodes/2.ewWz-Ki-.js +1 -0
  67. package/dist/webui/_app/immutable/nodes/3.DCVfhckZ.js +1 -0
  68. package/dist/webui/_app/version.json +1 -0
  69. package/dist/webui/icons/app-icon/darwin-dark.icns +0 -0
  70. package/dist/webui/icons/app-icon/darwin-light.icns +0 -0
  71. package/dist/webui/icons/app-icon/win32-dark.ico +0 -0
  72. package/dist/webui/icons/app-icon/win32-light.ico +0 -0
  73. package/dist/webui/icons/app-icon.icns +0 -0
  74. package/dist/webui/icons/app-icon.ico +0 -0
  75. package/dist/webui/icons/app-icon.json +84 -0
  76. package/dist/webui/icons/app-icon.png +0 -0
  77. package/dist/webui/icons/flat-symbol.png +0 -0
  78. package/dist/webui/icons/linux/128x128/app-icon.png +0 -0
  79. package/dist/webui/icons/linux/16x16/app-icon.png +0 -0
  80. package/dist/webui/icons/linux/256x256/app-icon.png +0 -0
  81. package/dist/webui/icons/linux/32x32/app-icon.png +0 -0
  82. package/dist/webui/icons/linux/48x48/app-icon.png +0 -0
  83. package/dist/webui/icons/linux/512x512/app-icon.png +0 -0
  84. package/dist/webui/icons/linux/64x64/app-icon.png +0 -0
  85. package/dist/webui/icons/monochrome-mini.png +0 -0
  86. package/dist/webui/index.html +62 -0
  87. package/dist/webui/robots.txt +3 -0
  88. package/package.json +100 -70
  89. package/dist/chunk-Da8dvM5T.mjs +0 -1
  90. package/dist/cli.d.mts +0 -1016
  91. package/dist/cli.d.mts.map +0 -1
  92. package/dist/cli.mjs +0 -36
  93. package/dist/cli.mjs.map +0 -1
  94. package/dist/contentManager-8rmWJMb6.mjs +0 -22
  95. package/dist/contentManager-8rmWJMb6.mjs.map +0 -1
  96. package/dist/contentManager-Xt8N5psY.mjs +0 -1
  97. package/dist/dist-DZL34HNo.mjs +0 -8
  98. package/dist/dist-DZL34HNo.mjs.map +0 -1
  99. package/dist/dist-X_kVEzbK.mjs +0 -1
  100. package/dist/esm-8qfZdcpd.mjs +0 -33
  101. package/dist/esm-8qfZdcpd.mjs.map +0 -1
  102. package/dist/esm-BF5pvSbc.mjs +0 -1
  103. package/dist/esm-BbhxxeGF.mjs +0 -4
  104. package/dist/esm-BbhxxeGF.mjs.map +0 -1
  105. package/dist/index.d.mts +0 -1964
  106. package/dist/index.d.mts.map +0 -1
  107. package/dist/index.mjs +0 -21
  108. package/dist/index.mjs.map +0 -1
  109. package/dist/listContext7-DKXzgWdn.mjs +0 -2
  110. package/dist/listContext7-DKXzgWdn.mjs.map +0 -1
  111. package/dist/package-Cxx_VSyD.mjs +0 -2
  112. package/dist/package-Cxx_VSyD.mjs.map +0 -1
  113. package/dist/path-CuoiIaIe.mjs +0 -2
  114. package/dist/path-CuoiIaIe.mjs.map +0 -1
  115. package/dist/removeContext7-DOXrTXeI.mjs +0 -3
  116. package/dist/removeContext7-DOXrTXeI.mjs.map +0 -1
  117. package/dist/removeSkill-C-ehFexk.mjs +0 -5
  118. package/dist/removeSkill-C-ehFexk.mjs.map +0 -1
  119. package/dist/removeSkill-DWwhvzej.mjs +0 -1
  120. package/dist/runScript-Cr9RRN9y.mjs +0 -14
  121. package/dist/runScript-Cr9RRN9y.mjs.map +0 -1
  122. package/dist/search_format-DIs-1lKk.mjs +0 -5
  123. package/dist/search_format-DIs-1lKk.mjs.map +0 -1
  124. package/dist/shared-CFoY2Xhg.mjs +0 -2
  125. package/dist/shared-CFoY2Xhg.mjs.map +0 -1
  126. package/dist/skillMdManager-DP8fGZb7.mjs +0 -7
  127. package/dist/skillMdManager-DP8fGZb7.mjs.map +0 -1
  128. package/dist/unifiedSearch-CGZXw0NB.mjs +0 -1
  129. package/dist/unifiedSearch-l-lrSc9C.mjs +0 -4
  130. package/dist/unifiedSearch-l-lrSc9C.mjs.map +0 -1
  131. package/templates/SKILL.md +0 -41
  132. package/templates/SKILL.zh-CN.md +0 -297
  133. package/templates/skill-creator.md +0 -97
  134. package/templates/skill-creator.zh-CN.md +0 -100
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.mts","names":["LiteralUnion","LiteralType","BaseType","Record","CommanderError","Error","InvalidArgumentError","InvalidOptionArgumentError","ErrorOptions","Argument","T","Option","OptionValues","Help","Command","Map","HelpConfiguration","Partial","ParseOptions","HelpContext","AddHelpTextContext","OutputConfiguration","AddHelpTextPosition","HookEvent","OptionValueSource","CommandOptions","ReturnType","ExecutableCommandOptions","Promise","RegExp","ParseOptionsResult","createCommand","createOption","createArgument","program"],"sources":["../node_modules/.pnpm/commander@14.0.1/node_modules/commander/typings/index.d.ts","../src/cli.ts"],"sourcesContent":["// Type definitions for commander\n// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n// This is a trick to encourage editor to suggest the known literals while still\n// allowing any BaseType value.\n// References:\n// - https://github.com/microsoft/TypeScript/issues/29729\n// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts\n// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts\ntype LiteralUnion<LiteralType, BaseType extends string | number> =\n | LiteralType\n | (BaseType & Record<never, never>);\n\nexport class CommanderError extends Error {\n code: string;\n exitCode: number;\n message: string;\n nestedError?: string;\n\n /**\n * Constructs the CommanderError class\n * @param exitCode - suggested exit code which could be used with process.exit\n * @param code - an id string representing the error\n * @param message - human-readable description of the error\n */\n constructor(exitCode: number, code: string, message: string);\n}\n\nexport class InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param message - explanation of why argument is invalid\n */\n constructor(message: string);\n}\nexport { InvalidArgumentError as InvalidOptionArgumentError }; // deprecated old name\n\nexport interface ErrorOptions {\n // optional parameter for error()\n /** an id string representing the error */\n code?: string;\n /** suggested exit code which could be used with process.exit */\n exitCode?: number;\n}\n\nexport class Argument {\n description: string;\n required: boolean;\n variadic: boolean;\n defaultValue?: any;\n defaultValueDescription?: string;\n parseArg?: <T>(value: string, previous: T) => T;\n argChoices?: string[];\n\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 constructor(arg: string, description?: string);\n\n /**\n * Return argument name.\n */\n name(): string;\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n */\n default(value: unknown, description?: string): this;\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n */\n argParser<T>(fn: (value: string, previous: T) => T): this;\n\n /**\n * Only allow argument value to be one of choices.\n */\n choices(values: readonly string[]): this;\n\n /**\n * Make argument required.\n */\n argRequired(): this;\n\n /**\n * Make argument optional.\n */\n argOptional(): this;\n}\n\nexport class Option {\n flags: string;\n description: string;\n\n required: boolean; // A value must be supplied when the option is specified.\n optional: boolean; // A value is optional when the option is specified.\n variadic: boolean;\n mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.\n short?: string;\n long?: string;\n negate: boolean;\n defaultValue?: any;\n defaultValueDescription?: string;\n presetArg?: unknown;\n envVar?: string;\n parseArg?: <T>(value: string, previous: T) => T;\n hidden: boolean;\n argChoices?: string[];\n helpGroupHeading?: string;\n\n constructor(flags: string, description?: string);\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n */\n default(value: unknown, description?: string): this;\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 * ```ts\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n * ```\n */\n preset(arg: unknown): this;\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 * ```ts\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n * ```\n */\n conflicts(names: string | string[]): this;\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 implies(optionValues: OptionValues): this;\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variables 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 env(name: string): this;\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n */\n argParser<T>(fn: (value: string, previous: T) => T): this;\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n */\n makeOptionMandatory(mandatory?: boolean): this;\n\n /**\n * Hide option in help.\n */\n hideHelp(hide?: boolean): this;\n\n /**\n * Only allow option value to be one of choices.\n */\n choices(values: readonly string[]): this;\n\n /**\n * Return option name.\n */\n name(): string;\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n */\n attributeName(): string;\n\n /**\n * Set the help group heading.\n */\n helpGroup(heading: string): this;\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n */\n isBoolean(): boolean;\n}\n\nexport class Help {\n /** output helpWidth, long lines are wrapped to fit */\n helpWidth?: number;\n minWidthToWrap: number;\n sortSubcommands: boolean;\n sortOptions: boolean;\n showGlobalOptions: boolean;\n\n constructor();\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 others are provided for subclasses.\n */\n prepareContext(contextOptions: {\n error?: boolean;\n helpWidth?: number;\n outputHasColors?: boolean;\n }): void;\n\n /** Get the command term to show in the list of subcommands. */\n subcommandTerm(cmd: Command): string;\n /** Get the command summary to show in the list of subcommands. */\n subcommandDescription(cmd: Command): string;\n /** Get the option term to show in the list of options. */\n optionTerm(option: Option): string;\n /** Get the option description to show in the list of options. */\n optionDescription(option: Option): string;\n /** Get the argument term to show in the list of arguments. */\n argumentTerm(argument: Argument): string;\n /** Get the argument description to show in the list of arguments. */\n argumentDescription(argument: Argument): string;\n\n /** Get the command usage to be displayed at the top of the built-in help. */\n commandUsage(cmd: Command): string;\n /** Get the description for the command. */\n commandDescription(cmd: Command): string;\n\n /** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */\n visibleCommands(cmd: Command): Command[];\n /** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */\n visibleOptions(cmd: Command): Option[];\n /** Get an array of the visible global options. (Not including help.) */\n visibleGlobalOptions(cmd: Command): Option[];\n /** Get an array of the arguments which have descriptions. */\n visibleArguments(cmd: Command): Argument[];\n\n /** Get the longest command term length. */\n longestSubcommandTermLength(cmd: Command, helper: Help): number;\n /** Get the longest option term length. */\n longestOptionTermLength(cmd: Command, helper: Help): number;\n /** Get the longest global option term length. */\n longestGlobalOptionTermLength(cmd: Command, helper: Help): number;\n /** Get the longest argument term length. */\n longestArgumentTermLength(cmd: Command, helper: Help): number;\n\n /** Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations. */\n displayWidth(str: string): number;\n\n /** Style the titles. Called with 'Usage:', 'Options:', etc. */\n styleTitle(title: string): string;\n\n /** Usage: <str> */\n styleUsage(str: string): string;\n /** Style for command name in usage string. */\n styleCommandText(str: string): string;\n\n styleCommandDescription(str: string): string;\n styleOptionDescription(str: string): string;\n styleSubcommandDescription(str: string): string;\n styleArgumentDescription(str: string): string;\n /** Base style used by descriptions. */\n styleDescriptionText(str: string): string;\n\n styleOptionTerm(str: string): string;\n styleSubcommandTerm(str: string): string;\n styleArgumentTerm(str: string): string;\n\n /** Base style used in terms and usage for options. */\n styleOptionText(str: string): string;\n /** Base style used in terms and usage for subcommands. */\n styleSubcommandText(str: string): string;\n /** Base style used in terms and usage for arguments. */\n styleArgumentText(str: string): string;\n\n /** Calculate the pad width from the maximum term length. */\n padWidth(cmd: Command, helper: Help): number;\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 boxWrap(str: string, width: number): string;\n\n /** Detect manually wrapped and indented strings by checking for line break followed by whitespace. */\n preformatted(str: string): boolean;\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 formatItem(\n term: string,\n termWidth: number,\n description: string,\n helper: Help,\n ): string;\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n */\n formatItemList(heading: string, items: string[], helper: Help): string[];\n\n /**\n * Group items by their help group heading.\n */\n groupItems<T extends Command | Option>(\n unsortedItems: T[],\n visibleItems: T[],\n getGroup: (item: T) => string,\n ): Map<string, T[]>;\n\n /** Generate the built-in help text. */\n formatHelp(cmd: Command, helper: Help): string;\n}\nexport type HelpConfiguration = Partial<Help>;\n\nexport interface ParseOptions {\n from: 'node' | 'electron' | 'user';\n}\nexport interface HelpContext {\n // optional parameter for .help() and .outputHelp()\n error: boolean;\n}\nexport interface AddHelpTextContext {\n // passed to text function used with .addHelpText()\n error: boolean;\n command: Command;\n}\nexport interface OutputConfiguration {\n writeOut?(str: string): void;\n writeErr?(str: string): void;\n outputError?(str: string, write: (str: string) => void): void;\n\n getOutHelpWidth?(): number;\n getErrHelpWidth?(): number;\n\n getOutHasColors?(): boolean;\n getErrHasColors?(): boolean;\n stripColor?(str: string): string;\n}\n\nexport type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';\nexport type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';\n// The source is a string so author can define their own too.\nexport type OptionValueSource =\n | LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string>\n | undefined;\n\nexport type OptionValues = Record<string, any>;\n\nexport class Command {\n args: string[];\n processedArgs: any[];\n readonly commands: readonly Command[];\n readonly options: readonly Option[];\n readonly registeredArguments: readonly Argument[];\n parent: Command | null;\n\n constructor(name?: string);\n\n /**\n * Set the program version to `str`.\n *\n * This method auto-registers the \"-V, --version\" flag\n * which will print the version number when passed.\n *\n * You can optionally supply the flags and description to override the defaults.\n */\n version(str: string, flags?: string, description?: string): this;\n /**\n * Get the program version.\n */\n version(): string | undefined;\n\n /**\n * Define a command, implemented using an action handler.\n *\n * @remarks\n * The command description is supplied using `.description`, not as a parameter to `.command`.\n *\n * @example\n * ```ts\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 *\n * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param opts - configuration options\n * @returns new command\n */\n command(\n nameAndArgs: string,\n opts?: CommandOptions,\n ): ReturnType<this['createCommand']>;\n /**\n * Define a command, implemented in a separate executable file.\n *\n * @remarks\n * The command description is supplied as the second parameter to `.command`.\n *\n * @example\n * ```ts\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n * ```\n *\n * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param description - description of executable command\n * @param opts - configuration options\n * @returns `this` command for chaining\n */\n command(\n nameAndArgs: string,\n description: string,\n opts?: ExecutableCommandOptions,\n ): this;\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 createCommand(name?: string): Command;\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @returns `this` command for chaining\n */\n addCommand(cmd: Command, opts?: CommandOptions): this;\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 createArgument(name: string, description?: string): Argument;\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 * ```\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n * ```\n *\n * @returns `this` command for chaining\n */\n argument<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n argument(name: string, description?: string, defaultValue?: unknown): this;\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @returns `this` command for chaining\n */\n addArgument(arg: Argument): this;\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * ```\n * program.arguments('<cmd> [env]');\n * ```\n *\n * @returns `this` command for chaining\n */\n arguments(names: string): this;\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 * ```ts\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 */\n helpCommand(nameAndArgs: string, description?: string): this;\n helpCommand(enable: boolean): this;\n\n /**\n * Add prepared custom help command.\n */\n addHelpCommand(cmd: Command): this;\n /** @deprecated since v12, instead use helpCommand */\n addHelpCommand(nameAndArgs: string, description?: string): this;\n /** @deprecated since v12, instead use helpCommand */\n addHelpCommand(enable?: boolean): this;\n\n /**\n * Add hook for life cycle event.\n */\n hook(\n event: HookEvent,\n listener: (\n thisCommand: Command,\n actionCommand: Command,\n ) => void | Promise<void>,\n ): this;\n\n /**\n * Register callback to use as replacement for calling process.exit.\n */\n exitOverride(callback?: (err: CommanderError) => never | void): this;\n\n /**\n * Display error message and exit (or call exitOverride).\n */\n error(message: string, errorOptions?: ErrorOptions): never;\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 createHelp(): Help;\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 configureHelp(configuration: HelpConfiguration): this;\n /** Get configuration */\n configureHelp(): HelpConfiguration;\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 * // functions to change where being written, stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // matching functions to specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // functions based on what is being written out\n * outputError(str, write) // used for displaying errors, and not used for displaying help\n * ```\n */\n configureOutput(configuration: OutputConfiguration): this;\n /** Get configuration */\n configureOutput(): OutputConfiguration;\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 copyInheritedSettings(sourceCommand: Command): this;\n\n /**\n * Display the help or a custom message after an error occurs.\n */\n showHelpAfterError(displayHelp?: boolean | string): this;\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n */\n showSuggestionAfterError(displaySuggestion?: boolean): this;\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * ```\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n * ```\n *\n * @returns `this` command for chaining\n */\n action(fn: (this: this, ...args: any[]) => void | Promise<void>): this;\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 *\n * ```js\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 *\n * @returns `this` command for chaining\n */\n option(\n flags: string,\n description?: string,\n defaultValue?: string | boolean | string[],\n ): this;\n option<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n /** @deprecated since v7, instead use choices or a custom function */\n option(\n flags: string,\n description: string,\n regexp: RegExp,\n defaultValue?: string | boolean | string[],\n ): this;\n\n /**\n * Define 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 requiredOption(\n flags: string,\n description?: string,\n defaultValue?: string | boolean | string[],\n ): this;\n requiredOption<T>(\n flags: string,\n description: string,\n parseArg: (value: string, previous: T) => T,\n defaultValue?: T,\n ): this;\n /** @deprecated since v7, instead use choices or a custom function */\n requiredOption(\n flags: string,\n description: string,\n regexp: RegExp,\n defaultValue?: string | boolean | string[],\n ): this;\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\n createOption(flags: string, description?: string): Option;\n\n /**\n * Add a prepared Option.\n *\n * See .option() and .requiredOption() for creating and attaching an option in a single call.\n */\n addOption(option: Option): this;\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 * @returns `this` command for chaining\n */\n storeOptionsAsProperties<T extends OptionValues>(): this & T;\n storeOptionsAsProperties<T extends OptionValues>(\n storeAsProperties: true,\n ): this & T;\n storeOptionsAsProperties(storeAsProperties?: boolean): this;\n\n /**\n * Retrieve option value.\n */\n getOptionValue(key: string): any;\n\n /**\n * Store option value.\n */\n setOptionValue(key: string, value: unknown): this;\n\n /**\n * Store option value and where the value came from.\n */\n setOptionValueWithSource(\n key: string,\n value: unknown,\n source: OptionValueSource,\n ): this;\n\n /**\n * Get source of option value.\n */\n getOptionValueSource(key: string): OptionValueSource | undefined;\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n */\n getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * ```\n * // for `.option('-f,--flag [value]'):\n * .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour\n * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n * ```\n *\n * @returns `this` command for chaining\n */\n combineFlagAndOptionalValue(combine?: boolean): this;\n\n /**\n * Allow unknown options on the command line.\n *\n * @returns `this` command for chaining\n */\n allowUnknownOption(allowUnknown?: boolean): this;\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @returns `this` command for chaining\n */\n allowExcessArguments(allowExcess?: boolean): this;\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 *\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @returns `this` command for chaining\n */\n enablePositionalOptions(positional?: boolean): this;\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 *\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @returns `this` command for chaining\n */\n passThroughOptions(passThrough?: boolean): this;\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 * ```\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 *\n * @returns `this` command for chaining\n */\n parse(argv?: readonly string[], parseOptions?: ParseOptions): this;\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 * ```\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 *\n * @returns Promise\n */\n parseAsync(\n argv?: readonly string[],\n parseOptions?: ParseOptions,\n ): Promise<this>;\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(): void;\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(): void;\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 * 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 parseOptions(argv: string[]): ParseOptionsResult;\n\n /**\n * Return an object containing local option values as key-value pairs\n */\n opts<T extends OptionValues>(): T;\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n */\n optsWithGlobals<T extends OptionValues>(): T;\n\n /**\n * Set the description.\n *\n * @returns `this` command for chaining\n */\n\n description(str: string): this;\n /** @deprecated since v8, instead use .argument to add command argument with description */\n description(str: string, argsDescription: Record<string, string>): this;\n /**\n * Get the description.\n */\n description(): string;\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @returns `this` command for chaining\n */\n\n summary(str: string): this;\n /**\n * Get the summary.\n */\n summary(): string;\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 * @returns `this` command for chaining\n */\n alias(alias: string): this;\n /**\n * Get alias for the command.\n */\n alias(): string;\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @returns `this` command for chaining\n */\n aliases(aliases: readonly string[]): this;\n /**\n * Get aliases for the command.\n */\n aliases(): string[];\n\n /**\n * Set the command usage.\n *\n * @returns `this` command for chaining\n */\n usage(str: string): this;\n /**\n * Get the command usage.\n */\n usage(): string;\n\n /**\n * Set the name of the command.\n *\n * @returns `this` command for chaining\n */\n name(str: string): this;\n /**\n * Get the name of the command.\n */\n name(): string;\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 * ```ts\n * program.nameFromFilename(require.main.filename);\n * ```\n *\n * @returns `this` command for chaining\n */\n nameFromFilename(filename: string): this;\n\n /**\n * Set the directory for searching for executable subcommands of this command.\n *\n * @example\n * ```ts\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n * ```\n *\n * @returns `this` command for chaining\n */\n executableDir(path: string): this;\n /**\n * Get the executable search directory.\n */\n executableDir(): string | null;\n\n /**\n * Set the help group heading for this subcommand in parent command's help.\n *\n * @returns `this` command for chaining\n */\n helpGroup(heading: string): this;\n /**\n * Get the help group heading for this subcommand in parent command's help.\n */\n helpGroup(): string;\n\n /**\n * Set 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 * @returns `this` command for chaining\n */\n commandsGroup(heading: string): this;\n /**\n * Get the default help group heading for subcommands added to this command.\n */\n commandsGroup(): string;\n\n /**\n * Set 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 * @returns `this` command for chaining\n */\n optionsGroup(heading: string): this;\n /**\n * Get the default help group heading for options added to this command.\n */\n optionsGroup(): string;\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n */\n outputHelp(context?: HelpContext): void;\n /** @deprecated since v7 */\n outputHelp(cb?: (str: string) => string): void;\n\n /**\n * Return command help documentation.\n */\n helpInformation(context?: HelpContext): string;\n\n /**\n * You can pass in flags and a description to override the help\n * flags and help description for your command. Pass in false\n * to disable the built-in help option.\n */\n helpOption(flags?: string | boolean, description?: string): this;\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 addHelpOption(option: Option): this;\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n */\n help(context?: HelpContext): never;\n /** @deprecated since v7 */\n help(cb?: (str: string) => string): never;\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 addHelpText(position: AddHelpTextPosition, text: string): this;\n addHelpText(\n position: AddHelpTextPosition,\n text: (context: AddHelpTextContext) => string,\n ): this;\n\n /**\n * Add a listener (callback) for when events occur. (Implemented using EventEmitter.)\n */\n on(event: string | symbol, listener: (...args: any[]) => void): this;\n}\n\nexport interface CommandOptions {\n hidden?: boolean;\n isDefault?: boolean;\n /** @deprecated since v7, replaced by hidden */\n noHelp?: boolean;\n}\nexport interface ExecutableCommandOptions extends CommandOptions {\n executableFile?: string;\n}\n\nexport interface ParseOptionsResult {\n operands: string[];\n unknown: string[];\n}\n\nexport function createCommand(name?: string): Command;\nexport function createOption(flags: string, description?: string): Option;\nexport function createArgument(name: string, description?: string): Argument;\n\nexport const program: Command;\n"],"x_google_ignoreList":[0],"mappings":"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"}
package/dist/cli.mjs DELETED
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import{i as e,r as t,t as n}from"./chunk-Da8dvM5T.mjs";import{n as r,t as i}from"./package-Cxx_VSyD.mjs";import"./path-CuoiIaIe.mjs";import{r as a}from"./dist-DZL34HNo.mjs";import o,{join as s}from"node:path";import{existsSync as c,readdirSync as l}from"node:fs";import{homedir as u}from"node:os";var d=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),f=n((e=>{let{InvalidArgumentError:t}=d();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),p=n((e=>{let{humanReadableArgName:t}=f();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
3
- `)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
4
- `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
5
- `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),m=n((e=>{let{InvalidArgumentError:t}=d();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
6
- - a short flag is a single dash and a single character
7
- - either use a single dash and a single character (for a short flag)
8
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
9
- - too many short flags`):i.test(t)?Error(`${n}
10
- - too many long flags`):Error(`${n}
11
- - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),h=n((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),g=n((e=>{let n=t(`node:events`).EventEmitter,r=t(`node:child_process`),i=t(`node:path`),a=t(`node:fs`),o=t(`node:process`),{Argument:s,humanReadableArgName:c}=f(),{CommanderError:l}=d(),{Help:u,stripColor:g}=p(),{Option:_,DualOptions:v}=m(),{suggestSimilar:y}=h();var b=class e extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>o.stdout.write(e),writeErr:e=>o.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>o.stdout.isTTY?o.stdout.columns:void 0,getErrHelpWidth:()=>o.stderr.isTTY?o.stderr.columns:void 0,getOutHasColors:()=>S()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>S()??(o.stderr.isTTY&&o.stderr.hasColors?.()),stripColor:e=>g(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new u,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
12
- - specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new s(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
13
- Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new l(e,t,n)),o.exit(e)}action(e){return this._actionHandler=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new _(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
14
- - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{r(t,`error: option '${e.flags}' argument '${t}' is invalid.`,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{r(t,`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof _)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){o.versions?.electron&&(t.from=`electron`);let e=o.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=o.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:o.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
15
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(a.existsSync(e))return;let r=`'${e}' does not exist
16
- - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
17
- - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
18
- - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=i.resolve(e,t);if(a.existsSync(n))return n;if(s.includes(i.extname(t)))return;let r=s.find(e=>a.existsSync(`${n}${e}`));if(r)return`${n}${r}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=i.resolve(i.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=i.basename(this._scriptPath,i.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}n=s.includes(i.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=x(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=x(o.execArgv).concat(t),f=r.spawn(o.argv[0],t,{stdio:`inherit`})):f=r.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)===void 0?!1:this.getOptionValueSource(t)!==`default`});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-\d*\.?\d+(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
19
- `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in o.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,o.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new v(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=y(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=y(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>c(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(o.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
20
- Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function x(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function S(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=b,e.useColor=S}));const{program:_,createCommand:v,createArgument:y,createOption:b,CommanderError:x,InvalidArgumentError:S,InvalidOptionArgumentError:C,Command:w,Argument:T,Option:E,Help:D}=e(n((e=>{let{Argument:t}=f(),{Command:n}=g(),{CommanderError:r,InvalidArgumentError:i}=d(),{Help:a}=p(),{Option:o}=m();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i}))(),1).default;async function O(e){let t=new r;console.log(a(`cyan`,`magenta`)(`
21
- šŸš€ Creating skill...`));let n=await t.createSkill(e);if(n.created)return console.log(a(`green`,`cyan`)(`\nāœ… ${n.message}`)),console.log(a(`blue`,`cyan`)(`šŸ“ Skill Path: ${n.skillPath}`)),console.log(`
22
- šŸŽ‰ Skill created successfully!`),console.log(`
23
- Next steps:`),console.log(`1. Add content: skill-creator add-skill --pwd "${n.skillPath}" --title "My Note" --content "Your content"`),console.log(`2. Search skill: skill-creator search-skill --pwd "${n.skillPath}" "query"`),console.log(`3. Download docs: skill-creator download-context7 --pwd "${n.skillPath}" <context7_library_id>`),n.skillPath;throw Error(n.message||`Failed to create skill`)}const k=new w;let A={};async function j(e){let t=e.pwd||A.pwd;if(t)return t;if(e.package){let t=t=>{if(!c(t))return;let n=l(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).filter(t=>t.includes(e.package.replace(/[^a-z0-9]/gi,``)));return n.length>0?s(t,n[0]):void 0},n=t(s(process.cwd(),`.claude`,`skills`))||t(s(u(),`.claude`,`skills`));if(n)return n}throw Error(`Could not find skill directory. Please provide --pwd or a valid --package.`)}k.name(`skill-creator`).description(`Create claude-code-skills with documentation management`).version(i.getCurrentPackageInfo()?.version??`0.0.0`).option(`--pwd <path>`,`Global path to the skill directory (used for all commands)`),k.hook(`preAction`,e=>{A.pwd=e.opts().pwd}),k.command(`create-cc-skill`).option(`--interactive`,`Enable interactive confirmation prompts`).option(`--scope <scope>`,`Storage scope (user or current), or custom directory to store skills`).option(`--name <name>`,`The skill name`).option(`--description <description>`,`Custom description for the skill`).option(`--force`,`Force overwrite existing files in the skill directory`).argument(`<skill_dir_name>`,`The name of the skill directory to create`).action(async(e,t)=>{try{let{scope:n,interactive:r,force:i,description:a,name:l}=t,{default:d}=await import(`./esm-8qfZdcpd.mjs`),f=l||e;if(r){if(console.log(`Skill Creation Configuration:`),!n&&(n=(await d.prompt([{type:`list`,name:`scope`,message:`Where would you like to store this skill?`,choices:[{name:`Current directory (./.claude/skills/)`,value:`current`},{name:`User home directory (~/.claude/skills)`,value:`user`},new d.Separator,{name:`Custom directory`,value:`custom`}],default:c(s(process.cwd(),`.claude/agents/skill-creator.md`))?`current`:`user`}])).scope,n===`custom`)){let e=await d.prompt([{type:`input`,name:`scope`,message:`Directory to store skills`,validate:e=>e.trim()!==``||`Directory cannot be empty`}]);n=o.join(process.cwd(),e.scope)}if(!l){let{packageNameConfirmed:t}=await d.prompt([{type:`confirm`,name:`packageNameConfirmed`,message:`Use '${e}' as the package name?`,default:!0}]);if(!t){let{customSkillName:e}=await d.prompt([{type:`input`,name:`customSkillName`,message:`Enter the skill name:`,validate:e=>e.trim()!==``||`Skill name cannot be empty`}]);f=e.trim()}}if(!a){let{customDescription:e}=await d.prompt([{type:`input`,name:`customDescription`,message:`Enter the skill description:`}]);a=e.trim()}}if(n??=c(s(process.cwd(),`.claude/agents/skill-creator.md`))?`current`:`user`,n===`user`?n=o.join(u(),`.claude/skills`):n===`current`&&(n=o.join(process.cwd(),`.claude/skills`)),r){console.log(`
24
- Final Configuration:`),console.log(`- Storage location: ${n}`),console.log(`- Skill directory name: ${e}`),console.log(`- Skill Name: ${f}`),console.log(`- Skill Description: ${a}`);let{confirmFinal:t}=await d.prompt([{type:`confirm`,name:`confirmFinal`,message:`Proceed with skill creation?`,default:!0}]);t||(console.log(`Skill creation cancelled.`),process.exit(0))}let p=await O({baseDir:n,skillDirname:e,skillName:f,skillDescription:a,force:i});console.log(`Skill created successfully at: ${p}`)}catch(e){console.error(`Error:`,e instanceof Error?e.stack??e.message:String(e)),process.exit(1)}}),k.command(`init`).description(`Install skill-creator as subagent (interactive mode)`).option(`--scope <scope>`,`Storage scope (user or current)`).action(async e=>{let{runScript:t}=await import(`./runScript-Cr9RRN9y.mjs`),n=[];e.scope&&n.push(`--scope`,e.scope),await t(`init`,n)}),k.command(`init-cc`).description(`Install skill-creator as subagent in ~/.claude/agents/`).action(async()=>{let{runScript:e}=await import(`./runScript-Cr9RRN9y.mjs`);await e(`init`,[`--scope`,`user`])}),k.command(`search`).argument(`<keywords>`,`Search keywords for npm packages`).option(`-l, --limit <limit>`,`Number of results to show`,`10`).action(async(e,t)=>{let n=e,r=await i.suggestPackages(n,{limit:parseInt(t.limit)});console.log(JSON.stringify(r,null,2))}),k.command(`get-info`).argument(`<package_name>`,`The npm package name to get information for`).action(async e=>{let t=await i.getPackageInfo(e);t||(console.error(`āŒ Package "${e}" not found or API error occurred.`),process.exit(1));let n=t.version,r={skill_dir_name:i.createSkillFolderName(e,n),name:t.name,version:n,description:t.description||``,keywords:t.keywords||[],license:t.license||``,author:t.author||``,maintainers:t.maintainers||[],homepage:t.homepage||``,repository:{url:t.repository?.url||``,type:t.repository?.type||``},bugs:{url:t.bugs?.url||``},funding:t.funding||``,scripts:t.scripts||{},engines:t.engines||{},types:t.types||``,dependencies:t.dependencies||{},devDependencies:t.devDependencies||{},time:{created:t.time?.created||``,modified:t.time?.modified||``}};console.log(JSON.stringify(r,null,2))}),k.command(`search-skill`).argument(`<query>`,`Search query`).option(`--pwd <path>`,`Path to the skill directory`).option(`--package <name>`,`Package name to find skill directory for`).option(`--mode <mode>`,`Search mode: auto, fuzzy, or chroma`,`auto`).option(`--list`,`Show simplified list view (basic info only)`,!1).action(async(e,t)=>{try{let n=await j(t);console.log(a(`cyan`,`magenta`)(`
25
- šŸ” Searching in skill...`)),console.log(`Skill Path: ${n}`),console.log(`Query: ${e}`);let{chdir:r}=await import(`node:process`),i=process.cwd();r(n);try{let{runScript:n}=await import(`./runScript-Cr9RRN9y.mjs`),r=[`--query`,e];t.mode!==`auto`&&r.push(`--mode`,t.mode),t.list&&r.push(`--list`),await n(`search-skill`,r)}finally{r(i)}}catch(e){console.error(e),process.exit(1)}}),k.command(`download-context7`).argument(`<project_id>`,`Context7 library ID`).option(`--pwd <path>`,`Path to the skill directory`).option(`--package <name>`,`Package name to find skill directory for`).option(`-f, --force`,`Force update even if up to date`).option(`--skip-chroma-indexing`,`Skip automatic ChromaDB index building after download`).action(async(e,t)=>{try{let n=await j(t);console.log(a(`cyan`,`magenta`)(`
26
- šŸ“„ Downloading Context7 documentation...`)),console.log(`Skill Path: ${n}`),console.log(`Context7 ID: ${e}`);let{chdir:r}=await import(`node:process`),i=process.cwd();r(n);try{let{runScript:n}=await import(`./runScript-Cr9RRN9y.mjs`),r=[];t.force&&r.push(`--force`),t[`skip-chroma-indexing`]&&r.push(`--skip-chroma-indexing`),r.push(`--project-id`,e),await n(`download-context7`,r)}finally{r(i)}console.log(a(`green`,`cyan`)(`
27
- āœ… Documentation downloaded and sliced!`))}catch(e){console.error(e),process.exit(1)}}),k.command(`add-skill`).option(`--pwd <path>`,`Path to the skill directory`).option(`--package <name>`,`Package name to find skill directory for`).option(`-t, --title <title>`,`Content title`).option(`-c, --content <content>`,`Content text`).option(`-f, --file <file>`,`Read content from file`).option(`--force`,`Force overwrite existing content`).option(`--force-append`,`Append content to existing file instead of creating new file`).action(async e=>{!e.title&&!e.file&&(console.error(`āŒ Please provide either --title or --file`),process.exit(1));try{let t=await j(e);console.log(a(`cyan`,`magenta`)(`
28
- šŸ“ Adding content to skill...`)),console.log(`Skill Path: ${t}`);let{chdir:n}=await import(`node:process`),r=process.cwd();n(t);try{let{runScript:t}=await import(`./runScript-Cr9RRN9y.mjs`),n=[];e.title&&n.push(`--title`,e.title),e.content&&n.push(`--content`,e.content),e.file&&n.push(`--file`,e.file),e.force&&n.push(`--force`),e.forceAppend&&n.push(`--force-append`),await t(`add`,n)}finally{n(r)}console.log(a(`green`,`cyan`)(`
29
- āœ… Content added successfully!`))}catch(e){console.error(e),process.exit(1)}}),k.command(`list-skills`).description(`List all skill content files`).option(`--pwd <path>`,`Path to the skill directory`).option(`--package <name>`,`Package name to find skill directory for`).action(async e=>{try{let t=await j(e);console.log(a(`cyan`,`magenta`)(`
30
- šŸ“š Skill Content`)),console.log(`Skill Path: ${t}`);let{chdir:n}=await import(`node:process`),r=process.cwd();n(t);try{let{runScript:t}=await import(`./runScript-Cr9RRN9y.mjs`);await t(`list-skills`,process.argv.slice(3).filter(t=>!t.startsWith(`--pwd`)&&!t.startsWith(`--package`)&&t!==e.pwd&&t!==e.package))}finally{n(r)}}catch(e){console.error(e),process.exit(1)}}),k.command(`remove-skill`).description(`Remove a skill file`).option(`--pwd <path>`,`Path to the skill directory`).option(`--package <name>`,`Package name to find skill directory for`).option(`--type <type>`,`Type: user or context7:<project_id>`,`user`).option(`--file <file>`,`File name to remove`).action(async e=>{try{e.file||(console.error(`āŒ Please provide --file <filename>`),process.exit(1));let t=await j(e);console.log(a(`cyan`,`magenta`)(`
31
- šŸ—‘ļø Remove Skill File`)),console.log(`Skill Path: ${t}`),console.log(`Type: ${e.type}`),console.log(`File: ${e.file}`);let{chdir:n}=await import(`node:process`),r=process.cwd();n(t);try{let{removeSkill:t}=await import(`./removeSkill-DWwhvzej.mjs`);await t([`--type`,e.type,`--file`,e.file])}finally{n(r)}console.log(a(`green`,`cyan`)(`
32
- āœ… Skill file removed!`))}catch(e){console.error(e),process.exit(1)}}),k.command(`list-context7`).description(`List all Context7 projects`).option(`--pwd <path>`,`Path to the skill directory`).option(`--package <name>`,`Package name to find skill directory for`).action(async e=>{try{let t=await j(e);console.log(a(`cyan`,`magenta`)(`
33
- šŸ“¦ Context7 Projects`)),console.log(`Skill Path: ${t}`);let{chdir:n}=await import(`node:process`),r=process.cwd();n(t);try{let{listContext7:e}=await import(`./listContext7-DKXzgWdn.mjs`);await e()}finally{n(r)}}catch(e){console.error(e),process.exit(1)}}),k.command(`remove-context7`).argument(`<project_id>`,`Context7 project ID to remove`).description(`Remove a Context7 project`).option(`--pwd <path>`,`Path to the skill directory`).option(`--package <name>`,`Package name to find skill directory for`).action(async(e,t)=>{try{let n=await j(t);console.log(a(`cyan`,`magenta`)(`
34
- šŸ—‘ļø Remove Context7 Project`)),console.log(`Skill Path: ${n}`),console.log(`Project ID: ${e}`);let{chdir:r}=await import(`node:process`),i=process.cwd();r(n);try{let{removeContext7:t}=await import(`./removeContext7-DOXrTXeI.mjs`);await t([`--project-id`,e])}finally{r(i)}console.log(a(`green`,`cyan`)(`
35
- āœ… Context7 project removed!`))}catch(e){console.error(e),process.exit(1)}}),k.parse();export{k as program};
36
- //# sourceMappingURL=cli.mjs.map