vercel flags
The vercel flags command manages Vercel Flags for a project directly from the command line. You can create, list, inspect, open, update, set, enable, disable, archive, and delete feature flags, as well as manage SDK keys.
vercel flags listUsing the vercel flags command to list all active
feature flags.
vercel flags create [slug]Using the vercel flags create command to create a new feature flag.
vercel flags inspect [flag]Using the vercel flags command to display information
about a feature flag.
vercel flags open [flag]Opening the project feature flags dashboard, or a specific feature flag, in the Vercel dashboard.
vercel flags update [flag]Using the vercel flags command to update a flag's variants.
vercel flags set [flag]Using the vercel flags command to set the served variant in an
environment.
vercel flags enable [flag]Using the vercel flags command to enable a boolean feature flag in an
environment.
vercel flags disable [flag]Using the vercel flags command to disable a boolean feature flag in an
environment.
vercel flags archive [flag]Using the vercel flags command to archive a feature flag.
vercel flags rm [flag]Using the vercel flags command to delete a feature flag.
Boolean flags are created by default. The vercel flags create command creates
a new feature flag.
vercel flags create welcome-message --kind string --description "Homepage welcome copy" \
--variant control="Welcome back" --variant treatment="Start for free"Creating a string feature flag with explicit variants.
For string and number flags, repeat --variant VALUE[=LABEL] to define the exact variants you want to create. If you omit --variant in a terminal, the CLI prompts you to add variants interactively. In non-interactive environments, you must pass --variant.
Boolean flags always use the built-in false and true variants, labelled Off and On.
New boolean flags serve true in development and false in preview and production. The create output shows the initial environment behavior for the flag you just created.
Use vercel flags open to jump straight to the Vercel dashboard.
vercel flags open welcome-messageOpening a specific feature flag in the Vercel dashboard.
Use vercel flags update to change an existing variant's value, label, or both. If you omit one of the update flags, the CLI can guide you interactively.
vercel flags update welcome-message --variant control --value welcome-back \
--label "Welcome back" --message "Refresh control copy"Updating a variant and recording a revision message.
--variant matches a variant ID or current value. Run vercel flags inspect if you want to confirm the available variants before updating them.
For boolean flags, vercel flags update can rename the true or false variant labels, but it cannot change the boolean values themselves.
Use vercel flags set to choose which variant a specific environment serves.
vercel flags set welcome-message --environment preview --variant control \
--message "Serve the control copy in preview"Setting the variant served in preview for a string flag.
The enable and disable commands are shortcuts for boolean flags. They control whether an environment serves the true variant or the false variant. If you do not provide the --environment option, the CLI prompts you to select one interactively.
vercel flags enable my-feature --environment production --message "Resume rollout"Enabling a boolean flag in production and recording why the change was made.
vercel flags disable my-feature -e production --variant false \
--message "Pause rollout in production"Disabling a boolean flag and serving the false variant in production.
The enable and disable commands only work with boolean flags. For string
or number flags, use vercel flags set to change the served variant in an
environment and vercel flags update to change variant values or labels.
A flag must be archived before it can be deleted. Archived flags stop evaluating and can be restored from the dashboard.
vercel flags archive my-feature --yesArchiving a flag without a confirmation prompt.
vercel flags rm my-feature --yesDeleting an archived flag without a confirmation prompt.
The vercel flags sdk-keys subcommand manages SDK keys for your project. SDK keys authenticate your application when evaluating flags. You can create keys for different environments and key types.
vercel flags sdk-keys lsUsing the vercel flags sdk-keys ls command to list
all SDK keys.
vercel flags sdk-keys add --type server --environment productionCreating a server SDK key for the production environment.
vercel flags sdk-keys rm [hash-key]Using the vercel flags sdk-keys rm command to delete
an SDK key.
When you create an SDK key, the output includes:
- Hash key: A truncated identifier shown in the key list
- SDK key: The full key value, shown only at creation time
- Connection string: A
flags:URI containing all configuration needed to connect to Vercel Flags
Save the SDK key when it's created. It won't be shown again.
If you don't provide the --environment option, you'll be prompted to select one interactively.
These are options that only apply to the vercel flags command.
The --state option, shorthand -s, filters the list of flags by state when using vercel flags list. Valid values are active and archived. Defaults to active.
vercel flags ls --state archivedUsing the vercel flags ls command with the
--state option to list archived flags.
The --kind option, shorthand -k, specifies the type of a new flag when using vercel flags create. Valid values are boolean, string, and number. Defaults to boolean.
vercel flags create my-feature --kind stringUsing the vercel flags create command with the
--kind option to create a string flag.
The --description option, shorthand -d, sets a description for a new flag when using vercel flags create.
vercel flags create my-feature --description "Controls the new onboarding flow"Using the vercel flags create command with the
--description option.
The --environment option, shorthand -e, specifies the target environment for vercel flags set, vercel flags enable, vercel flags disable, and vercel flags sdk-keys add. Valid values are production, preview, and development.
vercel flags set welcome-message --environment production --variant controlUsing the vercel flags set command with the
--environment option.
The --variant option, shorthand -v, defines variants on vercel flags create, and selects a variant by ID or value on vercel flags update, vercel flags set, and vercel flags disable.
vercel flags create welcome-message --kind string \
--variant control="Welcome back" --variant treatment="Start for free"Using repeated --variant options to create a string flag with explicit
variants.
The --value option sets the new value for a variant when using vercel flags update. Boolean variants can keep their existing true or false value, but they cannot be changed to a different boolean value.
vercel flags update welcome-message --variant control --value welcome-backUsing the vercel flags update command with the --value option.
The --label option, shorthand -l, sets a variant label when using vercel flags update, or an SDK key label when using vercel flags sdk-keys add.
vercel flags update welcome-message --variant control --label "Welcome back"Using the vercel flags update command with the --label option.
The --message option sets an optional revision message when using vercel flags update, vercel flags set, vercel flags enable, or vercel flags disable.
vercel flags set welcome-message -e preview --variant control \
--message "Keep preview on control"Using the vercel flags set command with the --message option.
The --type option specifies the type of SDK key when using vercel flags sdk-keys add.
vercel flags sdk-keys add --type server --environment productionUsing the vercel flags sdk-keys add command with the --type option.
The --yes option, shorthand -y, skips the confirmation prompt when archiving or deleting a flag, or when deleting an SDK key.
vercel flags archive my-feature --yesUsing the vercel flags archive command with the
--yes option to skip confirmation.
The following global options can be passed when using the vercel flags command:
For more information on global options and their usage, refer to the options section.
Was this helpful?