| 39 | // Intent: construct the CloudBurn CLI command tree. |
| 40 | // TODO(cloudburn): add global flags for profile, config path, and debug logging. |
| 41 | export const createProgram = (): Command => { |
| 42 | const program = createCliCommand(); |
| 43 | program |
| 44 | .name('cloudburn') |
| 45 | .usage('[command]') |
| 46 | .description('Know what you spend. Fix what you waste.') |
| 47 | .version(__VERSION__) |
| 48 | .option('--debug', 'Write execution trace messages to stderr') |
| 49 | .option('--format <format>', OUTPUT_FORMAT_OPTION_DESCRIPTION, parseOutputFormat); |
| 50 | configureCliHelp(program); |
| 51 | |
| 52 | registerCompletionCommand(program); |
| 53 | registerConfigCommand(program); |
| 54 | registerDiscoverCommand(program); |
| 55 | registerScanCommand(program); |
| 56 | registerRulesListCommand(program); |
| 57 | registerEstimateCommand(program); |
| 58 | |
| 59 | return program; |
| 60 | }; |
| 61 | |
| 62 | export const runCli = async (): Promise<void> => { |
| 63 | await createProgram().parseAsync(process.argv); |