Show HN: Cfswitch – Switch between multiple Cloudflare accounts in Wrangler Cfswitch, a new CLI tool, enables seamless switching between multiple Cloudflare accounts in Wrangler by using named auth profiles injected as environment variables. Built for AI agents and CI pipelines, it eliminates the need for repeated logout/login steps during deployments. The tool is fully non-interactive, has no runtime dependencies, and supports commands like wizard, add, and wrangler execution. Switch Cloudflare / wrangler auth between multiple accounts. Built for AI agents and CI first, humans second. wrangler login only holds one OAuth session at a time. If you or your coding agent juggle several Cloudflare accounts, every deploy becomes a logout/login dance. cfswitch fixes this with named auth profiles injected as environment variables CLOUDFLARE API TOKEN / CLOUDFLARE ACCOUNT ID , which wrangler always honors over its OAuth login, per Cloudflare's docs https://developers.cloudflare.com/workers/wrangler/system-environment-variables/ . Design rules: - It never prompts. Every command is fully non-interactive, so any agent, script, or CI job can run it safely. - No runtime dependencies. One bundled file, Node ≥ 18, so npx cfswitch-cli runs without installing anything. --json on every read command, clean exit codes, errors on stderr.- Token values are only ever printed by cfswitch env , whose whole job is printing them. npm install -g cfswitch-cli installs the cfswitch command or: bun add -g cfswitch-cli or zero-install: npx cfswitch-cli help cfswitch wizard This opens the Cloudflare dashboard with a pre-filled token Workers, Pages, KV, R2, D1, routes and watches your clipboard. You log in and click Continue to summary, Create Token, then Copy. The moment the token hits your clipboard, cfswitch verifies it, looks up which accounts it can reach, and saves a pinned profile for each. Switch dashboard accounts and repeat; Ctrl-C when done. Use cfswitch wizard --print-url if you just want the pre-filled URL say, to open on another machine . Create an API token for each account at dash.cloudflare.com/profile/api-tokens https://dash.cloudflare.com/profile/api-tokens the "Edit Cloudflare Workers" template covers Workers + Pages deploys . Then: add profiles token via flag, stdin, or CFSWITCH TOKEN env; never a prompt cfswitch add personal --token cf xxx --account-id 6f9x... echo "$WORK TOKEN" | cfswitch add work --token-stdin sanity-check them against the Cloudflare API cfswitch verify work cfswitch accounts work list account IDs this token can reach run wrangler as any account, from any directory cfswitch wrangler -p personal whoami cfswitch wrangler -p work deploy cfswitch wrangler -p work pages deploy out or set a default and stop passing -p cfswitch use work cfswitch wrangler d1 list | Command | What it does | |---|---| wizard --name