Profiles
Profiles let you target different Cloudflare accounts from the same project
without rewriting wrangler.jsonc or shuffling .env files. They sit alongside
your config — wrangler-deploy.config.ts and wrangler.jsonc files stay
untouched. Profiles only change which credentials are used at runtime.
Layout
Section titled “Layout”~/.wrangler-deploy/ config.json # non-sensitive metadata credentials/<profile>/cloudflare.json # secret token, chmod 600Override the location with WD_HOME.
Configure a profile
Section titled “Configure a profile”# Interactivewd configure --profile prod
# Non-interactive (CI / scripts)wd configure --profile prod \ --method api-token \ --account-id <CLOUDFLARE_ACCOUNT_ID> \ --account-name "Acme Production" \ --yesSave a token
Section titled “Save a token”# Prompts for the tokenwd login --profile prod
# Or pass explicitlywd login --profile prod --token cf_pat_xxxNeed a token? wd util create-cf-token prints the required scopes and a
deeplink to the Cloudflare dashboard’s token-creation page with the right
boxes pre-checked.
Pick a profile per command
Section titled “Pick a profile per command”In order of precedence:
--profile prodflagWD_PROFILE=prodenv varCLOUDFLARE_PROFILE=prodenv vardefaultprofile
wd plan --stage staging --profile prodWD_PROFILE=prod wd deploy --stage stagingWhen a profile resolves, applyProfileToEnv injects
CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID into the process — but
never overrides values already present. Explicit env vars set by CI
always win.
Inspect
Section titled “Inspect”wd profile list # text table, marks the active profilewd profile list --json # machine-readableTear down
Section titled “Tear down”wd logout --profile prod # delete the credential filewd logout --profile prod --purge # also remove the entry from config.json