diff --git a/README.md b/README.md index 976c6be..dfdd759 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,12 @@ brew install openstatus ## Development -### Docs +### Generate Documentation Run this command to generate the documentation: ```bash go run cmd/docs/docs.go + cd docs + pandoc -s -t man openstatus-docs.md -o openstatus.1 ``` diff --git a/docs/openstatus-docs.md b/docs/openstatus-docs.md index fab4e05..5d48d28 100644 --- a/docs/openstatus-docs.md +++ b/docs/openstatus-docs.md @@ -2,7 +2,7 @@ # NAME -openstatus - This is OpenStatus Command Line Interface +openstatus - This is OpenStatus Command Line Interface, the OpenStatus.dev CLI # SYNOPSIS @@ -48,9 +48,17 @@ Delete a monitor **--auto-accept, -y**: Automatically accept the prompt +### export + +Export all your monitors + +**--access-token, -t**="": OpenStatus API Access Token + +**--output, -o**="": The output file name (default: openstatus.yaml) + ### info -Get monitor information +Get a monitor information **--access-token, -t**="": OpenStatus API Access Token @@ -66,7 +74,7 @@ List all monitors ### trigger -Trigger a monitor test +Trigger a monitor execution >openstatus monitors trigger [MonitorId] [options] @@ -84,7 +92,7 @@ Run your synthetics tests ## whoami, w -Get your current workspace information +Get your current workspace information, display the workspace name, slug, and plan >openstatus whoami [options] diff --git a/docs/openstatus.1 b/docs/openstatus.1 index 7a72a5b..d0dda41 100644 --- a/docs/openstatus.1 +++ b/docs/openstatus.1 @@ -3,7 +3,8 @@ .TH "" "" "" "" .SH OpenStatus CLI .SH NAME -openstatus \- This is OpenStatus Command Line Interface +openstatus \- This is OpenStatus Command Line Interface, the +OpenStatus.dev CLI .SH SYNOPSIS openstatus .SH DESCRIPTION @@ -44,8 +45,15 @@ openstatus monitors delete [MonitorID] [options] \f[B]\(enaccess\-token, \-t\f[R]=\(lq\(lq: OpenStatus API Access Token .PP \f[B]\(enauto\-accept, \-y\f[R]: Automatically accept the prompt +.SS export +Export all your monitors +.PP +\f[B]\(enaccess\-token, \-t\f[R]=\(lq\(lq: OpenStatus API Access Token +.PP +\f[B]\(enoutput, \-o\f[R]=\(lq\(lq: The output file name (default: +openstatus.yaml) .SS info -Get monitor information +Get a monitor information .PP \f[B]\(enaccess\-token, \-t\f[R]=\(lq\(lq: OpenStatus API Access Token .SS list @@ -59,7 +67,7 @@ openstatus monitors list [options] .PP \f[B]\(enall\f[R]: List all monitors including inactive ones .SS trigger -Trigger a monitor test +Trigger a monitor execution .RS .PP openstatus monitors trigger [MonitorId] [options] @@ -78,7 +86,8 @@ openstatus run[options] \f[B]\(enconfig\f[R]=\(lq\(lq: The configuration file (default: config.openstatus.yaml) .SS whoami, w -Get your current workspace information +Get your current workspace information, display the workspace name, +slug, and plan .RS .PP openstatus whoami [options] diff --git a/internal/cmd/app.go b/internal/cmd/app.go index d46fb52..95a0600 100644 --- a/internal/cmd/app.go +++ b/internal/cmd/app.go @@ -10,9 +10,10 @@ import ( func NewApp() *cli.Command { app := &cli.Command{ Name: "openstatus", - Usage: "This is OpenStatus Command Line Interface", + Suggest: true, + Usage: "This is OpenStatus Command Line Interface, the OpenStatus.dev CLI", Description: "OpenStatus is a command line interface for managing your monitors and triggering your synthetics tests. \n\nPlease report any issues at https://github.com/openstatusHQ/cli/issues/new", - Version: "v0.0.5", + Version: "v0.0.6", Commands: []*cli.Command{ monitors.MonitorsCmd(), run.RunCmd(), diff --git a/internal/monitors/monitor_create.go b/internal/monitors/monitor_create.go index a194e07..68f1133 100644 --- a/internal/monitors/monitor_create.go +++ b/internal/monitors/monitor_create.go @@ -50,7 +50,7 @@ func GetMonitorCreateCmd() *cli.Command { monitorInfoCmd := cli.Command{ Name: "create", Usage: "Create monitors (beta)", - Description: "Create your monitors from your openstatus.yaml file ", + Description: "Create the monitors defined in the openstatus.yaml file", UsageText: "openstatus monitors create [options]", Action: func(ctx context.Context, cmd *cli.Command) error { diff --git a/internal/monitors/monitor_export.go b/internal/monitors/monitor_export.go index ff74257..c72d180 100644 --- a/internal/monitors/monitor_export.go +++ b/internal/monitors/monitor_export.go @@ -138,7 +138,7 @@ func GetMonitorExportCmd() *cli.Command { monitorInfoCmd := cli.Command{ Name: "export", Usage: "Export all your monitors", - Description: "Export your monitors to YAML", + Description: "Export all your monitors to YAML", Action: func(ctx context.Context, cmd *cli.Command) error { // monitorId := cmd.Args().Get(0) err := ExportMonitor(http.DefaultClient, cmd.String("access-token"), cmd.String("output")) diff --git a/internal/monitors/monitor_info.go b/internal/monitors/monitor_info.go index 82d96cf..f89e17d 100644 --- a/internal/monitors/monitor_info.go +++ b/internal/monitors/monitor_info.go @@ -62,11 +62,11 @@ func GetMonitorInfo(httpClient *http.Client, apiKey string, monitorId string) er Settings: tw.Settings{ Lines: tw.Lines{ // Major internal separator lines ShowHeaderLine: tw.Off, // Line after header - ShowFooterLine: tw.On, // Line before footer (if footer exists) + ShowFooterLine: tw.On, // Line before footer (if footer exists) }, Separators: tw.Separators{ // General row and column separators BetweenRows: tw.Off, // Horizontal lines between data rows - BetweenColumns: tw.On, // Vertical lines between columns + BetweenColumns: tw.On, // Vertical lines between columns }, }, }), @@ -75,17 +75,16 @@ func GetMonitorInfo(httpClient *http.Client, apiKey string, monitorId string) er ) data := [][]string{ - {"ID",fmt.Sprintf("%d", monitor.ID)}, - {"Name",monitor.Name}, - {"Description",monitor.Description}, - {"Endpoint",monitor.URL}, - + {"ID", fmt.Sprintf("%d", monitor.ID)}, + {"Name", monitor.Name}, + {"Description", monitor.Description}, + {"Endpoint", monitor.URL}, } if monitor.Method != "" { data = append(data, []string{"Method", monitor.Method}) } - data = append(data, []string{"Frequency",monitor.Periodicity}) + data = append(data, []string{"Frequency", monitor.Periodicity}) data = append(data, []string{"Locations", strings.Join(monitor.Regions, ",")}) data = append(data, []string{"Active", fmt.Sprintf("%t", monitor.Active)}) data = append(data, []string{"Public", fmt.Sprintf("%t", monitor.Public)}) @@ -109,8 +108,9 @@ func GetMonitorInfo(httpClient *http.Client, apiKey string, monitorId string) er func GetMonitorInfoCmd() *cli.Command { monitorInfoCmd := cli.Command{ - Name: "info", - Usage: "Get monitor information", + Name: "info", + Usage: "Get a monitor information", + Description: "Fetch the monitor information. The monitor information includes details such as name, description, endpoint, method, frequency, locations, active status, public status, timeout, degraded after, and body. The body is truncated to 40 characters.", Action: func(ctx context.Context, cmd *cli.Command) error { monitorId := cmd.Args().Get(0) err := GetMonitorInfo(http.DefaultClient, cmd.String("access-token"), monitorId) diff --git a/internal/monitors/monitor_trigger.go b/internal/monitors/monitor_trigger.go index ddc82bb..96069b8 100644 --- a/internal/monitors/monitor_trigger.go +++ b/internal/monitors/monitor_trigger.go @@ -54,7 +54,8 @@ func MonitorTrigger(httpClient *http.Client, apiKey string, monitorId string) er func GetMonitorsTriggerCmd() *cli.Command { monitorsCmd := cli.Command{ Name: "trigger", - Usage: "Trigger a monitor test", + Usage: "Trigger a monitor execution", + Description: "Trigger a monitor execution on demand. This command allows you to launch your tests on demand.", UsageText: "openstatus monitors trigger [MonitorId] [options]", Flags: []cli.Flag{ &cli.StringFlag{ diff --git a/internal/monitors/monitors_list.go b/internal/monitors/monitors_list.go index 4373d64..9bc0249 100644 --- a/internal/monitors/monitors_list.go +++ b/internal/monitors/monitors_list.go @@ -56,6 +56,7 @@ func GetMonitorsListCmd() *cli.Command { monitorsListCmd := cli.Command{ Name: "list", Usage: "List all monitors", + Description: "List all monitors. The list shows all your monitors attached to your workspace. It displays the ID, name, and URL of each monitor.", UsageText: "openstatus monitors list [options]", Flags: []cli.Flag{ &cli.BoolFlag{ diff --git a/internal/run/run.go b/internal/run/run.go index 4637830..96f4d52 100644 --- a/internal/run/run.go +++ b/internal/run/run.go @@ -120,7 +120,7 @@ func RunCmd() *cli.Command { Aliases: []string{"r"}, Usage: "Run your synthetics tests", UsageText: "openstatus run[options]", - Description: "Run synthetic tests defined your config.openstatus.yaml", + Description: "Run the synthetic tests defined in the config.openstatus.yaml", Action: func(ctx context.Context, cmd *cli.Command) error { path := cmd.String("config") diff --git a/internal/whoami/whoami.go b/internal/whoami/whoami.go index b36dcdc..5bea130 100644 --- a/internal/whoami/whoami.go +++ b/internal/whoami/whoami.go @@ -48,7 +48,7 @@ func WhoamiCmd() *cli.Command { Name: "whoami", Aliases: []string{"w"}, UsageText: "openstatus whoami [options]", - Usage: "Get your current workspace information", + Usage: "Get your current workspace information, display the workspace name, slug, and plan", Action: func(ctx context.Context, cmd *cli.Command) error { fmt.Println("Your current workspace information") err := GetWhoamiCmd(http.DefaultClient, cmd.String("access-token"))