Verify authentication in a CI script

setup & auth

// what it does

Emits machine-readable auth info and, crucially, exits non-zero when you're not authenticated — ideal as a preflight guard in a CI job before running deploy. Pipe it to jq to pull out the account_id programmatically.

// shell

$ wrangler whoami --json

// gotcha

Because it exits non-zero on missing or invalid credentials, run it early to fail fast rather than discovering a bad CLOUDFLARE_API_TOKEN halfway through a deploy.