Console Commands
Manage feature flags from the command line.
Manage feature flags from the command line using craft feature-flags/flags.
Available Commands #
list
Lists all feature flags with their status, type, rollout percentage, rule count, and expiration date.
craft feature-flags/flags/list
info
Displays detailed information about a specific flag, including all targeting rules.
craft feature-flags/flags/info <handle>
Arguments:
handle— The flag’s handle
enable
Enables a feature flag.
craft feature-flags/flags/enable <handle>
Arguments:
handle— The flag’s handle
disable
Disables a feature flag.
craft feature-flags/flags/disable <handle>
Arguments:
handle— The flag’s handle
delete
Deletes a feature flag permanently. Prompts for confirmation unless --force is used.
craft feature-flags/flags/delete <handle>
craft feature-flags/flags/delete <handle> --force
Arguments:
handle— The flag’s handle
Options:
--force— Skip the confirmation prompt
cleanup-expired
Deletes all flags that have passed their expiresAt date. Prompts for confirmation unless --force is used.
craft feature-flags/flags/cleanup-expired
craft feature-flags/flags/cleanup-expired --force
Options:
--force— Skip the confirmation prompt
Usage with DDEV #
Prefix commands with ddev exec or ddev craft:
ddev craft feature-flags/flags/list
ddev craft feature-flags/flags/enable new-checkout
Automation #
The cleanup-expired command is useful as a scheduled task (cron job) to automatically remove stale flags:
# Run daily at midnight
0 0 * * * ./craft feature-flags/flags/cleanup-expired --force