Log in on a headless server or authenticate CI

setup & auth

// what it does

On a remote box or over SSH, `--browser false` stops wrangler from auto-launching a browser and instead prints the OAuth URL for you to open manually. For fully non-interactive CI, skip login entirely and set the CLOUDFLARE_API_TOKEN environment variable — wrangler uses it automatically.

// shell

$ wrangler login --browser false

// gotcha

The OAuth callback still needs to reach the temporary local server on localhost:8976; if that port is taken or unreachable, override it with `--callback-port` / `--callback-host`. A CLOUDFLARE_API_TOKEN in the environment always wins over a cached OAuth login.