Better Stack CLI

The Better Stack CLI, betterstack, runs the Better Stack API from your terminal. It covers monitors, incidents, on-call, status pages, telemetry, dashboards, error tracking and the rest of the Better Stack API.

Install the CLI

macOS and Linux Windows
curl -fsSL https://betterstack.sh | sh
irm https://betterstack.sh/install.ps1 | iex

Sign in

Sign in with your browser
betterstack signin

Once signed in, the CLI can view and change everything your role allows in the web app.

Run your first command

Start with what's happening right now: your latest incidents.

List incidents
betterstack incident list

Open one to see its cause, who acknowledged it and the failing check's response.

Get an incident
betterstack incident get 123456789

Then see who's on call to handle it.

See who's on call
betterstack on-call-schedule list

To catch the next outage earlier, add a monitor.

Create a monitor
betterstack monitor create --monitor-type status --url https://example.com

Look at your logs next. tail follows a source as lines arrive.

Follow logs
betterstack tail 123456 -f

console opens a SQL console over the same source.

Query logs with SQL
betterstack console 123456 --start-time now-24h

Every list comes as a table. Add --json for scripts.

Print JSON
betterstack incident list --json

Add --help to list every command, what it does and how to use it.

Get help
betterstack --help
betterstack monitor create --help

Connect your AI assistant

betterstack mcp install adds the Better Stack MCP server to Claude Code, Codex, OpenCode or Cursor.

Move from the old Terraform providers

betterstack terraform migrate moves Terraform state from the better-uptime and logtail providers to the betterstack provider. Follow the steps on the Terraform page.

Authentication

Sign in to Better Stack in your browser. The sign-in is saved on your computer, in the keychain on macOS and in a file in your user folder on Linux and Windows. To use an API token instead, set the BETTERSTACK_API_TOKEN environment variable to a global API token from Better Stack β†’ API tokens β†’ Global tokens

  • betterstack whoami: Show who is signed in and the teams they can access.
  • betterstack signout: Sign out and remove the saved sign-in.
  • betterstack signin: Sign in to Better Stack.

Install location and updates

It installs without asking, into ~/.local/bin on macOS and Linux, /usr/local/bin for root, and %LOCALAPPDATA%\Programs\BetterStack on Windows. The CLI picks up new commands on its own as soon as they're published, and says once a day when a newer CLI is out. Run betterstack update to update it.