Managing Flags
Console commands for the full flag lifecycle — create, enable, disable, rollout, rules, environments, and cleanup.
Managing Flags
All flag lifecycle operations are available via php vortos vortos:flags:* commands. Every command goes through FlagWriteService — changes are audited, cached safely, and pushed to any open admin dashboards via SSE.
Create
# Bool flag, disabled by default
php vortos vortos:flags:create new-checkout
# With description and kind
php vortos vortos:flags:create new-checkout \
--description="New checkout redesign" \
--kind=release
# Experiment with string variants
php vortos vortos:flags:create cta-button \
--kind=experiment \
--value-type=string
# Ops kill switch
php vortos vortos:flags:create disable-payments \
--kind=ops \
--description="Emergency kill switch for the payment processor"
# Scoped to a project and environment
php vortos vortos:flags:create new-checkout \
--project=checkout \
--env=stagingAlways create the flag before merging the feature branch. The flag starts disabled, so the code deploys to production with the feature invisible. This decouples deployment from release.
Show
php vortos vortos:flags:show new-checkout
php vortos vortos:flags:show new-checkout --env=stagingShows the flag's current state, all rules (in order), variants, environment, and project.
List
# All flags
php vortos vortos:flags:list
# Filter by environment
php vortos vortos:flags:list --env=staging
# Filter by kind
php vortos vortos:flags:list --kind=ops
# Filter by status
php vortos vortos:flags:list --status=enabled
# Machine-readable output
php vortos vortos:flags:list --jsonEnable
# Enable for all users (no percentage rule)
php vortos vortos:flags:enable new-checkout
# Enable with a gradual rollout percentage
php vortos vortos:flags:enable new-checkout --rollout=10
# Enable in a specific environment
php vortos vortos:flags:enable new-checkout --env=staging--rollout=N adds (or replaces) a percentage rule. The flag is both enabled and rolling out — users outside the percentage bucket still get false.
Disable
# Immediate kill switch — cache is busted on write
php vortos vortos:flags:disable new-checkout
# Disable in a specific environment only
php vortos vortos:flags:disable new-checkout --env=stagingDisable bypasses the TTL
Unlike other writes, disable invalidates the Redis cache immediately. The flag reads as false within the current request on every instance. Use this as your incident kill switch.
Delete
php vortos vortos:flags:delete new-checkout --forceIrreversible
Deletion removes the flag, all rules, all audit history, and all variant data permanently. --force is required. Remove all isEnabled() and variant() calls from the codebase before deleting. Consider archiving instead — archived flags are removed from evaluation but their history is preserved.
Add Targeting Rules
Rules are evaluated in insertion order — first match wins. See Targeting Rules for the full evaluation model.
# Whitelist specific user IDs
php vortos vortos:flags:add-rule new-checkout \
--type=users \
--users=user-123,user-456
# Percentage rollout (deterministic by userId + flagName hash)
php vortos vortos:flags:add-rule new-checkout \
--type=percentage \
--percentage=25
# Attribute rule
php vortos vortos:flags:add-rule new-checkout \
--type=attribute \
--attribute=plan \
--operator=equals \
--value=enterprise
# Region targeting
php vortos vortos:flags:add-rule new-checkout \
--type=attribute \
--attribute=region \
--operator=in \
--value=eu-west,eu-central
# Replace all existing rules before adding the new one
php vortos vortos:flags:add-rule new-checkout \
--type=percentage \
--percentage=50 \
--clearTypical gradual rollout
This is the standard sequence for a feature release:
# 1. Create before merging — feature is deployed but invisible
php vortos vortos:flags:create new-checkout \
--description="New checkout redesign" \
--kind=release
# 2. Internal team first
php vortos vortos:flags:add-rule new-checkout \
--type=users \
--users=eng-1,eng-2,qa-1
php vortos vortos:flags:enable new-checkout
# 3. Verified in production — open to 10%
php vortos vortos:flags:add-rule new-checkout \
--type=percentage \
--percentage=10 \
--clear
# 4. Ramp up
php vortos vortos:flags:add-rule new-checkout \
--type=percentage \
--percentage=50 \
--clear
# 5. Full rollout
php vortos vortos:flags:enable new-checkout --rollout=100
# 6. Feature is live — remove flag from code, then clean up
php vortos vortos:flags:delete new-checkout --forceThe --clear on steps 3–4 removes the previous rule set before adding the new percentage, so rules from step 2 do not persist into the ramp phase.