Skip to content

Commit 0240e66

Browse files
chore: update readme
1 parent 9d4c832 commit 0240e66

2 files changed

Lines changed: 386 additions & 12 deletions

File tree

README.md

Lines changed: 94 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,118 @@
11
# OpenStatus CLI
22

3-
OpenStatus CLI is a command line interface for OpenStatus.
3+
Manage status pages, monitors, and incidents from the terminal.
44

55
## Installation
66

7+
### Homebrew
8+
79
```bash
810
brew install openstatusHQ/cli/openstatus --cask
911
```
1012

11-
#### Windows
13+
### macOS / Linux
14+
15+
```bash
16+
curl -fsSL https://raw.githubusercontent.com/openstatusHQ/cli/refs/heads/main/install.sh | bash
17+
```
18+
19+
### Windows
20+
1221
```powershell
1322
iwr https://raw.githubusercontent.com/openstatusHQ/cli/refs/heads/main/install.ps1 | iex
1423
```
1524

16-
#### macOS
25+
## Quick Start
26+
1727
```bash
18-
curl -fsSL https://raw.githubusercontent.com/openstatusHQ/cli/refs/heads/main/install.sh| bash
28+
# Authenticate with your API token
29+
openstatus login
30+
31+
# List your monitors
32+
openstatus monitors list
33+
34+
# Get detailed info on a monitor (live status + latency percentiles)
35+
openstatus monitors info 123
36+
37+
# Trigger an on-demand check
38+
openstatus monitors trigger 123
39+
40+
# Report an incident
41+
openstatus status-report create --title "API degradation" --status investigating --page-id 1
42+
43+
# Run synthetic tests from config
44+
openstatus run
1945
```
2046

21-
#### Linux
47+
## Commands
48+
49+
| Command | Alias | Description |
50+
|---------|-------|-------------|
51+
| `login` / `logout` | | Authenticate with the OpenStatus API |
52+
| `whoami` | `w` | Show current workspace info |
53+
| `monitors` | `m` | List, inspect, trigger, import, and apply monitors |
54+
| `status-report` | `sr` | Create and manage incident reports |
55+
| `maintenance` | `mt` | Schedule and manage maintenance windows |
56+
| `status-page` | `sp` | View status pages and components |
57+
| `notification` | `n` | View notification channels |
58+
| `run` | `r` | Run synthetic tests across global regions |
59+
| `terraform generate` | `tf gen` | Export workspace resources to Terraform HCL |
60+
61+
### Global Flags
62+
63+
| Flag | Description |
64+
|------|-------------|
65+
| `--json` | Machine-readable JSON output |
66+
| `--quiet`, `-q` | Suppress non-error output |
67+
| `--debug` | Print HTTP request details to stderr |
68+
| `--no-color` | Disable colored output |
69+
| `--access-token`, `-t` | Override API token |
70+
71+
## Monitors as Code
72+
73+
Define monitors declaratively in YAML and sync them with `apply`:
74+
2275
```bash
23-
curl -fsSL https://raw.githubusercontent.com/openstatusHQ/cli/refs/heads/main/install.sh | bash
76+
# Export existing monitors to openstatus.yaml + openstatus.lock
77+
openstatus monitors import
78+
79+
# Preview changes
80+
openstatus monitors apply --dry-run
81+
82+
# Apply changes
83+
openstatus monitors apply
2484
```
2585

86+
## Terraform Export
87+
88+
Generate Terraform HCL for your entire workspace:
89+
90+
```bash
91+
openstatus terraform generate --output-dir ./terraform
92+
```
93+
94+
This creates `provider.tf`, `monitors.tf`, `notifications.tf`, `status_pages.tf`, and `imports.tf` ready for `terraform plan`.
95+
96+
## Authentication
97+
98+
The CLI resolves your API token in this order:
99+
100+
1. `--access-token` / `-t` flag
101+
2. `OPENSTATUS_API_TOKEN` environment variable
102+
3. Saved token at `~/.config/openstatus/token` (written by `openstatus login`)
103+
26104
## Development
27105

28-
### Generate Documentation
106+
### Run Tests
29107

30-
Run this command to generate the documentation:
108+
```bash
109+
go test -race ./...
110+
```
111+
112+
### Generate Documentation
31113

32114
```bash
33-
go run cmd/docs/docs.go
34-
cd docs
35-
pandoc -s -t man openstatus-docs.md -o openstatus.1
36-
```
115+
go run cmd/docs/docs.go
116+
cd docs
117+
pandoc -s -t man openstatus-docs.md -o openstatus.1
118+
```

0 commit comments

Comments
 (0)