import { Command } from 'commander'; /** * Options for enhancing command help text */ export interface HelpTextOptions { /** * Usage examples with descriptions * Format: "# Description\n$ commerce command --options" */ examples?: string[]; /** * JSON output structure example * Show the data structure returned in JSON mode */ output?: { description?: string; example: string; }; /** * Related commands that users might need */ relatedCommands?: Array<{ command: string; description: string; }>; /** * Important notes, tips, and common pitfalls */ notes?: string[]; } /** * Add enhanced help text sections to a Commander command * * This utility adds LLM-friendly documentation including: * - Real usage examples * - JSON output structure * - Related commands for workflow guidance * - Important notes and best practices * * @param command - The Commander command to enhance * @param options - Help text content options * @returns The enhanced command (for chaining) * * @example * ```typescript * const cmd = new Command('create') * .description('Create a product') * .option('--title ', 'Product name (required)') * .option('--price ', 'Product price (required)'); * * addEnhancedHelp(cmd, { * examples: [ * '# Create a basic product', * '$ commerce product create --title "Mug" --price 29.99', * '', * '# Create with JSON output', * '$ commerce product create --title "Mug" --price 29.99 --json' * ], * output: { * example: JSON.stringify({ * success: true, * data: { product_id: 'uuid', name: 'Mug', price: '29.99' } * }, null, 2) * }, * relatedCommands: [ * { command: 'product list', description: 'View created products' }, * { command: 'upload image', description: 'Upload product images' } * ], * notes: [ * 'title and price are required parameters', * 'Upload images first to get media IDs' * ] * }); * ``` */ export declare function addEnhancedHelp(command: Command, options: HelpTextOptions): Command; /** * Standardized output format documentation for success responses */ export declare const OUTPUT_SUCCESS_TEMPLATE: { success: boolean; data: { '...': string; }; message: string; }; /** * Standardized output format documentation for error responses */ export declare const OUTPUT_ERROR_TEMPLATE: { success: boolean; error: { code: string; message: string; }; }; /** * Helper to format option description with type and requirement info * * @param description - The option description * @param type - The parameter type (string, number, uuid, etc.) * @param required - Whether the parameter is required * @param defaultValue - Default value if any * @returns Formatted description * * @example * ```typescript * formatOptionDescription('Product name', 'string', true) * // Returns: "Product name (required)" * * formatOptionDescription('Stock quantity', 'number', false, 0) * // Returns: "Stock quantity (default: 0)" * ``` */ export declare function formatOptionDescription(description: string, type?: string, required?: boolean, defaultValue?: string | number): string; //# sourceMappingURL=helpText.d.ts.map