Flagship - Manage Flagship from the command line with Wrangler
Key Points
- wrangler flagship CLI for app and flag management
- create flags (boolean, string, number, JSON) and update defaults
- rollout, split, and rules for gradual exposure without redeploy
Summary
Wrangler now includes wrangler flagship, a CLI command suite for creating and managing Flagship apps and feature flags directly from your terminal or CI/CD pipelines. You can add a Worker binding in wrangler.json/wrangler.jsonc, create flags (boolean, string, number, or JSON), change defaults, toggle flags as kill switches, and perform gradual rollouts without redeploying your Worker.
Key Points
- Create an app and add a Worker binding:
wrangler flagship apps create "My Worker App" --binding FLAGS --update-config. - Create flags with different types:
wrangler flagship flags create <APP_ID> <flag-key> --type <boolean|string|number|json>. - Change defaults and use kill switches:
wrangler flagship flags update <APP_ID> <flag-key> --default <variation>;wrangler flagship flags disable <APP_ID> <flag-key>;wrangler flagship flags enable <APP_ID> <flag-key>. - Control exposure and rollout strategies without redeploying:
wrangler flagship flags rollout <APP_ID> <flag-key> --to on --percentage 25 --by user_id,wrangler flagship flags split <APP_ID> <flag-key> --weight control=80 --weight treatment=20 --by user_id, andwrangler flagship flags rules update <APP_ID> <flag-key> --priority 1 --when "country equals US". - Existing targeting rules remain active unless you explicitly change or clear them.
- Commands are scriptable and suitable for CI/CD pipelines and automation (including AI agents); see the
wrangler flagshipcommand reference for full usage.
Actionable Tips
- Add the binding to your Worker config with
--update-configto make flags available at runtime. - Use
rolloutandsplitto gradually increase user exposure and test changes safely. - Keep rules and priorities documented so disabling or changing defaults doesn't unintentionally override targeting logic.