Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
docs cli (#2008)
Thibault Le Ouayab65fe6435db
diff --git a/apps/docs/src/content/docs/reference/cli-reference.mdx b/apps/docs/src/content/docs/reference/cli-reference.mdxindex f20e24d9e..9a483a0dd 100644--- a/apps/docs/src/content/docs/reference/cli-reference.mdx+++ b/apps/docs/src/content/docs/reference/cli-reference.mdx@@ -4,17 +4,24 @@ title: CLI Reference## CLI interface - openstatus-openstatus is a command line interface for managing your monitors and triggering your synthetics tests.--This is openstatus Command Line Interface, the openstatus.dev CLI.+Manage status pages, monitors, and incidents from the terminal.Usage:```bash-$ openstatus [COMMAND] [COMMAND FLAGS] [ARGUMENTS...]+$ openstatus [GLOBAL FLAGS] [COMMAND] [COMMAND FLAGS] [ARGUMENTS...]```-### `monitors` command+Global flags:++| Name | Description | Default value | Environment variables |+|------------------|---------------------------|:-------------:|:---------------------:|+| `--json` | Output results as JSON | `false` | *none* |+| `--no-color` | Disable colored output | `false` | *none* |+| `--quiet` (`-q`) | Suppress non-error output | `false` | *none* |+| `--debug` | Enable debug output | `false` | *none* |++### `monitors` command (aliases: `m`)Manage your monitors.@@ -28,9 +35,11 @@ $ openstatus [GLOBAL FLAGS] monitors [ARGUMENTS...]Create or update monitors.-> openstatus monitors apply [options]+> openstatus monitors apply+> openstatus monitors apply --config custom.yaml -y+> openstatus monitors apply --dry-run-Creates or updates monitors according to the openstatus configuration file.+Creates or updates monitors according to the OpenStatus configuration file. Compares your openstatus.yaml with the current state and applies changes.Usage:@@ -43,15 +52,59 @@ The following flags are supported:| Name | Description | Default value | Environment variables ||-----------------------------|-------------------------------------------------------|:-----------------:|:----------------------:|| `--config="…"` (`-c`) | The configuration file containing monitor information | `openstatus.yaml` | *none* |-| `--access-token="…"` (`-t`) | openstatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--auto-accept` (`-y`) | Automatically accept the prompt | `false` | *none* |+| `--dry-run` (`-n`) | Show what would be changed without applying | `false` | *none* |++### `monitors create` subcommand++Create monitors.++> openstatus monitors create+> openstatus monitors create --config custom.yaml -y++Create the monitors defined in the openstatus.yaml file.++Usage:++```bash+$ openstatus [GLOBAL FLAGS] monitors create [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|-------------------------------------------------------|:-----------------:|:----------------------:|+| `--config="…"` (`-c`) | The configuration file containing monitor information | `openstatus.yaml` | *none* |+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` || `--auto-accept` (`-y`) | Automatically accept the prompt | `false` | *none* |+### `monitors delete` subcommand++Delete a monitor.++> openstatus monitors delete MonitorID+> openstatus monitors delete 12345 -y++Usage:++```bash+$ openstatus [GLOBAL FLAGS] monitors delete [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|---------------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--auto-accept` (`-y`) | Automatically accept the prompt | `false` | *none* |### `monitors import` subcommandImport all your monitors.-> openstatus monitors import [options]+> openstatus monitors import+> openstatus monitors import --output monitors.yamlImport all your monitors from your workspace to a YAML file; it will also create a lock file to manage your monitors with 'apply'.@@ -65,16 +118,18 @@ The following flags are supported:| Name | Description | Default value | Environment variables ||-----------------------------|-----------------------------|:-----------------:|:----------------------:|-| `--access-token="…"` (`-t`) | openstatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` || `--output="…"` (`-o`) | The output file name | `openstatus.yaml` | *none* |### `monitors info` subcommandGet a monitor information.-> openstatus monitors info [MonitorID]+> openstatus monitors info MonitorID+> openstatus monitors info 12345+> openstatus monitors info 12345 --time-range 7d-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.+Fetch the monitor information including configuration, live status per region, and summary metrics.Usage:@@ -84,17 +139,19 @@ $ openstatus [GLOBAL FLAGS] monitors info [COMMAND FLAGS] [ARGUMENTS...]The following flags are supported:-| Name | Description | Default value | Environment variables |-|-----------------------------|-----------------------------|:-------------:|:----------------------:|-| `--access-token="…"` (`-t`) | openstatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| Name | Description | Default value | Environment variables |+|-----------------------------|----------------------------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--time-range="…"` | Time range for summary metrics (1d, 7d, 14d) | `1d` | *none* |### `monitors list` subcommandList all monitors.-> openstatus monitors list [options]+> openstatus monitors list+> openstatus monitors list --all-List all monitors. The list shows all your monitors attached to your workspace. It displays the ID, name, and URL of each monitor.+List all monitors. The list shows all your monitors attached to your workspace. It displays the ID, name, URL, and kind of each monitor.Usage:@@ -107,13 +164,14 @@ The following flags are supported:| Name | Description | Default value | Environment variables ||-----------------------------|-------------------------------------------|:-------------:|:----------------------:|| `--all` | List all monitors including inactive ones | `false` | *none* |-| `--access-token="…"` (`-t`) | openstatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |### `monitors trigger` subcommandTrigger a monitor execution.-> openstatus monitors trigger [MonitorId] [options]+> openstatus monitors trigger MonitorID+> openstatus monitors trigger 12345Trigger a monitor execution on demand. This command allows you to launch your tests on demand.@@ -127,15 +185,202 @@ The following flags are supported:| Name | Description | Default value | Environment variables ||-----------------------------|-----------------------------|:-------------:|:----------------------:|-| `--access-token="…"` (`-t`) | openstatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |++### `status-report` command (aliases: `sr`)++Manage status reports.++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-report [ARGUMENTS...]+```++### `status-report list` subcommand++List all status reports.++> openstatus status-report list+> openstatus status-report list --status investigating --limit 10++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-report list [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|--------------------------------------------------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--status="…"` | Filter by status (investigating, identified, monitoring, resolved) | | *none* |+| `--limit="…"` | Maximum number of reports to return (1-100) | `0` | *none* |++### `status-report info` subcommand++Get status report details.++> openstatus status-report info ReportID+> openstatus status-report info 12345++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-report info [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|-----------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |++### `status-report create` subcommand++Create a status report.++> openstatus status-report create --title "API Degradation" --status investigating --message "Investigating increased latency" --page-id 123++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-report create [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|------------------------------------------------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--title="…"` | Title of the status report | | *none* |+| `--status="…"` | Initial status (investigating, identified, monitoring, resolved) | | *none* |+| `--message="…"` | Initial message describing the incident | | *none* |+| `--page-id="…"` | Status page ID to associate with this report | | *none* |+| `--component-ids="…"` | Comma-separated page component IDs | | *none* |+| `--notify` | Notify subscribers about this status report | `false` | *none* |+| `--date="…"` | Date when the event occurred (RFC 3339 format, defaults to now) | | *none* |++### `status-report update` subcommand++Update status report metadata.++> openstatus status-report update ReportID [--title "New title"] [--component-ids id1,id2]++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-report update [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|-------------------------------------------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--title="…"` | New title for the report | | *none* |+| `--component-ids="…"` | Comma-separated page component IDs (replaces existing list) | | *none* |++### `status-report delete` subcommand++Delete a status report.++> openstatus status-report delete ReportID+> openstatus status-report delete 12345 -y++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-report delete [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|---------------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--auto-accept` (`-y`) | Automatically accept the prompt | `false` | *none* |++### `status-report add-update` subcommand++Add an update to a status report.++> openstatus status-report add-update ReportID --status resolved --message "Issue has been resolved"++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-report add-update [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|--------------------------------------------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--status="…"` | New status (investigating, identified, monitoring, resolved) | | *none* |+| `--message="…"` | Message describing what changed | | *none* |+| `--date="…"` | Date for the update (RFC 3339 format, defaults to now) | | *none* |+| `--notify` | Notify subscribers about this update | `false` | *none* |++### `status-page` command (aliases: `sp`)++Manage status pages.++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-page [ARGUMENTS...]+```++### `status-page list` subcommand++List all status pages.++> openstatus status-page list+> openstatus status-page list --limit 10++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-page list [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|-------------------------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--limit="…"` | Maximum number of pages to return (1-100) | `0` | *none* |++### `status-page info` subcommand++Get status page details.++> openstatus status-page info PageID+> openstatus status-page info 12345++Usage:++```bash+$ openstatus [GLOBAL FLAGS] status-page info [COMMAND FLAGS] [ARGUMENTS...]+```++The following flags are supported:++| Name | Description | Default value | Environment variables |+|-----------------------------|-----------------------------|:-------------:|:----------------------:|+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |### `run` command (aliases: `r`)-Run your synthetics tests.+Run your uptime tests.-> openstatus run [options]+> openstatus run+> openstatus run --config custom-config.yaml-Run the synthetic tests defined in the config.openstatus.yaml.+Run the uptime tests defined in the config.openstatus.yaml. The config file should be in the following format: tests: ids: - monitor-id-1 - monitor-id-2.Usage:@@ -148,15 +393,15 @@ The following flags are supported:| Name | Description | Default value | Environment variables ||-----------------------------|-----------------------------|:------------------------:|:----------------------:|| `--config="…"` | The configuration file | `config.openstatus.yaml` | *none* |-| `--access-token="…"` (`-t`) | openstatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |### `whoami` command (aliases: `w`)Get your workspace information.-> openstatus whoami [options]+> openstatus whoami-Get your current workspace information, display the workspace name, slug, and plan.+Get your current workspace information. Displays the workspace name, slug, and plan.Usage:@@ -168,4 +413,30 @@ The following flags are supported:| Name | Description | Default value | Environment variables ||-----------------------------|-----------------------------|:-------------:|:----------------------:|-| `--access-token="…"` (`-t`) | openstatus API Access Token | | `OPENSTATUS_API_TOKEN` |+| `--access-token="…"` (`-t`) | OpenStatus API Access Token | | `OPENSTATUS_API_TOKEN` |++### `login` command++Save your API token.++> openstatus login++Saves your OpenStatus API token for use in subsequent commands. Get your API token from the OpenStatus dashboard.++Usage:++```bash+$ openstatus [GLOBAL FLAGS] login [ARGUMENTS...]+```++### `logout` command++Remove saved API token.++> openstatus logout++Usage:++```bash+$ openstatus [GLOBAL FLAGS] logout [ARGUMENTS...]+```