Decision record

ADR-0011: The CLI signs in through the browser

Written by

ADR-0011: The CLI signs in through the browser and mints at exchange

Status: accepted · 2026-09-12

Context

Connecting an agent to a workspace was a settings page, a paste into a config file whose shape differs per agent, and a token that reaches the wrong workspace without anyone noticing — the endpoint is one URL for every workspace, and the token decides. One session lost most of an hour to exactly that, and nearly committed a token inside .mcp.json.

npx bladbase connect exists to make those mistakes impossible rather than documented. It needs a credential, and it starts with none. Three ways to get one were weighed.

  1. Ask for the token in the terminal. A person mints in settings and pastes. This is the escape hatch (--token), not the path: it keeps every step the command exists to remove.
  2. Ask for a password in the terminal. Never. Firebase Auth is the identity provider; the CLI is not a place a password should be typed.
  3. A browser round trip with a loopback listener — what gh, Vercel and Netlify do. The person signs in where they already sign in; the terminal gets a credential without seeing a password.

Within the third, what crosses the redirect matters. Sending the token itself puts a bearer credential in a browser URL, history and any proxy log. Sending a code that the terminal exchanges keeps the token off every surface but the one HTTPS response that delivers it.

Decision

The CLI opens /cli/authorize in the browser; the page issues a one-time code; the CLI exchanges the code, and the token is minted at that moment.

Consequences

Written and maintained by , who made this decision — about · GitHub.

← All decisions