Console Commands

Manage feature flags from the command line.

Man­age fea­ture flags from the com­mand line using craft feature-flags/flags.

Avail­able Com­mands #

list

Lists all fea­ture flags with their sta­tus, type, roll­out per­cent­age, rule count, and expi­ra­tion date.

craft feature-flags/flags/list

info

Dis­plays detailed infor­ma­tion about a spe­cif­ic flag, includ­ing all tar­get­ing rules.

craft feature-flags/flags/info <handle>

Argu­ments:

  • handle — The flag’s handle

enable

Enables a fea­ture flag.

craft feature-flags/flags/enable <handle>

Argu­ments:

  • handle — The flag’s handle

dis­able

Dis­ables a fea­ture flag.

craft feature-flags/flags/disable <handle>

Argu­ments:

  • handle — The flag’s handle

delete

Deletes a fea­ture flag per­ma­nent­ly. Prompts for con­fir­ma­tion unless --force is used.

craft feature-flags/flags/delete <handle>
craft feature-flags/flags/delete <handle> --force

Argu­ments:

  • handle — The flag’s handle

Options:

  • --force — Skip the con­fir­ma­tion prompt

cleanup-expired

Deletes all flags that have passed their expiresAt date. Prompts for con­fir­ma­tion unless --force is used.

craft feature-flags/flags/cleanup-expired
craft feature-flags/flags/cleanup-expired --force

Options:

  • --force — Skip the con­fir­ma­tion prompt

Usage with DDEV #

Pre­fix com­mands with ddev exec or ddev craft:

ddev craft feature-flags/flags/list
ddev craft feature-flags/flags/enable new-checkout

Automa­tion #

The cleanup-expired com­mand is use­ful as a sched­uled task (cron job) to auto­mat­i­cal­ly remove stale flags:

# Run daily at midnight
0 0 * * * ./craft feature-flags/flags/cleanup-expired --force