Wrangler commands
Use wrangler flagship to manage Flagship apps and feature flags from the command line. Every wrangler flagship flags command takes the app ID as the first argument. Most subcommands then take a flag key, for example wrangler flagship flags get <APP_ID> <KEY>. List-style commands, such as wrangler flagship flags list <APP_ID>, take only the app ID.
wrangler flagship calls the Cloudflare API. Authenticate Wrangler before running commands:
wrangler loginFor automation, set CLOUDFLARE_API_TOKEN to an API token with the appropriate Flagship permissions.
| Permission | Use it for |
|---|---|
flagship:read | Listing apps, getting apps, listing flags, inspecting flags, evaluating flags, and reading changelogs. |
flagship:write | Creating apps, updating apps, deleting apps, creating flags, updating flags, changing defaults, rollouts, splits, enable/disable, and deleting flags. |
Most commands that modify an existing flag first read the current flag and then write back the updated definition. For those workflows, grant both flagship:read and flagship:write.
Add a Flagship binding to your Worker project so your Worker code can evaluate flags with low latency at runtime:
{ "$schema": "./node_modules/wrangler/config-schema.json", "flagship": [ { "binding": "FLAGS", "app_id": "<APP_ID>" } ]}[[flagship]]binding = "FLAGS"app_id = "<APP_ID>"Create a boolean flag, evaluate it for a user, and disable it as a kill switch:
# With no variations, Wrangler creates on=true, off=false,# and serves off by default.wrangler flagship flags create <APP_ID> new-checkout
# Evaluate the flag for a user.wrangler flagship flags evaluate <APP_ID> new-checkout --targeting-key user-42
# Disable the flag instantly. Disabled flags always serve their default variation.wrangler flagship flags disable <APP_ID> new-checkoutApps group related flags. A common pattern is one app per service, Worker, or product surface.
| Task | Command |
|---|---|
| Create app | wrangler flagship apps create <NAME> |
| List apps | wrangler flagship apps list |
| Get app | wrangler flagship apps get <APP_ID> |
| Rename app | wrangler flagship apps update <APP_ID> --name <NAME> |
| Delete app | wrangler flagship apps delete <APP_ID> |
wrangler flagship apps ls is an alias for apps list. wrangler flagship apps rm is an alias for apps delete.
wrangler flagship apps list follows pagination automatically and displays all apps in the account.
Creating an app returns the app ID and shows the binding snippet to add to your Wrangler configuration:
wrangler flagship apps create checkout-serviceTo add the new app to your wrangler.json or wrangler.jsonc file as a Worker binding, pass --binding:
wrangler flagship apps create checkout-service --binding FLAGSWrangler also supports --update-config to update your JSON or JSONC configuration after prompting for a binding name.
For non-JSON configuration files, Wrangler prints the binding snippet but does not edit the file automatically.
When --json is used, apps create prints the created app as JSON and does not prompt for or update configuration.
For scripts, capture the app ID from JSON output:
APP_ID=$(wrangler flagship apps create checkout-service --json | jq -r '.id')Deleting an app deletes all of its flags and changelog history. The API rejects app deletion if a Worker still references the app through a Flagship binding.
Use --force or -y to skip the delete confirmation prompt. If you also use --json, you must pass --force so the confirmation prompt cannot appear in JSON output.
wrangler flagship apps delete <APP_ID> --forceDelete multiple apps by passing multiple app IDs:
wrangler flagship apps delete <APP_ID_1> <APP_ID_2> <APP_ID_3> --forceFlag keys are unique within an app. Use stable keys that describe the behavior being controlled, such as new-checkout, pricing-page-layout, or upload-limit.
If you omit variations, Wrangler creates a boolean flag with on=true, off=false, and off as the default variation.
wrangler flagship flags create <APP_ID> new-checkoutUse --variation (-V) to add each variation as name=value. Use --default to choose the fallback variation.
# String flag.wrangler flagship flags create <APP_ID> checkout-flow \ -V v1=old-checkout \ -V v2=new-checkout \ --default v1 \ --type string
# Number flag.wrangler flagship flags create <APP_ID> upload-limit \ -V free=10 \ -V pro=100 \ -V enterprise=1000 \ --default free \ --type number
# JSON flag.wrangler flagship flags create <APP_ID> theme-config \ -V 'light={"bg":"#ffffff","fg":"#111111"}' \ -V 'dark={"bg":"#111111","fg":"#ffffff"}' \ --default light \ --type jsonSupported value types are boolean, string, number, and json. If --type is omitted, Wrangler infers each value's scalar type independently.
All variations on a flag must use the same value type. Wrangler rejects a flag whose variations resolve to mixed types, for example one boolean and one number, before sending the request. Pass --type explicitly to coerce every variation to the same type.
Use --description (-d) to document the purpose of a flag:
wrangler flagship flags create <APP_ID> checkout-flow \ -V v1=old-checkout \ -V v2=new-checkout \ --default v1 \ --type string \ --description "Controls which checkout experience is served"Flag keys and variation names can contain letters, numbers, hyphens, and underscores. Keep keys stable, because application code evaluates flags by key.
Use --disabled to create a flag that serves its default variation until you enable it.
wrangler flagship flags create <APP_ID> coming-soon \ -V on=true \ -V off=false \ --default off \ --disabledTargeting rules decide which variation to serve for a given evaluation context. Pass rules with --rule or --rule-json.
The compact --rule syntax uses semicolon-separated segments:
serve=<VARIATION>; when=<CONDITIONS>; rollout=<PERCENT>%@<ATTRIBUTE>; priority=<NUMBER>| Segment | Required | Description |
|---|---|---|
serve | Yes | Variation served when the rule matches. Must reference an existing variation. |
when | No | Conditions matched against evaluation context. If omitted, the rule matches every context. |
rollout | No | Percentage of matching traffic to receive the variation. The attribute controls sticky bucketing. |
priority | No | Evaluation order. Lower numbers run first. If omitted, Wrangler assigns priorities by order. |
wrangler flagship flags create <APP_ID> premium-banner \ -V on=true \ -V off=false \ --default off \ --rule "serve=on; when=plan equals enterprise AND country in [US,CA]; rollout=25%@user_id"Conditions compare attributes from the evaluation context with rule values. The compact syntax supports all Flagship operators:
--rule "serve=on; when=plan equals pro"--rule "serve=on; when=country in [US,CA,UK]"--rule "serve=off; when=email ends_with @example.com"--rule "serve=strict; when=score less_than 20"Use AND and OR to combine conditions. AND has higher precedence than OR.
# Both conditions must match.--rule "serve=on; when=plan equals pro AND country equals US"
# Either condition can match.--rule "serve=on; when=plan equals enterprise OR plan equals team"
# Equivalent to: (plan=pro AND country=US) OR plan=enterprise.--rule "serve=on; when=plan equals pro AND country equals US OR plan equals enterprise"AND and OR are reserved as logical operators when they appear outside quoted values or lists. Wrap values in single or double quotes when they contain reserved words or separators such as AND, OR, ;, or ,:
--rule 'serve=on; when=title equals "WAR AND PEACE" OR title equals "tom; jerry"'--rule 'serve=on; when=country in ["US","CA"]'For in and not_in, pass a bracketed list. Wrangler rejects malformed lists, empty list items, unterminated quotes, and unbalanced brackets before sending the request.
Use --rule-json for deeply nested logical groups or if you prefer to pass the API rule shape directly. Wrangler validates --rule-json against the Flagship rule schema and rejects unknown or conflicting fields.
wrangler flagship flags create <APP_ID> beta-features \ -V on=true \ -V off=false \ --default off \ --rule-json '{"serve_variation":"on","conditions":[{"logical_operator":"OR","clauses":[{"attribute":"beta","operator":"equals","value":true},{"attribute":"plan","operator":"equals","value":"enterprise"}]}]}'Repeat --rule or --rule-json to declare multiple rules. Rules are evaluated in priority order. The first matching rule wins.
wrangler flagship flags create <APP_ID> rate-limit-tier \ -V strict=50 \ -V normal=200 \ -V relaxed=1000 \ --default normal \ --type number \ --rule "serve=strict; when=score less_than 20" \ --rule "serve=relaxed; when=score greater_than_or_equals 90"Wrangler validates duplicate rule priorities, duplicate variation names, malformed lists, non-finite numeric values such as Infinity, and unknown variation names before sending the request.
List flags in an app:
wrangler flagship flags list <APP_ID>The list command is paginated. Use --limit and --cursor for manual pagination, or --all to fetch every page.
wrangler flagship flags list <APP_ID> --limit 50wrangler flagship flags list <APP_ID> --cursor <CURSOR>wrangler flagship flags list <APP_ID> --allInspect a full flag definition:
wrangler flagship flags get <APP_ID> new-checkoutwrangler flagship flags ls is an alias for flags list. wrangler flagship flags inspect is an alias for flags get.
wrangler flagship flags update reads the current flag, applies your changes, and writes the full flag definition back to the API.
wrangler flagship flags update <APP_ID> new-checkout \ --description "Redesigned checkout experience"
wrangler flagship flags update <APP_ID> upload-limit \ --set-variation team=500
wrangler flagship flags update <APP_ID> upload-limit \ --remove-variation teamTo add a variant to an existing flag, set a new variation name and value:
wrangler flagship flags update <APP_ID> checkout-flow \ --set-variation experiment=new-checkout-v2Pass an empty description to clear it:
wrangler flagship flags update <APP_ID> new-checkout --description ""When you add or replace variations on an existing flag, use --type if Wrangler should coerce the new values to a specific type:
wrangler flagship flags update <APP_ID> upload-limit \ --type number \ --set-variation team=500Wrangler validates that the resulting variation set still has a single value type and that the default variation and targeting rules still reference known variations.
You can also enable or disable a flag through flags update, although flags enable and flags disable are shorter for kill-switch workflows:
wrangler flagship flags update <APP_ID> new-checkout --disablewrangler flagship flags update <APP_ID> new-checkout --enablewrangler flagship flags set <APP_ID> checkout-flow --variation v2Use --clear-rules if the new default should be served to everyone.
wrangler flagship flags set <APP_ID> checkout-flow --variation v2 --clear-rulesUse --rule or --rule-json to replace the full rule set:
wrangler flagship flags update <APP_ID> premium-banner \ --rule "serve=on; when=plan equals pro AND country not_in [CN,RU]"Use --add-rule or --add-rule-json to append rules without changing existing rules:
wrangler flagship flags update <APP_ID> premium-banner \ --add-rule "serve=off; when=account_age less_than 7"
wrangler flagship flags update <APP_ID> premium-banner \ --add-rule-json '{"serve_variation":"off","conditions":[{"attribute":"country","operator":"in","value":["CN","RU"]}]}'Clear all rules:
wrangler flagship flags update <APP_ID> premium-banner --clear-rulesUse rules list to see the priorities you can target with rule-specific commands:
wrangler flagship flags rules list <APP_ID> premium-bannerFlagship evaluates rules by ascending priority; the first matching rule wins. Use rules reorder to reorder existing rules without rewriting every condition.
Pass the existing priorities in the new order. Wrangler renumbers them to 1..n in that order:
wrangler flagship flags rules reorder <APP_ID> rate-limit-tier --order 2,1If the existing priorities were 1=strict and 2=relaxed, this makes relaxed priority 1 and strict priority 2.
Use rules update to edit one rule by priority while preserving the rest of the rule set.
Change only a rollout percentage:
wrangler flagship flags rules update <APP_ID> premium-banner \ --priority 1 \ --rollout 50%@user_idChange the variation served by a rule:
wrangler flagship flags rules update <APP_ID> premium-banner \ --priority 1 \ --serve offChange the conditions on a rule:
wrangler flagship flags rules update <APP_ID> premium-banner \ --priority 1 \ --when "plan equals enterprise OR plan equals team"Remove conditions from a rule so it matches every evaluation context:
wrangler flagship flags rules update <APP_ID> premium-banner \ --priority 1 \ --clear-conditionsRemove a rollout from a rule:
wrangler flagship flags rules update <APP_ID> premium-banner \ --priority 1 \ --clear-rolloutUse rules delete to remove one rule by priority:
wrangler flagship flags rules delete <APP_ID> premium-banner --priority 2After deleting a rule, Wrangler renumbers the remaining rules so priorities stay contiguous.
Disabling a flag is an immediate kill switch. A disabled flag ignores targeting rules and serves its default variation.
wrangler flagship flags disable <APP_ID> new-checkoutwrangler flagship flags enable <APP_ID> new-checkoutEnable or disable multiple flags in an app by passing the app ID followed by multiple keys:
wrangler flagship flags disable <APP_ID> new-checkout dark-mode premium-bannerwrangler flagship flags enable <APP_ID> new-checkout dark-mode premium-bannerUse rollout to serve one variation to a percentage of traffic.
wrangler flagship flags rollout <APP_ID> new-checkout \ --to on \ --percentage 25 \ --by user_idUse --from-variation (alias --from) to choose the fallback variation for the remaining traffic. A rollout percentage of 0 removes the rollout rule and keeps the flag's current default variation unchanged.
rollout sends the percentage you provide directly to Flagship. For example, --percentage 25 --to on serves the on variation to 25% of bucketed traffic. The remaining traffic falls through to the flag's default variation.
Use split for A/B tests or multi-way traffic allocation. Wrangler converts weights into cumulative rollout thresholds.
wrangler flagship flags split <APP_ID> checkout-flow \ --weight v1=80 \ --weight v2=20 \ --by user_id-w is an alias for --weight. Each variation can only be weighted once, and weights must be finite, non-negative numbers.
Weights are relative. Wrangler totals the weights, converts each one into a percentage of the total, and sends cumulative thresholds to Flagship. For example, --weight v1=80 --weight v2=20 sends two generated rules: one for v1 with a rollout percentage of 80, and one for v2 with a rollout percentage of 100. This creates bucket ranges of 0-80 for v1 and 80-100 for v2.
With three weights, --weight a=50 --weight b=30 --weight c=20 becomes cumulative thresholds of 50, 80, and 100. Zero-weight variations are skipped.
Use --default with split to choose the fallback variation when bucketing cannot run:
wrangler flagship flags split <APP_ID> checkout-flow \ --weight v1=80 \ --weight v2=20 \ --default v1 \ --by user_idwrangler flagship flags rollout <APP_ID> new-checkout --to on --percentage 100 --forceEvaluate a flag from the CLI to verify what a specific context receives.
wrangler flagship flags evaluate <APP_ID> new-checkout
wrangler flagship flags evaluate <APP_ID> new-checkout \ --targeting-key user-42
wrangler flagship flags evaluate <APP_ID> premium-banner \ --context plan=enterprise \ --context country=US \ --targeting-key user-99Use --targeting-key for stable percentage rollout bucketing. Pass each context attribute with --context name=value. wrangler flagship flags eval is an alias for flags evaluate.
--context can be repeated. --ctx and -C are aliases:
wrangler flagship flags evaluate <APP_ID> premium-banner \ -C plan=enterprise \ -C country=US \ --targeting-key user-99Context values are sent to the evaluation endpoint as strings. Use the same attribute names that your targeting rules expect.
Evaluation output includes:
| Field | Description |
|---|---|
value | The flag value returned for the context. |
variant | The variation selected for the context. |
reason | Why the value was returned: TARGETING_MATCH, DEFAULT, DISABLED, or SPLIT. |
Flagship records create, update, and delete events for each flag. View changelog history newest first:
wrangler flagship flags changelog <APP_ID> new-checkoutUse pagination controls for long histories:
wrangler flagship flags changelog <APP_ID> new-checkout --limit 10wrangler flagship flags changelog <APP_ID> new-checkout --cursor <CURSOR>wrangler flagship flags changelog <APP_ID> new-checkout --allwrangler flagship flags history is an alias for flags changelog.
wrangler flagship flags delete <APP_ID> coming-soonUse --force or -y to skip the confirmation prompt. If you also use --json, you must pass --force so the confirmation prompt cannot appear in JSON output.
wrangler flagship flags delete <APP_ID> coming-soon --forcewrangler flagship flags rm is an alias for flags delete.
Delete multiple flags by passing the app ID followed by multiple keys:
wrangler flagship flags delete <APP_ID> coming-soon old-checkout temporary-banner --forceEvery wrangler flagship command accepts --json. JSON output suppresses the Wrangler banner and is intended for scripts.
Delete commands require --force with --json to keep stdout valid JSON. rollout and split also require --force with --json if they would replace existing targeting rules that have conditions.
Bulk commands, such as flags delete, flags enable, and flags disable, continue processing remaining flags if one flag fails. In JSON mode, partial failures return a JSON error object containing successful results and per-flag failures.
Commands that can update wrangler.json or wrangler.jsonc, such as apps create --binding, do not prompt for or update configuration when --json is used.
Create an app, capture its ID, then create a flag:
APP_ID=$(wrangler flagship apps create checkout-service --json | jq -r '.id')
wrangler flagship flags create "$APP_ID" new-checkout --jsonDelete several apps in a loop:
for app_id in <APP_ID_1> <APP_ID_2> <APP_ID_3>; do wrangler flagship apps delete "$app_id" --forcedoneOr pass the app IDs directly:
wrangler flagship apps delete <APP_ID_1> <APP_ID_2> <APP_ID_3> --forceThe following reference is generated from Wrangler's flagship command definitions.
Create a Flagship app
npx wrangler flagship apps create [NAME]pnpm wrangler flagship apps create [NAME]yarn wrangler flagship apps create [NAME]-
[NAME]stringrequiredThe name of the app
-
--jsonbooleandefault: falseReturn output as JSON
-
--use-remotebooleanUse a remote binding when adding the newly created resource to your config
-
--update-configbooleanAutomatically update your config file with the newly added resource
-
--bindingstringThe binding name of this resource in your Worker
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
List Flagship apps
npx wrangler flagship apps listpnpm wrangler flagship apps listyarn wrangler flagship apps list-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Get a Flagship app
npx wrangler flagship apps get [APP-ID]pnpm wrangler flagship apps get [APP-ID]yarn wrangler flagship apps get [APP-ID]-
[APP-ID]stringrequiredThe ID of the app
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Update a Flagship app
npx wrangler flagship apps update [APP-ID]pnpm wrangler flagship apps update [APP-ID]yarn wrangler flagship apps update [APP-ID]-
[APP-ID]stringrequiredThe ID of the app
-
--namestringrequiredThe new name of the app
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Delete a Flagship app
npx wrangler flagship apps delete [APP-ID]pnpm wrangler flagship apps delete [APP-ID]yarn wrangler flagship apps delete [APP-ID]-
[APP-ID]stringrequiredOne or more app IDs to delete
-
--forcebooleanalias: --y default: falseSkip the confirmation prompt
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Create a feature flag in a Flagship app
npx wrangler flagship flags create [APP-ID] [KEY]pnpm wrangler flagship flags create [APP-ID] [KEY]yarn wrangler flagship flags create [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--variationstringalias: --VA flag variation, in the form "name=value" (repeatable)
-
--default-variationstringalias: --defaultThe name of the variation to serve by default (defaults to off for boolean flags, otherwise the first variation)
-
--typestringalias: --tThe variation value type (inferred when omitted)
-
--descriptionstringalias: --dA description of the flag
-
--disabledbooleandefault: falseCreate the flag in a disabled state
-
--rulestringA targeting rule, e.g. "serve=on; when=plan equals pro AND region in [US,CA]; rollout=30%@user_id". Conditions support AND/OR; priority is optional and defaults to declaration order (repeatable)
-
--rule-jsonstringA targeting rule as a JSON object (repeatable)
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
List feature flags in a Flagship app
npx wrangler flagship flags list [APP-ID]pnpm wrangler flagship flags list [APP-ID]yarn wrangler flagship flags list [APP-ID]-
[APP-ID]stringrequiredThe ID of the app
-
--limitnumberThe maximum number of flags to return (1-200)
-
--cursorstringThe pagination cursor from a previous list call
-
--allbooleandefault: falseFetch every flag, following pagination automatically
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Get a feature flag from a Flagship app
npx wrangler flagship flags get [APP-ID] [KEY]pnpm wrangler flagship flags get [APP-ID] [KEY]yarn wrangler flagship flags get [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Update a feature flag in a Flagship app
npx wrangler flagship flags update [APP-ID] [KEY]pnpm wrangler flagship flags update [APP-ID] [KEY]yarn wrangler flagship flags update [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--enablebooleanEnable the flag
-
--disablebooleanDisable the flag
-
--descriptionstringalias: --dA new description for the flag (pass "" to clear it)
-
--default-variationstringalias: --defaultThe name of the variation to serve by default
-
--typestringalias: --tThe value type used to coerce --set-variation values
-
--set-variationstringAdd or replace a variation, in the form "name=value"
-
--remove-variationstringRemove a variation by name
-
--rulestringReplace the flag's targeting rules (repeatable)
-
--rule-jsonstringReplace the flag's targeting rules using JSON (repeatable)
-
--add-rulestringAppend a targeting rule, keeping the existing rules (repeatable)
-
--add-rule-jsonstringAppend a targeting rule using JSON, keeping the existing rules (repeatable)
-
--clear-rulesbooleandefault: falseRemove all targeting rules
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Set the default variation served by a feature flag
npx wrangler flagship flags set [APP-ID] [KEY]pnpm wrangler flagship flags set [APP-ID] [KEY]yarn wrangler flagship flags set [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--variationstringaliases: --variant, --V requiredThe variation to serve by default
-
--clear-rulesbooleandefault: falseClear targeting rules so this variation is always served
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
List targeting rules for a feature flag
npx wrangler flagship flags rules list [APP-ID] [KEY]pnpm wrangler flagship flags rules list [APP-ID] [KEY]yarn wrangler flagship flags rules list [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Update one targeting rule for a feature flag
npx wrangler flagship flags rules update [APP-ID] [KEY]pnpm wrangler flagship flags rules update [APP-ID] [KEY]yarn wrangler flagship flags rules update [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--prioritynumberrequiredThe priority of the rule to update
-
--servestringThe variation to serve when this rule matches
-
--whenstringThe rule conditions, using the same syntax as --rule when=...
-
--clear-conditionsbooleandefault: falseRemove conditions so the rule matches all contexts
-
--rolloutstringThe rollout, in the form "percentage" or "percentage%@attribute"
-
--clear-rolloutbooleandefault: falseRemove the rollout from this rule
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Delete one targeting rule from a feature flag
npx wrangler flagship flags rules delete [APP-ID] [KEY]pnpm wrangler flagship flags rules delete [APP-ID] [KEY]yarn wrangler flagship flags rules delete [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--prioritynumberrequiredThe priority of the rule to delete
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Reorder targeting rules for a feature flag
npx wrangler flagship flags rules reorder [APP-ID] [KEY]pnpm wrangler flagship flags rules reorder [APP-ID] [KEY]yarn wrangler flagship flags rules reorder [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--orderstringrequiredComma-separated existing rule priorities in their new order, for example 2,1,3
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Split traffic across variations by percentage
npx wrangler flagship flags split [APP-ID] [KEY]pnpm wrangler flagship flags split [APP-ID] [KEY]yarn wrangler flagship flags split [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--weightstringalias: --wA variation weight, in the form "variation=weight" (repeatable)
-
--bystringContext attribute used for sticky bucketing
-
--default-variationstringalias: --defaultFallback variation when bucketing cannot run
-
--forcebooleanalias: --y default: falseSkip the confirmation prompt when this split replaces existing targeting rules
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Roll out one variation to a percentage of traffic
npx wrangler flagship flags rollout [APP-ID] [KEY]pnpm wrangler flagship flags rollout [APP-ID] [KEY]yarn wrangler flagship flags rollout [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--tostringrequiredVariation to roll out
-
--percentagenumberrequiredPercentage of traffic to serve the rollout variation (0-100)
-
--bystringContext attribute used for sticky bucketing
-
--from-variationstringalias: --fromFallback variation for the remaining traffic
-
--forcebooleanalias: --y default: falseSkip the confirmation prompt when this rollout replaces existing targeting rules
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Enable a feature flag
npx wrangler flagship flags enable [APP-ID] [KEY]pnpm wrangler flagship flags enable [APP-ID] [KEY]yarn wrangler flagship flags enable [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredOne or more flag keys to enable
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Disable a feature flag
npx wrangler flagship flags disable [APP-ID] [KEY]pnpm wrangler flagship flags disable [APP-ID] [KEY]yarn wrangler flagship flags disable [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredOne or more flag keys to disable
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Evaluate a feature flag with optional context
npx wrangler flagship flags evaluate [APP-ID] [KEY]pnpm wrangler flagship flags evaluate [APP-ID] [KEY]yarn wrangler flagship flags evaluate [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--contextstringaliases: --ctx, --CEvaluation context, in the form "name=value" (repeatable)
-
--targeting-keystringStable bucketing key for percentage rollouts
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Delete a feature flag from a Flagship app
npx wrangler flagship flags delete [APP-ID] [KEY]pnpm wrangler flagship flags delete [APP-ID] [KEY]yarn wrangler flagship flags delete [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredOne or more flag keys to delete
-
--forcebooleanalias: --y default: falseSkip the confirmation prompt
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile
Show the changelog for a feature flag
npx wrangler flagship flags changelog [APP-ID] [KEY]pnpm wrangler flagship flags changelog [APP-ID] [KEY]yarn wrangler flagship flags changelog [APP-ID] [KEY]-
[APP-ID]stringrequiredThe ID of the app
-
[KEY]stringrequiredThe key of the flag
-
--limitnumberThe maximum number of entries to return (1-200)
-
--cursorstringThe pagination cursor from a previous changelog call
-
--allbooleandefault: falseFetch every entry, following pagination automatically
-
--jsonbooleandefault: falseReturn output as JSON
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
-
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
-
--profilestringUse a specific auth profile