Workers - Work across multiple accounts with Wrangler auth profiles
Cloudflare has introduced auth profiles for its Wrangler CLI, enabling developers to manage multiple Cloudflare accounts more efficiently. A profile is a named OAuth login that is bound to a specific directory. When commands are run in that directory or its subdirectories, Wrangler automatically uses the associated account, removing the need to repeatedly run `wrangler login` when switching contexts. This feature is particularly useful for agencies that need to keep separate logins for each client, or for developers who want to separate staging and production environments into different accounts. Profiles can be paired with an `account_id` in the Wrangler configuration file to prevent commands from accidentally reaching the wrong account. To create a profile, users run `wrangler auth create <profile-name>` and then activate it with `wrangler auth activate <profile-name> <directory>`. For one-off commands, the `--profile` flag allows running a single command with a specific profile, e.g., `wrangler deploy --profile personal`. In CI and other automated environments, the `CLOUDFLARE_API_TOKEN` environment variable still takes precedence over all profiles. The full command reference and resolution order are available in the Cloudflare documentation.
Auth profiles eliminate manual account switching in Wrangler, reducing errors and streamlining multi-account workflows.