> setup & auth
Every wrangler session starts here: authenticate the CLI against your Cloudflare account, confirm you're pointed at the right account, and scaffold or wire up a project. These commands establish the credentials, config, and generated types that your later dev, deploy, and binding work builds on.
// setup & auth
7 commands$ wrangler login$ wrangler login --browser false$ wrangler whoami$ wrangler whoami --json$ wrangler init <name> -y$ wrangler init <name> --from-dash <worker-name>$ wrangler types// faq
Where does wrangler store my login, and how do I authenticate in CI?
`wrangler login` runs an interactive OAuth flow and caches a refreshable token under your OS config dir (e.g. ~/.config/.wrangler). CI and headless boxes should skip the browser entirely: set the CLOUDFLARE_API_TOKEN environment variable (and usually CLOUDFLARE_ACCOUNT_ID) and wrangler picks it up automatically.
What's the difference between `wrangler login` and a CLOUDFLARE_API_TOKEN?
`login` is an interactive OAuth grant that stores a refreshable credential for local dev. An API token is a static, scoped credential you export as an env var for automation. A CLOUDFLARE_API_TOKEN in the environment takes precedence over a cached OAuth login.
How often do I need to re-run `wrangler types`?
Whenever you add or change a binding (KV, R2, D1, vars, Hyperdrive, Queues...) or bump your compatibility date. Regenerate, then commit the resulting worker-configuration.d.ts so your editor and CI share the same Env types.