Add command to check Firebase CLI authentication status without triggering reauth
Currently, the Firebase CLI does not provide a way to proactively check whether the user’s authentication state is still valid. Authentication validity is only discovered when running a command that requires auth, at which point the CLI may fail and instruct the user to run firebase login --reauth.
This makes it difficult to:
• Detect impending or current auth expiration ahead of time
• Build scripts or tooling that can validate environment readiness
• Provide a better UX in local development workflows
• Perform lightweight “health checks” without risking mid-command failure
Problem
There is no supported command such as:
• firebase login:status
• firebase auth:check
• or similar
The only way to determine auth validity today is to run a real command (e.g. firebase projects:list) and handle a failure, which is reactive and indirect.
Proposed Solution
Introduce a command that checks CLI authentication status without performing a project operation, for example:
firebase login:status
Possible behaviors:
• Exit code 0 if credentials are present and refreshable
• Exit code 1 if credentials are missing, expired, or require reauthentication
• Optional human-readable output, e.g.:
• “Authenticated (user@example.com)”
• “Authentication expired — run firebase login --reauth”
Optional enhancements:
• --json output for scripting
• Indicate auth method (user OAuth vs service account)
• Indicate whether silent refresh succeeded
Why this would be useful
• Improves developer experience
• Enables deterministic preflight checks in scripts
• Reduces surprise failures during deploys
• Aligns with similar tooling (gcloud auth list, aws sts get-caller-identity, etc.)
Scope clarification
This request is specifically about Firebase CLI authentication, not Firebase Auth sessions or Admin SDK behavior.
Alternative workaround (current)
Running a harmless command like firebase projects:list is currently the only way to infer auth state, but this is indirect and not ideal.