Upgrading from the legacy CLI?Version 1.0 is a ground-up rewrite of the previous
growthbook npm package. Your existing ~/.growthbook/config.toml profiles are imported automatically on first run. Most commands are unchanged — see the migration guide for what moved.Installation
Install via npm (a small launcher that downloads the prebuilt binary for your platform; requires Node.js 16+):go install, and prebuilt downloads are covered in the repository README .
Verify the install:
Authentication
The CLI authenticates with a Secret Key or Personal Access Token, which you can create under Settings → API Keys . For interactive setup, run:Self-hosted instances
Point the CLI at your API host with--server-url (note the /api suffix), or store it once via growthbook configure:
Multiple organizations or servers
Named profiles bundle a server URL and credential together:Everyday usage
Every command and group documents itself — start withgrowthbook --help and drill down:
growthbook explore opens an interactive browser of the full command tree.
Write operations accept individual flags or a raw JSON body (via --body, or piped through stdin):
Scripting and automation
The CLI is built to compose with shell pipelines:--output-format json|yaml|toon|prettycontrols the output shape (-o jsonfor pipelines).--jq '<expression>'filters output with built-in jq — no separate install needed.--allauto-paginates list commands, streaming NDJSON in JSON mode.--dry-runprints the HTTP request that would be sent without executing it.- Exit codes are meaningful:
0on success, non-zero on any failure, with structured error output.
GBCLI_BEARER_AUTH environment variable (the keychain isn’t available in headless environments) and pass --no-interactive to disable all prompts.
AI coding agents
When the CLI detects it’s running under an AI coding agent (Claude Code, Cursor, and others), it automatically enables--agent-mode: structured, machine-readable errors with remediation hints and token-efficient TOON output. The CLI is self-documenting enough that agents can discover and use the full API surface from --help alone. Use --agent-mode=false to opt out.
Generating TypeScript types
Generate anAppFeatures type definition from your feature flags for strictly-typed SDK usage:
package.json scripts to keep types in sync:
API versioning and server compatibility
REST endpoints are versioned by path prefix (/v1, /v2). Each command group targets the newest version of its endpoint; superseded versions remain available under a -vN suffix (e.g. features-v1, deprecated). When a command group advances to a newer API version, it ships as a major CLI release with a changelog callout so you can pin the prior major or switch to the explicit -vN command on your own schedule.
Self-hosted: the full command surface requires GrowthBook 4.4.0 or newer (when the v2 API shipped). On older servers, v2-backed commands return 404 — use the -v1 command variants or upgrade. GrowthBook Cloud is always current.
The CLI checks once a day for a newer version and prints a notice to stderr when an upgrade is available and compatible with the server you’re connected to. Disable with --no-update-check or GBCLI_NO_UPDATE_CHECK=1.
Detailed command reference
See the generated command documentation on GitHub , or rungrowthbook --help — every command’s full usage, flags, and examples are built in.
