wrangler whoami adds machine-readable JSON output
Introduced 2026-02-12 · score 0.98
HOW TO USE IT
When a shell script needs to check Wrangler authentication without parsing text, run `wrangler whoami --json` and branch on its exit status; unauthenticated runs exit non-zero and output `{"loggedIn":false}`.
wrangler whoami --jsonif wrangler whoami --json > /dev/null 2>&1; then
echo "Authenticated"
else
echo "Not authenticated"
fiWHY THIS HELPS
Check Wrangler authentication status in a shell script without parsing text output.
REQUIREMENTS AND LIMITATIONS
- Version: 4.65.0
- --json (required): Boolean flag; default false. Return user information as JSON. Exits non-zero if not authenticated.
- When the user is not authenticated, the command exits with a non-zero status code and outputs `{"loggedIn":false}`.
FIRST-PARTY EVIDENCE
- https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.65.0
- https://developers.cloudflare.com/workers/wrangler/commands/general/
Check the installed version and the source before using it. Entry JSON