Command-line interface for the GrowthBook REST API.
The recommended way to install is via npm, which installs a small launcher that downloads the prebuilt binary for your platform:
npm i -g growthbookPrefer a standalone binary with no Node.js dependency? An install script, go install, and prebuilt downloads are covered under CLI Installation below.
This CLI follows semantic versioning: breaking changes ship only in a major release and are called out in the changelog. Additive changes (new commands, flags, or response fields) are minor releases; fixes are patch releases. We recommend pinning to a version you have tested.
The CLI checks for a newer release at most once a day and prints a one-line notice to stderr (never stdout) when one is available and compatible with your server. Disable it with --no-update-check or GBCLI_NO_UPDATE_CHECK=1; it is also off automatically in CI and non-interactive shells.
Each command group targets the newest version of its API endpoint — e.g. features is the latest (v2) feature API. When a command is superseded, the previous version stays available under a version suffix (e.g. features-v1), deprecated and printing a one-line notice to stderr. When a newer API version lands, the base group advances to it and the prior version becomes the next -vN.
Because the bare command then returns the newer version's response shape, re-pointing a base command is a breaking change: it ships as a major release with the change called out in the changelog — so you can pin the prior major or move to the explicit -vN command on your own schedule.
GrowthBook REST API: A command-line interface for GrowthBook — manage feature flags, experiments, metrics, and more from your terminal.
Endpoints are versioned by path prefix: /v1 (stable) and /v2 (improved shapes). Each command group targets the newest version of its endpoint; superseded versions remain available under a -vN suffix.
Authenticate with a Secret Key or Personal Access Token via --bearer-auth (or the GBCLI_BEARER_AUTH environment variable). Run growthbook configure to store credentials, or growthbook whoami to check the active configuration.
curl -fsSL https://raw.githubusercontent.com/growthbook/cli/main/scripts/install.sh | bashiwr -useb https://raw.githubusercontent.com/growthbook/cli/main/scripts/install.ps1 | iexAlternatively, install directly via Go:
go install github.com/growthbook/cli/cmd/growthbook@latestDownload pre-built binaries for your platform from the releases page.
Shell completions are available for Bash, Zsh, Fish, and PowerShell.
# Add to ~/.bashrc:
source <(growthbook completion bash)
# Or install permanently:
growthbook completion bash > /etc/bash_completion.d/growthbook# Add to ~/.zshrc:
source <(growthbook completion zsh)
# Or install permanently:
growthbook completion zsh > "${fpath[1]}/_growthbook"growthbook completion fish | source
# Or install permanently:
growthbook completion fish > ~/.config/fish/completions/growthbook.fishgrowthbook completion powershell | Out-String | Invoke-Expressiongrowthbook get-SDK-payload --bearer-auth 'Bearer test_token' --key '<key>'
Authentication credentials can be configured in four ways (in order of priority):
Pass credentials directly as flags to any command:
growthbook --bearer-auth <value> --username <value> --password <value> <command> [arguments]Set credentials via environment variables:
| Variable | Description |
|---|---|
GBCLI_BEARER_AUTH |
Bearer auth token: your Secret Key or Personal Access Token, sent as an Authorization Bearer header. |
GBCLI_USERNAME |
HTTP Basic auth: use your GrowthBook Secret Key as the username and leave the password empty. username |
GBCLI_PASSWORD |
HTTP Basic auth: use your GrowthBook Secret Key as the username and leave the password empty. password |
Credentials are stored securely in your operating system's keychain when you run:
growthbook configureSecret credentials (tokens, API keys, passwords) are automatically stored in:
- macOS: Keychain
- Linux: GNOME Keyring / KWallet (via D-Bus Secret Service)
- Windows: Windows Credential Locker
If no keychain is available (e.g., in CI environments), credentials fall back to the config file.
Run the interactive configure command to store non-secret settings:
growthbook configureConfiguration is stored in ~/.config/growthbook/config.yaml.
Profiles let you switch between GrowthBook environments (e.g. cloud, staging, self-hosted), each with its own server URL and API key. Keys are stored in your OS keychain, not in plaintext config.
# Create or update a profile (the key comes from --bearer-auth, stored in the keychain)
growthbook profiles set staging --server-url https://gb.staging.example.com/api --bearer-auth secret_xxx
growthbook profiles use staging # make it the active profile
growthbook profiles list # show configured profiles
growthbook profiles remove staging # delete oneSelect a profile for a single command with --profile <name>, or set GBCLI_PROFILE in your environment. (Upgrading from the legacy CLI? An existing ~/.growthbook/config.toml is imported into profiles automatically on first run — see MIGRATION.md.)
generate-types fetches all of your features and writes a TypeScript AppFeatures definition, giving you type-safe feature keys and values in the GrowthBook SDK:
growthbook generate-types # → ./growthbook-types/app-features.ts
growthbook generate-types --output ./src/types --filename growthbook.ts
growthbook generate-types --project prj_123 # limit to one projectAvailable commands
get-SDK-payload- Get a SDK payloadcopy-transform
~~list~~- Get all features⚠️ Deprecated~~create~~- Create a single feature⚠️ Deprecated~~get~~- Get a single feature⚠️ Deprecated~~update~~- Partially update a feature⚠️ Deprecated~~delete~~- Deletes a single feature⚠️ Deprecated~~toggle~~- Toggle a feature in one or more environments⚠️ Deprecated~~revert~~- Revert a feature to a specific revision⚠️ Deprecated~~get-feature-keys~~- Get list of feature keys⚠️ Deprecated~~get-feature-stale~~- Get stale status for one or more features⚠️ Deprecated
~~list-revisions~~- List feature revisions⚠️ Deprecated~~list-for-feature~~- List revisions for a feature⚠️ Deprecated~~create~~- Create a draft revision⚠️ Deprecated~~get-feature-revision-latest~~- Get the most recent active draft revision⚠️ Deprecated~~get-feature-revision~~- Get a single feature revision⚠️ Deprecated~~put-feature-revision-metadata~~- Update revision metadata (comment, title, feature metadata)⚠️ Deprecated~~put-feature-revision-default-value~~- Set the default value in a draft revision⚠️ Deprecated~~put-feature-revision-prerequisites~~- Set feature-level prerequisites in a draft revision⚠️ Deprecated~~put-feature-revision-holdout~~- Set holdout in a draft revision⚠️ Deprecated~~put-feature-revision-archive~~- Set archived state in a draft revision⚠️ Deprecated~~post-feature-revision-toggle~~- Toggle an environment on/off in a draft revision⚠️ Deprecated~~post-feature-revision-rule-add~~- Add a rule to a draft revision⚠️ Deprecated~~put-feature-revision-rule~~- Update a rule in a draft revision⚠️ Deprecated~~delete-feature-revision-rule~~- Delete a rule from a draft revision⚠️ Deprecated~~post-feature-revision-rules-reorder~~- Reorder rules in an environment⚠️ Deprecated~~put-feature-revision-rule-ramp-schedule~~- Set ramp schedule for a rule⚠️ Deprecated~~delete-feature-revision-rule-ramp-schedule~~- Remove ramp schedule from a rule⚠️ Deprecated~~post-feature-revision-request-review~~- Request review for a draft revision⚠️ Deprecated~~post-feature-revision-submit-review~~- Submit a review on a draft revision⚠️ Deprecated~~get-feature-revision-merge-status~~- Get merge status for a draft revision⚠️ Deprecated~~post-feature-revision-rebase~~- Rebase a draft revision onto the current live version⚠️ Deprecated~~post-feature-revision-publish~~- Publish a draft revision⚠️ Deprecated~~post-feature-revision-discard~~- Discard a draft revision⚠️ Deprecated~~post-feature-revision-revert~~- Revert the feature to a prior revision⚠️ Deprecated
list- Get all featurescreate- Create a single featureget- Get a single featureupdate- Partially update a featuredelete- Deletes a single featuretoggle- Toggle a feature in one or more environmentsrevert- Revert a feature to a specific revisionget-feature-keys- Get list of feature keysget-feature-stale- Get stale status for one or more features
list-revisions- List revisions across all featureslist-for-feature- List revisions for a featurecreate- Create a draft revisionlatest- Get the most recent active draft revisionget- Get a single feature revisiondiff- Diff a revision against another revisionset-metadata- Update revision metadataset-default-value- Set the default value in a draft revisionset-prerequisites- Set feature-level prerequisites in a draft revisionset-holdout- Set holdout in a draft revisionarchive- Set archived state in a draft revisiontoggle- Toggle an environment on/off in a draft revisionadd-rule- Add a rule to a draft revisionupdate-rule- Update a rule in a draft revisiondelete-rule- Delete a rule from a draft revisionreorder-rules- Reorder rules in the revisionset-rule-ramp-schedule- Set ramp schedule for a ruledelete-rule-ramp-schedule- Remove ramp schedule from a rulerequest-review- Request review for a draft revisionschedule-publish- Schedule (or cancel) a deferred publish for a draft revisionsubmit-review- Submit a review on a draft revisionrecall-review- Recall a review request (revert to draft)undo-review- Undo a reviewer's own review verdictlog- List the activity log for a revisionadd-log-comment- Edit the comment text of an owned log entrydelete-log-entry- Delete an owned revision Comment entrymerge-status- Get merge status for a draft revisionrebase-preview- Preview a rebase without applying itrebase- Rebase a draft revision onto the current live versionpublish- Publish a draft revisiondiscard- Discard a draft revisionreopen- Reopen a discarded revision as a draftrevert- Revert the feature to a prior revision
list- Get the organization's archetypescreate- Create a single archetypeget- Get a single archetypeupdate- Update a single archetypedelete- Deletes a single archetype
list- Get all experimentscreate- Create a single experimentlist-results- Get latest results for many experimentsget- Get a single experimentupdate- Update a single experimentget-start-checklist- Get an experiment pre-launch checklist statusresults- Get results for an experimentstart- Start/Stage an experimentcomplete-start-checklist- Mark manual pre-launch checklist items completestop- Stop an experimentmodify-temporary-rollout- Modify temporary rollout status for a stopped experimentcreate-snapshot- Create Experiment Snapshotupload-variation-screenshot- Upload a variation screenshotdelete-variation-screenshot- Delete a variation screenshotlist-names- Get a list of experiments with names and ids
create-snapshot- Create Experiment Snapshotget-experiment- Get an experiment snapshot status
list- Get all visual changesetscreate- Create a visual changeset for an experimentget- Get a single visual changesetupdate- Update a visual changesetadd-visual-change- Create a visual change for a visual changesetupdate-visual-change- Update a visual change for a visual changeset
get-contextual-bandit-current-weights- Get current Contextual Bandit leaf weights and latest eventlist-contextual-bandit-snapshots- List Contextual Bandit snapshotsget-contextual-bandit-snapshot- Get a single Contextual Bandit snapshotlist-contextual-bandit-events- List Contextual Bandit weight-update eventsget-contextual-bandit-event- Get a single Contextual Bandit weight-update eventget-contextual-bandit-results- Get latest Contextual Bandit resultsget-contextual-bandit-linked-features- Get features linked to a Contextual Banditdelete-contextual-bandit-linked-feature- Unlink a feature from a Contextual Banditget- Get a single contextualBanditupdate- Update a single contextualBanditcreate- Create a single contextualBanditlist- Get all contextualBanditsstart- Start a Contextual Banditstop- Stop a Contextual Banditrefresh- Trigger a Contextual Bandit snapshot refresh
list- Get all metricscreate- Create a single metricget- Get a single metricupdate- Update a metricdelete- Deletes a metric
get- Get metric usage across experiments
list- Get all segmentscreate- Create a single segmentget- Get a single segmentupdate- Update a single segmentdelete- Deletes a single segment
list- Get all dimensionscreate- Create a single dimensionget- Get a single dimensionupdate- Update a single dimensiondelete- Deletes a single dimension
list- Get all projectscreate- Create a single projectget- Get a single projectupdate- Edit a single projectdelete- Deletes a single project
list- Get the organization's environmentscreate- Create a new environmentupdate- Update an environmentdelete- Deletes a single environment
list- Get the organization's attributescreate- Create a new attributeupdate- Update an attributedelete- Deletes a single attribute
list- Get all sdk connectionscreate- Create a single sdk connectionget- Get a single sdk connectionupdate- Update a single sdk connectiondelete- Deletes a single SDK connectionlookup-SDK-connection-by-key- Find a single sdk connection by its key
list- Get all data sourcesget- Get a single data sourceget-information-schema- Get a Data Source's Information Schemaget-information-schema-table- Get a single Information Schema Table by id
list- Get all saved groupcreate- Create a single saved groupget- Get a single saved groupupdate- Partially update a single saved groupdelete- Deletes a single saved grouparchive- Archive a single saved groupunarchive- Unarchive a single saved groupget-saved-group-references- Get features, experiments, and saved groups that reference this saved group
list- List saved-group revisions across the organizationlist-for-saved-group- List revisions for a saved groupcreate- Create a draft revisionlatest- Get the most recent active draft revisionget- Get a single saved group revisionset-metadata- Update saved group metadata in a draft revisionset-condition- Update the condition of a condition saved group draft revisionset-values- Replace the values list in a list saved group draft revisionarchive- Stage an archive/unarchive in a draft revisionadd-items- Append items to a list saved group draft revisionremove-items- Remove items from a list saved group draft revisionrequest-review- Request review for a draft revisionsubmit-review- Submit a review on a draft revisionmerge-status- Get merge status for a draft revisionrebase- Rebase a draft revision onto the current live saved grouppublish- Publish a draft revisiondiscard- Discard a draft revisionrevert- Revert the saved group to a prior revision
list- Get all constantscreate- Create a single constantget-references- Get features and constants that reference this constantget- Get a single constantupdate- Partially update a single constantdelete- Delete a single constantarchive- Archive a single constantunarchive- Unarchive a single constant
list- List constant revisions across the organizationlist-for-constant- List revisions for a constantcreate- Create a draft revisionlatest- Get the most recent active draft revisionget- Get a single constant revisionset-metadata- Update constant metadata in a draft revisionset-value- Update the value of a constant draft revisionarchive- Stage an archive/unarchive in a draft revisionrequest-review- Request review for a draft revisionsubmit-review- Submit a review on a draft revisionmerge-status- Get merge status for a draft revisionrebase- Rebase a draft revision onto the current live constantpublish- Publish a draft revisiondiscard- Discard a draft revisionrevert- Revert the constant to a prior revision
list- Get all configscreate- Create a single configget-references- Get features and configs that reference this configget-key-usage- Get the feature rules and default values implementing each keyget-lineage- Get the full lineage (family tree) for a configverify-schema- Verify a config's schema against a source (drift check)get-schema- Export a config's schemaget- Get a single configupdate- Partially update a single configdelete- Delete a single configarchive- Archive a single configunarchive- Unarchive a single configlock- Lock a config at its current published revisionunlock- Unlock a config
list- List config revisions across the organizationlist-for-config- List revisions for a configcreate- Create a draft revisionlatest- Get the most recent active draft revisionget- Get a single config revisionset-metadata- Update config metadata in a draft revisionset-value- Update the value of a config draft revisionset-schema- Update or import the schema of a config draft revisionset-projection- Set (or update) a config's per-source render projection on a draftdelete-projection- Remove a config's per-source render projection on a draftarchive- Stage an archive/unarchive in a draft revisionrequest-review- Request review for a draft revisionsubmit-review- Submit a review on a draft revisionrecall-review- Recall a review requestreopen- Reopen a discarded revisionschedule-publish- Schedule (or cancel) a deferred publishmerge-status- Get merge status for a draft revisionrebase- Rebase a draft revision onto the current live configpublish- Publish a draft revisiondiscard- Discard a draft revisionrevert- Revert the config to a prior revision
list- Get all custom hookscreate- Create a single custom hooktest- Dry-run hook code in the sandboxget- Get a single custom hookupdate- Partially update a single custom hookdelete- Delete a single custom hooklist-history- List a custom hook's version historyrevert- Revert a custom hook to a previous version
list- Get all organizations (only for super admins on multi-org Enterprise Plan only)create- Create a single organization (only for super admins on multi-org Enterprise Plan only)update- Edit a single organization (only for super admins on multi-org Enterprise Plan only)
list- Get all fact tablescreate- Create a single fact tableget- Get a single fact tableupdate- Update a single fact tabledelete- Deletes a single fact tablelist-filters- Get all filters for a fact tablecreate-filter- Create a single fact table filterget-filter- Get a single fact filterupdate-filter- Update a single fact table filterdelete-filter- Deletes a single fact table filterget-aggregated- Get the materialization status of a fact table's shared daily aggregated tablesrefresh-aggregated- Force a refresh or full restate of a fact table's shared daily aggregated tableslist-aggregated-table-runs- List aggregated table runsget-aggregated-table-run- Get a single aggregated table runbulk-import- Bulk import fact tables, filters, and metrics
list- Get all fact metricscreate- Create a single fact metricget- Get a single fact metricupdate- Update a single fact metricdelete- Deletes a single fact metriccreate-analysis- Create a fact metric analysis
submit- Submit list of code referenceslist- Get list of all code references for the current organizationget-for-feature- Get list of code references for a single feature id
list- Get all organization membersupdate-member-role- Update a member's global role (including any enviroment restrictions, if applicable). Can also update a member's project roles if your plan supports it.delete- Removes a single user from an organization
get-query- Get a single query
get- Get organization settings
get-version- Get the GrowthBook server version and build info
list- Get all rampSchedulescreate- Create a ramp schedulestart- Start a ramp schedulepause- Pause a ramp scheduleresume- Resume a paused ramp schedulerollback- Roll back a ramp schedulerestart- Restart a terminal ramp schedulejump- Jump to a specific stepcomplete- Complete a ramp schedule immediatelyapprove-step- Approve the pending approval gateadd-target- Add a target rule to a ramp scheduleeject-target- Remove a target rule from a ramp scheduleapi-advance- Advance to the next step, overriding any holdsget-ramp-schedule-status- Get ramp schedule status summaryset-monitoring-mode- Set ramp monitoring modeset-auto-update- Toggle automatic monitoring updatesupdate-ramp-schedule-monitoring- Update ramp monitoring configurationupdate-ramp-schedule-lockdown- Update ramp lockdown configurationupdate-ramp-schedule-steps- Update ramp schedule stepsrefresh-monitoring- Trigger a manual monitoring updateget- Get a single rampScheduledelete- Delete a single rampScheduleupdate- Update a single rampSchedule
list- Get all reportscreate- Create a new reportget- Get a single reportrefresh- Refresh a report by re-running its analysisset-metadata- Update report metadata (title, description, visibility)set-settings- Update report analysis settings
list- Get all namespacescreate- Create a namespaceget- Get a single namespaceupdate- Update a namespacedelete- Delete a namespaceget-memberships- Get namespace membershiprotate-seed- Rotate namespace seed
get- Get a single dashboarddelete- Delete a single dashboardupdate- Update a single dashboardcreate- Create a single dashboardlist- Get all dashboardslist-for-experiment- Get all dashboards for an experiment
get-contextual-bandit-query- Get a single contextualBanditQuerydelete-contextual-bandit-query- Delete a single contextualBanditQueryupdate-contextual-bandit-query- Update a single contextualBanditQuerycreate-contextual-bandit-query- Create a single contextualBanditQuerylist- Get all contextualBanditQueries
create- Create a single customFieldlist- Get all custom fieldsdelete- Delete a single customFieldget- Get a single customFieldupdate- Update a single customField
get- Get a single metricGroupdelete- Delete a single metricGroupupdate- Update a single metricGroupcreate- Create a single metricGrouplist- Get all metricGroups
get- Get a single teamupdate- Update a single teamdelete- Delete a single teamcreate- Create a single teamlist- Get all teamsadd-team-members- Add members to teamremove-team-member- Remove members from team
get- Get a single experimentTemplatedelete- Delete a single experimentTemplateupdate- Update a single experimentTemplatecreate- Create a single experimentTemplatelist- Get all experimentTemplatesbulk-import- Bulk create or update experiment templates
run-metric- Create a Metric based visualizationrun-fact-table- Run a Fact Table based visualizationrun-data-source- Create a Data Source based visualization
Operations that accept a request body support three input methods, with a clear priority chain:
growthbook <command> --name "Jane" --age 30Provide the entire request body as a JSON string:
growthbook <command> --body '{"name": "John", "age": 30}'Individual flags override --body values:
# Result: {name: "Jane", age: 30}
growthbook <command> --body '{"name": "John", "age": 30}' --name "Jane"Pipe JSON into any command that accepts a request body:
echo '{"name": "John", "age": 30}' | growthbook <command>Individual flags override stdin values:
# Result: {name: "Jane", age: 30}
echo '{"name": "John", "age": 30}' | growthbook <command> --name "Jane"This is useful for chaining commands, reading from files, or scripting:
# Read body from a file
growthbook <command> < request.json
# Pipe from another command
curl -s https://example.com/data.json | growthbook <command>When multiple input methods are used, the priority is:
| Priority | Source | Description |
|---|---|---|
| 1 (highest) | Individual flags | --name "Jane" always wins |
| 2 | --body flag |
Whole-body JSON via flag |
| 3 (lowest) | Stdin | Piped JSON input |
Use --server <index> to select a server by its zero-based index (default: 0):
| # | Server | Variables | Description |
|---|---|---|---|
| 0 | https://api.growthbook.io/api |
GrowthBook Cloud | |
| 1 | https://{domain}/api |
domain |
Self-hosted GrowthBook |
growthbook --server <index> <command> [arguments]Some server URLs contain template variables (e.g., https://{hostname}:{port}/v1). Set these via dedicated flags:
| Variable | Flag | Default | Description |
|---|---|---|---|
domain |
--domain <value> |
"localhost:3100" |
Your self-hosted GrowthBook host (and port) |
growthbook --domain value <command> [arguments]Server variable flags are combined with the selected server URL to produce the final endpoint.
Use --server-url to override the server URL entirely, bypassing any named or indexed server selection:
growthbook --server-url https://custom-api.example.com <command> [arguments]Precedence: --server-url > --server > default
Every command supports a --output-format flag that controls how the response is rendered to stdout.
| Format | Flag | Description |
|---|---|---|
| Pretty | --output-format pretty (default) |
Aligned key-value pairs with color, nested indentation. Human-readable at a glance. |
| JSON | --output-format json |
JSON output. Passthrough when the response is already JSON (preserves original field order and numeric precision). Falls back to typed marshaling otherwise. |
| YAML | --output-format yaml |
YAML output via standard marshaling. |
| Table | --output-format table |
Tabular output for array responses. |
| TOON | --output-format toon |
Token-Oriented Object Notation — a compact, line-oriented format that typically uses 30–60% fewer tokens than JSON. Well-suited for piping responses into LLM prompts. |
# Default pretty output
growthbook <command>
# Machine-readable JSON
growthbook <command> --output-format json
# TOON for LLM-friendly compact output
growthbook <command> --output-format toon
# Pipe JSON to jq without using --output-format
growthbook <command> --output-format json | jq '.fieldName'Use --jq to filter or transform the response inline using a jq expression. This always outputs JSON and overrides --output-format:
# Extract a single field
growthbook <command> --jq '.name'
# Filter an array
growthbook <command> --jq '.items[] | select(.active == true)'Use --color to control terminal colors:
| Value | Behavior |
|---|---|
auto (default) |
Color when stdout is a TTY, plain text otherwise |
always |
Always colorize |
never |
Never colorize |
The NO_COLOR and FORCE_COLOR environment variables are also respected.
When using --all (pagination) or streaming operations, output is written incrementally as items arrive:
| Format | Streaming behavior |
|---|---|
json |
One compact JSON object per line (NDJSON) |
yaml |
YAML documents separated by --- |
toon |
One TOON-encoded object per block, separated by blank lines |
pretty (default) |
Pretty-printed items separated by blank lines |
Some operations in this CLI support automatic pagination. These operations accept --all to automatically fetch all pages and stream results incrementally.
# Fetch a single page (default behavior)
growthbook <command> --page 1
# Automatically fetch all pages
growthbook <command> --allUse --max-pages to cap the number of pages fetched:
# Fetch at most 5 pages
growthbook <command> --all --max-pages 5When using --all, results are streamed as each page is fetched:
| Format | Behavior |
|---|---|
--output-format json |
One JSON object per line (NDJSON) |
--output-format yaml |
YAML documents separated by --- |
--output-format toon |
One TOON-encoded block per item, separated by blank lines |
| Default (pretty) | Pretty-printed items separated by blank lines |
# Stream all results as NDJSON
growthbook <command> --all --output-format json
# Pipe to jq for further processing
growthbook <command> --all --output-format json | jq '.fieldName'
# Use the built-in --jq flag
growthbook <command> --all --jq '.fieldName'Under the hood, --all calls the operation once, then follows the underlying Next() pagination closure to fetch subsequent pages. Results are written to stdout as they arrive rather than buffered in memory, so this works well even with large result sets.
Without --all, paginated operations behave like any other command — pass cursor, page, offset, or limit flags manually and get a single page of results.
The CLI uses standard exit codes to indicate success or failure:
| Exit Code | Meaning |
|---|---|
0 |
Success |
1 |
Error (API error, invalid input, etc.) |
On success, the response data is printed to stdout as JSON. On failure, error details are printed to stderr.
# Capture output and handle errors
growthbook ... > output.json 2> error.log
if [ $? -ne 0 ]; then
echo "Error occurred, see error.log"
fiThe CLI includes two diagnostic flags available on all commands:
Preview what would be sent without making any network calls:
growthbook <command> --dry-runOutput goes to stderr and includes:
- HTTP method and URL
- Request headers (sensitive values redacted)
- Request body preview (sensitive fields redacted)
The command exits successfully without contacting the API. This is useful for verifying request construction before executing.
Log request and response diagnostics while running normally:
growthbook <command> --debugDebug output goes to stderr and includes:
- Request method, URL, headers, and body preview
- Response status, headers, and body preview
- Transport errors (if any)
The command still executes normally and produces its regular output on stdout.
If both --dry-run and --debug are set, --dry-run takes precedence and no network calls are made.
Sensitive information is automatically redacted in diagnostic output:
- Headers:
Authorization,Cookie,Set-Cookie,X-API-Key, and other security headers show[REDACTED] - Body: JSON fields named
password,secret,token,api_key,client_secret, etc. show[REDACTED]
Diagnostic output should still be treated as potentially sensitive operational data.
This CLI follows semantic versioning and a stable command-versioning convention — see Versioning and stability at the top of this README. We recommend pinning to a version you have tested.
While we value open-source contributions to this CLI, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.