Toggle a feature in one or more environments
Enables or disables a Feature Flag in one or more environments and immediately publishes the change. The caller needs Publish access for every environment in the request. When approval is required, use a draft revision instead, unless the caller can bypass draft approvals.
growthbook features toggle [flags]
growthbook features toggle --id <id> --environments '{"key":"<value>","key1":false}'
--body string Request body as JSON (alternative to individual flags). Can also be provided via stdin.
-c, --comment reason Comment to record on the revision this toggle publishes, when it changes any environment. Defaults to "Created via REST API". (reason is recorded in the audit log only.)
-e, --environments string [required]
-h, --help help for toggle
-i, --id string The id of the requested resource [required]
-r, --reason string string value
--agent-mode Enable structured errors and default TOON output for AI coding agents. Automatically enabled when a known agent environment is detected (CLAUDE_CODE, CURSOR_AGENT, etc.). Use --agent-mode=false to disable.
--bearer-auth string Bearer auth token: your Secret Key or Personal Access Token, sent as an Authorization Bearer header.
--color string Control colored output: auto (color when output is a TTY), always, or never. Respects NO_COLOR and FORCE_COLOR env vars. (default "auto")
-d, --debug Log request and response diagnostics to stderr
--domain string Server template variable: domain
--dry-run Preview the request that would be sent without executing it (output to stderr)
-H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times.
--include-headers Include HTTP response headers in the output
-q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id')
--no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms)
--no-update-check Disable the once-a-day check for a newer CLI version
-o, --output-format string Specify the output format. Options: pretty, json, yaml, toon. (default "pretty")
--password string HTTP Basic auth: use your GrowthBook Secret Key as the username and leave the password empty. password
--profile growthbook profiles Use a named credential/server profile (manage with growthbook profiles)
--server string Select a server by index (for indexed servers) or name (for named servers)
--server-url string Override the default server URL
--timeout string HTTP request timeout (e.g., 30s, 5m, 100ms)
--usage Print the CLI Usage schema in KDL format
--username string HTTP Basic auth: use your GrowthBook Secret Key as the username and leave the password empty. username
- growthbook features - Control your feature flags programmatically