diff --git a/.goreleaser.yaml b/.goreleaser.yaml index c0c9f8e..e17d5e7 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -13,7 +13,6 @@ before: # You may remove this if you don't use go modules. - go mod tidy - builds: - env: @@ -28,6 +27,8 @@ builds: archives: + - files: + - docs/* - format: tar.gz # this name template makes the OS and Arch compatible with the results of `uname`. name_template: >- @@ -64,6 +65,8 @@ brews: description: "OpenStatus CLI" test: | system "#{bin}/openstatus --help" + extra_install: | + man1.install "docs/openstatus-docs" repository: # Repository owner. # diff --git a/docs/openstatus-docs b/docs/openstatus-docs new file mode 100644 index 0000000..96662f3 --- /dev/null +++ b/docs/openstatus-docs @@ -0,0 +1,87 @@ +.\" Automatically generated by Pandoc 3.7.0.2 +.\" +.TH "" "" "" "" +.SH CLI +.SH NAME +openstatus \- This is OpenStatus Command Line Interface +.SH SYNOPSIS +openstatus +.SH DESCRIPTION +OpenStatus is a command line interface for managing your monitors and +triggering your synthetics tests. +.PP +Please report any issues at +https://github.com/openstatusHQ/cli/issues/new +.PP +\f[B]Usage\f[R]: +.IP +.EX +openstatus [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...] +.EE +.SH COMMANDS +.SS monitors +Manage your monitors +.SS create +Create monitors (beta) +.RS +.PP +openstatus monitors create [options] +.RE +.PP +\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 +.PP +\f[B]\(enconfig\f[R]=\(lq\(lq: The configuration file containing monitor +information (default: openstatus.yaml) +.SS delete +Delete a monitor +.RS +.PP +openstatus monitors delete [MonitorID] [options] +.RE +.PP +\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 info +Get monitor information +.PP +\f[B]\(enaccess\-token, \-t\f[R]=\(lq\(lq: OpenStatus API Access Token +.SS list +List all monitors +.RS +.PP +openstatus monitors list [options] +.RE +.PP +\f[B]\(enaccess\-token, \-t\f[R]=\(lq\(lq: OpenStatus API Access Token +.PP +\f[B]\(enall\f[R]: List all monitors including inactive ones +.SS trigger +Trigger a monitor test +.RS +.PP +openstatus monitors trigger [MonitorId] [options] +.RE +.PP +\f[B]\(enaccess\-token, \-t\f[R]=\(lq\(lq: OpenStatus API Access Token +.SS run, r +Run your synthetics tests +.RS +.PP +openstatus run[options] +.RE +.PP +\f[B]\(enaccess\-token, \-t\f[R]=\(lq\(lq: OpenStatus API Access Token +.PP +\f[B]\(enconfig\f[R]=\(lq\(lq: The configuration file (default: +config.openstatus.yaml) +.SS whoami, w +Get your current workspace information +.RS +.PP +openstatus whoami [options] +.RE +.PP +\f[B]\(enaccess\-token, \-t\f[R]=\(lq\(lq: OpenStatus API Access Token diff --git a/docs/openstatus-docs.md b/docs/openstatus-docs.md new file mode 100644 index 0000000..0d41661 --- /dev/null +++ b/docs/openstatus-docs.md @@ -0,0 +1,91 @@ +# CLI + +# NAME + +openstatus - This is OpenStatus Command Line Interface + +# SYNOPSIS + +openstatus + +# DESCRIPTION + +OpenStatus is a command line interface for managing your monitors and triggering your synthetics tests. + +Please report any issues at https://github.com/openstatusHQ/cli/issues/new + +**Usage**: + +``` +openstatus [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...] +``` + +# COMMANDS + +## monitors + +Manage your monitors + +### create + +Create monitors (beta) + +>openstatus monitors create [options] + +**--access-token, -t**="": OpenStatus API Access Token + +**--auto-accept, -y**: Automatically accept the prompt + +**--config**="": The configuration file containing monitor information (default: openstatus.yaml) + +### delete + +Delete a monitor + +>openstatus monitors delete [MonitorID] [options] + +**--access-token, -t**="": OpenStatus API Access Token + +**--auto-accept, -y**: Automatically accept the prompt + +### info + +Get monitor information + +**--access-token, -t**="": OpenStatus API Access Token + +### list + +List all monitors + +>openstatus monitors list [options] + +**--access-token, -t**="": OpenStatus API Access Token + +**--all**: List all monitors including inactive ones + +### trigger + +Trigger a monitor test + +>openstatus monitors trigger [MonitorId] [options] + +**--access-token, -t**="": OpenStatus API Access Token + +## run, r + +Run your synthetics tests + +>openstatus run[options] + +**--access-token, -t**="": OpenStatus API Access Token + +**--config**="": The configuration file (default: config.openstatus.yaml) + +## whoami, w + +Get your current workspace information + +>openstatus whoami [options] + +**--access-token, -t**="": OpenStatus API Access Token diff --git a/go.mod b/go.mod index e90f753..9e298ef 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( ) require ( + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/knadh/koanf/maps v0.1.2 // indirect @@ -26,6 +27,8 @@ require ( github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 // indirect github.com/olekukonko/ll v0.0.8 // indirect github.com/rivo/uniseg v0.2.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/urfave/cli-docs/v3 v3.0.0-alpha6 // indirect golang.org/x/sys v0.26.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 546eaee..c47c19b 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -42,6 +44,8 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rodaine/table v1.3.0 h1:4/3S3SVkHnVZX91EHFvAMV7K42AnJ0XuymRR2C5HlGE= github.com/rodaine/table v1.3.0/go.mod h1:47zRsHar4zw0jgxGxL9YtFfs7EGN6B/TaS+/Dmk4WxU= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -51,6 +55,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/urfave/cli-docs/v3 v3.0.0-alpha6 h1:w/l/N0xw1rO/aHRIGXJ0lDwwYFOzilup1qGvIytP3BI= +github.com/urfave/cli-docs/v3 v3.0.0-alpha6/go.mod h1:p7Z4lg8FSTrPB9GTaNyTrK3ygffHZcK3w0cU2VE+mzU= github.com/urfave/cli/v3 v3.0.0-alpha9.2 h1:CL8llQj3dGRLVQQzHxS+ZYRLanOuhyK1fXgLKD+qV+Y= github.com/urfave/cli/v3 v3.0.0-alpha9.2/go.mod h1:FnIeEMYu+ko8zP1F9Ypr3xkZMIDqW3DR92yUtY39q1Y= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=