Skip to main content

Troubleshooting CLI Authentication Errors

"Authentication required"

# Check auth status
surestage auth status

# Re-login
surestage auth login

"Token expired"

# Refresh token
surestage auth refresh

# If refresh fails, re-login
surestage auth login

"Invalid API key"

  1. Verify the key hasn't been revoked in the dashboard
  2. Check the environment variable is set correctly:
    echo $SURESTAGE_API_KEY
  3. Generate a new key if needed

Browser Not Opening for Login

If the CLI can't open a browser:

# Manual auth - copies URL to clipboard
surestage auth login --no-browser

Then paste the URL into your browser manually.