Supabase Login
Authenticate with the Supabase CLI to manage your project from the terminal.
Using Cursor, Windsurf, or AI Tools?
Manual Setup (Browser Login)
If you're setting up manually in a terminal, the simplest method is browser-based login:
supabase loginThis opens your browser to authenticate. Once approved, you'll be logged in.
AI-Assisted Setup (Access Token)
When using AI tools like Cursor or Claude, you need to provide an access token because these tools cannot open browsers.
Step 1: Generate an Access Token
- Go to supabase.com/dashboard
- Click your profile icon in the top-right corner
- Select "Access Tokens" from the dropdown
- Click "Generate New Token"
- Give it a name (e.g., "CLI Access")
- Copy the generated token immediately (you won't see it again)
Keep Your Token Secret
Step 2: Login with Token
Use the --token flag:
supabase login --token YOUR_ACCESS_TOKENReplace YOUR_ACCESS_TOKEN with the token you copied.
Verify Login
Confirm you're logged in by listing your projects:
supabase projects listYou should see a list of your Supabase projects. If you get an authentication error, try logging in again.
Troubleshooting
"Token is invalid or expired"
Generate a new token from the Supabase dashboard. Tokens can expire or be revoked.
"Browser didn't open"
If running in a headless environment or AI tool, use the token-based login method instead.
