CLI Authentication
The Superflag CLI uses browser-based authentication with a localhost callback flow.
Login
Authenticate with your Superflag account:
What happens:
- Opens your browser to https://superflag.sh/cli/login
- You log in with your Superflag account
- Browser redirects to
http://localhost:3737/callback with your token
- CLI receives the token and stores it in
~/.superflag/credentials.json
- You’re authenticated!
Check Authentication Status
Shows your current user email and authentication status.
Shows both authentication and context (current app/env).
Logout
Clear your authentication token:
This deletes ~/.superflag/credentials.json.
Token Storage
Your authentication token is stored in:
~/.superflag/credentials.json
Format:
{
"token": "cli_...",
"email": "you@example.com"
}
Keep this file secure. Anyone with your token can manage your flags.
Troubleshooting
Port 3737 Already in Use
If port 3737 is already in use, the login flow will fail. Stop any process using port 3737 and try again:
lsof -ti:3737 | xargs kill -9
superflag login
Browser Doesn’t Open
If the browser doesn’t open automatically:
- Copy the URL shown in the terminal
- Open it manually in your browser
- Complete the login flow
Token Expired
If you get “Not authenticated” errors, log in again:
Security
- Tokens are scoped to your user account
- Tokens do not expire automatically
- You can revoke access by logging out and deleting credentials
- Tokens are stored locally and never transmitted except to Superflag APIs
Next Steps