flag-create
flag-create
Create a new feature flag in GrowthBook. We always set {enabled: false} for every environment explicitly in the payload, so the flag ships disabled regardless of the org's default-state-for-new-environments setting — the user must enable it after creation. Feature keys are permanent; pick the name carefully.
All API calls go through the bundled helper: ${CLAUDE_PLUGIN_ROOT}/scripts/gb-call. It needs GB_API_KEY — set in your shell, or written to ~/.config/growthbook/.env by /growthbook:gb-setup. If it's missing or invalid, gb-call's error message points back at /growthbook:gb-setup.
Workflow
-
Confirm intent. Restate what the flag will gate in one sentence. Stop if the user wants to run an A/B test (route to the appropriate experiment skill based on what's already in scope) or a rule on an existing flag (route to
flag-rules). -
Check the key isn't taken.
gb-call GET /api/v2/feature-keysVerify the proposed key isn't already in the returned list. If it is, propose a variant; the API will reject the collision and the key cannot be renamed afterward.
-
Pick a value type. One of
string,number,boolean,json. Default tobooleanfor an on/off gate. Usestringorjsononly when the flag carries config (variant copy, threshold values, structured payload).