@@ -2,14 +2,14 @@ const { Command } = require('commander')
2
2
const { getConfig } = require ( './src/config' )
3
3
const { projectCategories, dbSettings } = getConfig ( )
4
4
const { logger } = require ( './src/utils' )
5
- const { runAddProjectCommand, runWorkflowCommand, listWorkflowCommand } = require ( './src/cli' )
5
+ const { runAddProjectCommand, runWorkflowCommand, listWorkflowCommand, listCheckCommand } = require ( './src/cli' )
6
6
const knex = require ( 'knex' ) ( dbSettings )
7
7
8
8
const program = new Command ( )
9
9
10
10
const project = program . command ( 'project' ) . description ( 'Manage projects' )
11
11
12
- // Project commands
12
+ // Project related commands
13
13
project
14
14
. command ( 'add' )
15
15
. description ( 'Add a new project' )
@@ -27,7 +27,7 @@ project
27
27
}
28
28
} )
29
29
30
- // Workflow commands
30
+ // Workflows related commands
31
31
const workflow = program . command ( 'workflow' ) . description ( 'Manage workflows' )
32
32
33
33
workflow
@@ -51,4 +51,22 @@ workflow
51
51
. action ( ( options ) => {
52
52
listWorkflowCommand ( options )
53
53
} )
54
+
55
+ // Checks related commands
56
+ const check = program . command ( 'check' ) . description ( 'Manage checks' )
57
+
58
+ check
59
+ . command ( 'list' )
60
+ . description ( 'List all available checks' )
61
+ . action ( async ( options ) => {
62
+ try {
63
+ await listCheckCommand ( knex , options )
64
+ } catch ( error ) {
65
+ logger . error ( 'Error running check:' , error . message )
66
+ process . exit ( 1 )
67
+ } finally {
68
+ await knex . destroy ( )
69
+ }
70
+ } )
71
+
54
72
program . parse ( process . argv )
0 commit comments