sincecutoff.com
← all changes

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 --json
if wrangler whoami --json > /dev/null 2>&1; then echo "Authenticated" else echo "Not authenticated" fi

WHY 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

Check the installed version and the source before using it. Entry JSON

Report a problem with this card