Flagship (2)
Last updated Jul 16, 2026
Use wrangler flagship to manage Flagship apps and feature flags from the command line.
wrangler flagship is available in Wrangler v4.107.0 and later.
Authentication
Run wrangler login, or set CLOUDFLARE_API_TOKEN to an API token with Flagship permissions.
| Permission | Required for |
|---|---|
flagship:read |
Listing apps, inspecting flags, evaluating flags, and reading changelogs. |
flagship:write |
Creating, updating, deleting, enabling, disabling, rolling out, and splitting apps or flags. |
Most write workflows also read the current flag before writing the updated definition, so grant both permissions for operational use.
App IDs
wrangler flagship flags commands always take the app ID as the first argument. Most subcommands then take a flag key; list-style commands, such as flags list, take only the app ID:
wrangler flagship flags get <APP_ID> new-checkout
wrangler flagship flags disable <APP_ID> new-checkout
wrangler flagship flags list <APP_ID>
Create an app first if you do not already have one:
wrangler flagship apps create checkout-service
Pass --binding <NAME> when creating an app to add it to your wrangler.json or wrangler.jsonc file as a Worker binding.
Common workflows
Create a boolean flag. With no variations, Wrangler creates on=true, off=false, and serves off by default:
wrangler flagship flags create <APP_ID> new-checkout
Add targeting rules with the compact rule syntax:
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"
Use uppercase AND and OR outside quoted values to combine conditions. Quote values that contain reserved words or separators:
wrangler flagship flags create <APP_ID> banner-copy \
-V shown=true \
-V hidden=false \
--default hidden \
--rule 'serve=shown; when=title equals "WAR AND PEACE" OR country in ["US","CA"]'
For deeply nested condition groups, use --rule-json. Wrangler validates both compact rules and JSON rules before sending requests.
Change one existing rule without rewriting the full rule set:
wrangler flagship flags rules update <APP_ID> premium-banner \
--priority 1 \
--rollout 50%@user_id
Evaluate a flag for a user:
wrangler flagship flags evaluate <APP_ID> premium-banner \
--context plan=enterprise \
--context country=US \
--targeting-key user-42
Use disable as an immediate kill switch:
wrangler flagship flags disable <APP_ID> premium-banner
Enable, disable, or delete multiple flags by passing the app ID followed by multiple keys:
wrangler flagship flags disable <APP_ID> new-checkout dark-mode premium-banner
wrangler flagship flags delete <APP_ID> coming-soon old-banner --force
Delete commands require --force when used with --json so prompts cannot corrupt JSON output. rollout and split require the same when they would replace existing targeting rules that have conditions.
Refer to the Flagship Wrangler commands reference for a complete workflow guide covering targeting rules, rollouts, traffic splits, changelogs, and scripting with --json.
Commands
flagship apps create
Create a Flagship app
npmyarnpnpm
npx wrangler flagship apps create <NAME>
yarn wrangler flagship apps create <NAME>
pnpm wrangler flagship apps create <NAME>
<NAME>stringrequired
The name of the app
- --json boolean default: false
Return output as JSON
- --use-remote boolean Use a remote binding when adding the newly created resource to your config
- --update-config boolean Automatically update your config file with the newly added resource
- --binding string The binding name of this resource in your Worker
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
flagship apps list
List Flagship apps
npmyarnpnpm
npx wrangler flagship apps list
yarn wrangler flagship apps list
pnpm wrangler flagship apps list
--jsonbooleandefault: false
Return output as JSON
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
flagship apps get
Get a Flagship app
npmyarnpnpm
npx wrangler flagship apps get <APP-ID>
yarn wrangler flagship apps get <APP-ID>
pnpm wrangler flagship apps get <APP-ID>
<APP-ID>stringrequired
The ID of the app
- --json boolean default: false
Return output as JSON
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
flagship apps update
Update a Flagship app
npmyarnpnpm
npx wrangler flagship apps update <APP-ID>
yarn wrangler flagship apps update <APP-ID>
pnpm wrangler flagship apps update <APP-ID>
<APP-ID>stringrequired
The ID of the app
- --name string required
The new name of the app
- --json boolean default: false
Return output as JSON
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
flagship apps delete
Delete a Flagship app
npmyarnpnpm
npx wrangler flagship apps delete <APP-ID>
yarn wrangler flagship apps delete <APP-ID>
pnpm wrangler flagship apps delete <APP-ID>
<APP-ID>stringrequired
One or more app IDs to delete
- --force boolean alias: --ydefault: false
Skip the confirmation prompt
- --json boolean default: false
Return output as JSON
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
flagship flags create
Create a feature flag in a Flagship app
npmyarnpnpm
npx wrangler flagship flags create <APP-ID> <KEY>
yarn wrangler flagship flags create <APP-ID> <KEY>
pnpm wrangler flagship flags create <APP-ID> <KEY>
<APP-ID>stringrequired
The ID of the app
- <KEY> string required
The key of the flag
- --variation string alias: --V
A flag variation, in the form "name=value" (repeatable)
- --default-variation string alias: --default
The name of the variation to serve by default (defaults to off for boolean flags, otherwise the first variation)
- --type string alias: --t
The variation value type (inferred when omitted)
- --description string alias: --d
A description of the flag
- --disabled boolean default: false
Create the flag in a disabled state
- --rule string A 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-json string A targeting rule as a JSON object (repeatable)
- --json boolean default: false
Return output as JSON
- --local boolean Use the local flag store instead of the remote app
- --remote boolean Use the remote app instead of the local flag store
- --persist-to string Specify directory to use for local persistence
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
flagship flags list
List feature flags in a Flagship app
npmyarnpnpm
npx wrangler flagship flags list <APP-ID>
yarn wrangler flagship flags list <APP-ID>
pnpm wrangler flagship flags list <APP-ID>
<APP-ID>stringrequired
The ID of the app
- --limit number The maximum number of flags to return (1-200)
- --cursor string The pagination cursor from a previous list call
- --all boolean default: false
Fetch every flag, following pagination automatically
- --json boolean default: false
Return output as JSON
- --local boolean Use the local flag store instead of the remote app
- --remote boolean Use the remote app instead of the local flag store
- --persist-to string Specify directory to use for local persistence
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
flagship flags get
Get a feature flag from a Flagship app
