Skip to Content
incidents-cli

πŸ“œ Scripting

One-shot output with incidents list, JSON records, the services list and the exit codes.

incidents list

incidents list prints the status once and exits. Each service is one line, as the interactive list draws it: the name, the status, how long the trouble has run, then the headline. The declared-status note and the hint for more follow on lines of their own.

  GitHub      ● minor  1h 12m  Elevated API errors
  Cloudflare  ● ok
  npm         ● ok

  Declared status only: green is not proof your calls work.
  incidents list <service> for detail.

With a service id or alias it prints that service in full: its name on the first line, what it declares and where, then its open incidents and its components as two tables, and its history.

incidents list
incidents list github

The same static output is what incidents and incidents <service> print when there is no terminal on stdin or stdout, or CI is set. Colour and links are used only when stdout is a terminal and NO_COLOR is unset; links are OSC 8 hyperlinks, which terminals without support print as plain text.

JSON

Add --json to any form for JSON records. It never opens the interactive view.

incidents list --json
incidents list github --json

incidents list --json prints an array, worst first. With a service, it prints one record with its history loaded.

{
  "id": "github",
  "name": "GitHub",
  "url": "https://www.githubstatus.com",
  "kind": "statuspage",
  "fetched": "ok",
  "indicator": "minor",
  "description": "Partially Degraded Service",
  "components": [{ "name": "API", "status": "degraded_performance" }],
  "active": [
    {
      "title": "Elevated API errors",
      "link": "https://stspg.io/abc",
      "date": "2026-01-01T10:00:00Z",
      "impact": "minor"
    }
  ],
  "recent": [],
  "upcoming": [],
  "historyLoaded": false,
  "historyFailed": false,
  "note": ""
}
FieldMeaning
kindstatuspage, rss, slack, aws or link
fetchedok, or failed when the page could not be read
indicatorcritical, major, unknown, minor, maintenance, none or link, worst first in that order
descriptionThe vendor's own summary line
componentsComponents with their raw vendor status; operational ones are included
activeIncidents open now
recentPast incidents, newest first; empty until history is loaded
upcomingScheduled maintenance still to come; empty until history is loaded
historyLoadedtrue once history was requested for this record
historyFailedtrue when the history feed could not be read, so an empty recent claims nothing
noteThe service's configured note, or an empty string

unknown is the JSON name for what the screen shows as ? unreadable: the page could not be read. It sorts above every healthy row and fails the exit code.

For example, to list only the services in trouble:

incidents list --json | jq -r '.[] | select(.indicator != "none" and .indicator != "link" and .indicator != "maintenance") | .id'

Exit codes

CodeMeaning
0All clear: none, maintenance and link count as clear
1Something is degraded, or a page could not be read
2Usage: an unknown service, flag or value, or a bad config

A typo is never read as an outage: every usage error exits 2, never 1. incidents --help lists the codes too. The interactive view and incidents watch exit 0 when stopped. With no services configured, incidents list prints No services configured. and exits 0.

if ! incidents list >/dev/null; then
  echo "a vendor is declaring trouble"
fi

incidents services

incidents services prints the configured services, one per line, as tab-separated id, name and aliases (comma-separated). It is the quickest way to see which ids and aliases incidents <service> accepts.

incidents services | cut -f1