diff --git a/README.md b/README.md index 54828f5..1277ddd 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -# checkctl \ No newline at end of file +# checkctl + +CLI for opengovernance + +## List of Commands + +- configure +- get benchmarks +- get compliance-summary-for-benchmark +- get compliance-summary-for-integration +- get controls +- get jobs +- get job-details +- run compliance +- run discovery + diff --git a/cmd/configure.go b/cmd/configure.go index e922bfa..e189d85 100644 --- a/cmd/configure.go +++ b/cmd/configure.go @@ -14,13 +14,14 @@ import ( // configureCmd represents the configure command var configureCmd = &cobra.Command{ Use: "configure", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: + Short: "Configuration for checkctl", + Long: `Configuration for checkctl + For interactive mode: + checkctl configure + For non-interactive mode: + checktl configure --api-key <> --app-endpoint https://path.to.app.endpoint --output json + `, -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, RunE: func(cmd *cobra.Command, args []string) error { var configuration *config.Configuration diff --git a/cmd/get/benchmarks.go b/cmd/get/benchmarks.go index c5e061b..b1bffd2 100644 --- a/cmd/get/benchmarks.go +++ b/cmd/get/benchmarks.go @@ -19,13 +19,11 @@ import ( // benchmarksCmd represents the benchmarks command var benchmarksCmd = &cobra.Command{ Use: "benchmarks", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, + Short: "Get information on all benchmarks", + Long: `Get information on all benchmarks + Example usage: + checkctl get benchmarks --page-number 1 --page-size 20 --output json + `, RunE: func(cmd *cobra.Command, args []string) error { client := &http.Client{} configuration, err := config.ReadConfigFile() diff --git a/cmd/get/controls.go b/cmd/get/controls.go index 1b9261d..18c7c43 100644 --- a/cmd/get/controls.go +++ b/cmd/get/controls.go @@ -19,13 +19,11 @@ import ( // controlsCmd represents the controls command var controlsCmd = &cobra.Command{ Use: "controls", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, + Short: "Get information for all controls", + Long: `Get information for all controls + Example usage: + checkctl get controls --page-number 1 --page-size 20 --output json + `, RunE: func(cmd *cobra.Command, args []string) error { client := &http.Client{} configuration, err := config.ReadConfigFile() diff --git a/cmd/root.go b/cmd/root.go index 127120c..da1206e 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,13 +15,38 @@ import ( // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "checkctl", - Short: "A brief description of your application", - Long: `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: + Short: "CLI for opengovernance", + Long: `CLI for opengovernance + Examples: -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, + Configure checkctl: + checkctl configure + + Run Discovery on one account: + checkctl run discovery --integration id_name=account4 + + Run discovery on all accounts: + checkctl run discovery --integration id_name=".*account.*" + + Run Discovery on all accounts with "prod" in name: + checkctl run discovery --integration id_name=".*prod.*" + + Run Compliance Benchmark for a given benchmark ID: + checkctl run compliance --benchmark-id aws_audit_manager_control_tower + + Run Compliance Benchmark on a list of Integrations: + checkctl run compliance --benchmark-id aws_audit_manager_control_tower --integration id_name="account1" --integration id_name="account2" + + Get Compliance Summary for an Integration + go run . get compliance-summary-for-integration --benchmark-id aws_audit_manager_control_tower --integration id_name=account3 + + Get Compliance Summary for a Benchmark + go run . get compliance-summary-for-benchmark --benchmark-id aws_audit_manager_control_tower + + Get details of job with given id and type: + get job-details --job-id 301 --job-type compliance + + `, // Uncomment the following line if your bare application // has an action associated with it: // Run: func(cmd *cobra.Command, args []string) { },