betterstack-clilisted
Install: claude install-skill abdullahkhawer/devops-skills
# Better Stack CLI Skill
Use the instance and rules below when constructing all Better Stack API commands.
## Configuration
Update the table below with your Better Stack credential file paths:
| Environment | Token File | Team |
|---|---|---|
| Production | `~/.betterstack/prod.token` | `<your-prod-team>` |
| Staging | `~/.betterstack/staging.token` | `<your-staging-team>` |
If the target environment is unclear, ask the user before running any command.
## Prerequisites (one-time setup by user)
Generate a Better Stack API token (**Settings → API tokens**) for each environment and save it to the corresponding token file. Never print or display token values. Do not perform these steps yourself.
```bash
mkdir -p ~/.betterstack && echo "<your-api-token>" > <TOKEN_FILE> && chmod 600 <TOKEN_FILE>
```
## Command Format
```bash
curl -s -H "Authorization: Bearer $(cat <TOKEN_FILE>)" \
"https://<your-betterstack-api-host>/api/v<version>/<endpoint>" | jq .
```
Logs querying and Uptime/Incidents management use different API hosts — confirm the correct one for the operation with the user if unsure (`telemetry API` vs `Uptime API`).
## Available API Endpoints
### Read-only (safe, no confirmation needed)
| Endpoint | Method | Description |
|---|---|---|
| `/api/v2/monitors` | GET | List uptime monitors |
| `/api/v2/monitors/<id>` | GET | Get a specific monitor |
| `/api/v2/incidents` | GET | List incidents |
| `/api/v1/heartbeats` | GET | List heartbeat checks |
| `/api/v1/qu