|
1 | 1 | #!/usr/bin/env bun |
2 | 2 | import { Command } from 'commander'; |
3 | 3 | import { |
4 | | - registerAgentCommand, |
5 | | - registerAnalyzeCommand, |
6 | | - registerAutomationCommand, |
7 | | - registerConfigCommand, |
8 | | - registerDailyCommand, |
9 | | - registerDoctorCommand, |
10 | | - registerInboxCommand, |
11 | | - registerInitCommand, |
12 | | - registerPowCommand, |
13 | | - registerProviderCommand, |
14 | | - registerRunsCommand, |
15 | | - registerScoutCommand, |
| 4 | + registerAgentCommand, |
| 5 | + registerAnalyzeCommand, |
| 6 | + registerAutomationCommand, |
| 7 | + registerConfigCommand, |
| 8 | + registerDailyCommand, |
| 9 | + registerDoctorCommand, |
| 10 | + registerInboxCommand, |
| 11 | + registerInitCommand, |
| 12 | + registerPowCommand, |
| 13 | + registerProviderCommand, |
| 14 | + registerRunsCommand, |
| 15 | + registerScoutCommand, |
16 | 16 | } from './commands/index.js'; |
17 | 17 | import { getErrorMessage, ui } from './infra/index.js'; |
18 | 18 |
|
19 | 19 | const VERSION = '1.0.0'; |
20 | 20 |
|
21 | 21 | async function main(): Promise<void> { |
22 | | - const program = new Command(); |
23 | | - |
24 | | - program |
25 | | - .name('openmeta') |
26 | | - .description("OpenMeta CLI - Developer's daily open source growth companion") |
27 | | - .version(VERSION, '-v, --version', 'Show version') |
28 | | - .helpOption('-h, --help', 'Show help') |
29 | | - .showSuggestionAfterError() |
30 | | - .showHelpAfterError(); |
31 | | - |
32 | | - registerInitCommand(program); |
33 | | - registerAgentCommand(program); |
34 | | - registerAnalyzeCommand(program); |
35 | | - registerDailyCommand(program); |
36 | | - registerScoutCommand(program); |
37 | | - registerInboxCommand(program); |
38 | | - registerPowCommand(program); |
39 | | - registerConfigCommand(program); |
40 | | - registerProviderCommand(program); |
41 | | - registerAutomationCommand(program); |
42 | | - registerDoctorCommand(program); |
43 | | - registerRunsCommand(program); |
44 | | - |
45 | | - program.on('command:*', () => { |
46 | | - ui.commandFailed('openmeta', `Unknown command "${program.args.join(' ')}". Run "openmeta --help" to see available commands.`); |
47 | | - process.exit(1); |
48 | | - }); |
49 | | - |
50 | | - if (process.argv.length === 2) { |
51 | | - program.help(); |
52 | | - } |
53 | | - |
54 | | - await program.parseAsync(process.argv); |
| 22 | + const program = new Command(); |
| 23 | + |
| 24 | + program |
| 25 | + .name('openmeta') |
| 26 | + .description("OpenMeta CLI - Developer's daily open source growth companion") |
| 27 | + .version(VERSION, '-v, --version', 'Show version') |
| 28 | + .helpOption('-h, --help', 'Show help') |
| 29 | + .showSuggestionAfterError() |
| 30 | + .showHelpAfterError(); |
| 31 | + |
| 32 | + registerInitCommand(program); |
| 33 | + registerAgentCommand(program); |
| 34 | + registerAnalyzeCommand(program); |
| 35 | + registerDailyCommand(program); |
| 36 | + registerScoutCommand(program); |
| 37 | + registerInboxCommand(program); |
| 38 | + registerPowCommand(program); |
| 39 | + registerConfigCommand(program); |
| 40 | + registerProviderCommand(program); |
| 41 | + registerAutomationCommand(program); |
| 42 | + registerDoctorCommand(program); |
| 43 | + registerRunsCommand(program); |
| 44 | + |
| 45 | + program.on('command:*', () => { |
| 46 | + ui.commandFailed( |
| 47 | + 'openmeta', |
| 48 | + `Unknown command "${program.args.join(' ')}". Run "openmeta --help" to see available commands.`, |
| 49 | + ); |
| 50 | + process.exit(1); |
| 51 | + }); |
| 52 | + |
| 53 | + if (process.argv.length === 2) { |
| 54 | + program.help(); |
| 55 | + } |
| 56 | + |
| 57 | + await program.parseAsync(process.argv); |
55 | 58 | } |
56 | 59 |
|
57 | 60 | main().catch((error) => { |
58 | | - ui.commandFailed('openmeta', getErrorMessage(error)); |
59 | | - process.exit(1); |
| 61 | + ui.commandFailed('openmeta', getErrorMessage(error)); |
| 62 | + process.exit(1); |
60 | 63 | }); |
0 commit comments