Skip to content

Add gh uptime to report GitHub service status - #14094

Open
seanturner83 wants to merge 1 commit into
cli:trunkfrom
seanturner83:feat/uptime-command
Open

Add gh uptime to report GitHub service status#14094
seanturner83 wants to merge 1 commit into
cli:trunkfrom
seanturner83:feat/uptime-command

Conversation

@seanturner83

Copy link
Copy Markdown

What

Adds gh uptime: a command that reports the operational status of GitHub's
services from the public status page (https://www.githubstatus.com).

$ gh uptime
✓ All Systems Operational

  ✓ Git Operations         operational
  ✓ API Requests           operational
  ✓ Actions                operational
  ...

It queries the Statuspage summary API — not api.github.com — and sends no
authentication, so it works when your token is unset, and (the point) when the
API itself is degraded. The gh auth token is never sent to the third-party host.

Why

Partly for fun, but there's a real use case: holding automation until an
incident clears, then resuming.
During an Actions outage you currently have to
poll githubstatus.com by hand. With this you can let a script wait it out:

# wait out an Actions outage, then kick off a workflow
gh uptime --component Actions --watch && gh workflow run ci.yml

Flags aimed at scripting:

  • --json / --jq — machine-readable output (gh uptime -c Actions --jq .operational → a bare bool)
  • --component <name> — scope to a single service (e.g. Actions)
  • --exit-code — non-zero exit when the target is not operational, so it composes with &&
  • --watch / --interval — poll until the target returns to operational (min 5s to respect the status page)

Notes

  • No new dependencies; uses the existing cmdutil/iostreams/httpmock machinery.
  • Auth is disabled for the command (DisableAuthCheck) since the status page is public.
  • Non-service rows the status page carries (e.g. the "Visit www.githubstatus.com…" link) are filtered out.
  • Unit tests cover flag parsing, all-operational vs degraded rendering, --exit-code, component scoping, unknown component, and --json export — all via httpmock, no network.

Happy to adjust naming/scope — I picked uptime to avoid colliding with the existing gh status (notifications/activity).

🤖 Generated with Claude Code

`gh uptime` reports the operational status of GitHub's services from the
public status page at https://www.githubstatus.com. It queries the Statuspage
summary API (not api.github.com) with no authentication, so it works even when
your token is unset or when the API itself is degraded.

Beyond a human-readable overview, it is built for automation:

  - `--json`/`--jq` for machine-readable output
  - `--component <name>` to scope to a single service (e.g. Actions)
  - `--exit-code` to exit non-zero when the target is not operational
  - `--watch` to poll until the target returns to operational

Together these let a script wait out an incident and then resume, e.g.:

    gh uptime --component Actions --watch && gh workflow run ci.yml

The command never sends the gh auth token to the third-party status host.
@seanturner83
seanturner83 requested a review from a team as a code owner August 6, 2026 19:31
@seanturner83
seanturner83 requested a review from sergiou87 August 6, 2026 19:31
@giaki3003

Copy link
Copy Markdown

LGTM 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants