{
  "slug": "wrangler-auth-profiles-bind-oauth-logins-to-directories-d7a985ab01d2",
  "title": "wrangler auth profiles bind OAuth logins to directories",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-30T16:38:09.000Z",
  "announced_at": "2026-06-30T16:38:09.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When projects need separate Cloudflare OAuth logins, create a named profile and bind it to each project directory; bindings apply to subdirectories. Use `--profile` for a one-command override, and account ID settings remain respected.",
    "examples": [
      "wrangler auth create <name>\nwrangler auth activate <name> <directory>",
      "wrangler auth list\nwrangler auth deactivate <directory>\nwrangler auth delete <name>",
      "wrangler <command> --profile <name>"
    ],
    "gotchas": [
      "Version: wrangler@4.106.0",
      "<name> (required): Profile name to create, activate, or delete; creation starts OAuth login.",
      "[dir]: Directory to bind or deactivate; activation defaults to the current working directory, and the binding applies to subdirectories.",
      "--profile <name>: Select a profile for one command run without changing directory bindings.",
      "CLOUDFLARE_API_TOKEN: When set, takes precedence over profiles.",
      "CLOUDFLARE_ACCOUNT_ID: Account ID setting respected when resolving the target account.",
      "account_id: Wrangler configuration setting respected when resolving the target account.",
      "Prerequisite: Creating a profile starts an OAuth flow; choose which accounts the profile may reach.",
      "`wrangler auth create <name>` creates or re-authenticates a named profile via OAuth.",
      "`wrangler auth activate <name> [dir]` defaults to cwd; subdirectories inherit the profile.",
      "`CLOUDFLARE_API_TOKEN` takes precedence over profiles when set.",
      "Account ID settings via `CLOUDFLARE_ACCOUNT_ID` or Wrangler config continue to be respected.",
      "Docs conflict: The documentation was updated Sep 17, 2026, after Wrangler 4.106.0. It says that when CLOUDFLARE_API_TOKEN is set, profile create, activate, deactivate, and delete commands cannot be used; the release note states token precedence but does not mention this restriction."
    ]
  },
  "why_it_matters": "Use separate Wrangler OAuth logins for projects in different directories while retaining existing token and account settings.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.106.0",
    "https://7617740f.previews.developers.cloudflare.com/workers/wrangler/profiles/"
  ],
  "rank": 0.98049,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-2841bfddc8d257e6-2:gate",
    "evidence_hash": "630dc99354ee14d0aca270af3150e2f48682af60af86551fa937bfdb7badd326"
  },
  "review": {
    "draft_hash": "626368ddaeee32b391532acc2cf4855991ae62d39ed1108734a378e0acd72fb0",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.79 (>= 0.6 needed)."
  }
}
