| name | statsig-cli |
| description | Query and manage Statsig gates, experiments, configs, layers, metrics, and segments. Wraps the Statsig MCP server with auto-auth via AWS Secrets Manager. Use when the user wants to check gate/experiment status, list experiments, view results, search Statsig, get audit logs, or update gates/experiments. Triggers: "statsig gate", "list experiments", "experiment results", "statsig audit log", "who changed this gate", "check gate", "search statsig".
|
statsig-cli
CLI for querying and managing Statsig resources. Wraps the Statsig first-party
MCP server (https://api.statsig.com/v1/mcp) with automatic authentication
via AWS Secrets Manager.
Setup
No API key needed. The CLI auto-fetches a token from AWS Secrets Manager using
access aws exec dev-admin. Token is cached for 1 hour at
~/.config/statsig-cli/token. Override with STATSIG_API_TOKEN env var.
Run command -v statsig before use. If it is unavailable, install the local source with cargo install --path ~/code/statsig-cli. The installed binary is normally at ~/.cargo/bin/statsig.
Commands
Search
statsig search "multiplayer"
statsig search "my_experiment_name"
List resources
statsig list gates --limit 10
statsig list experiments --status active --limit 50
statsig list experiments --tag my-team
statsig list configs
statsig list layers
statsig list metrics
statsig list segments
Get resource details
statsig get gate my_feature_gate
statsig get experiment my_ab_test
statsig get config my_dynamic_config
statsig get metric my_metric_name
statsig get segment my_segment
For gate and experiment, the output also includes user overrides
(passing/failing userIDs and per-environment overrides for gates;
segment/group overrides and user-ID overrides for experiments). The
overrides come from a separate Console API call (/console/v1/.../overrides)
that's merged into the main response — if that call fails, the rest of the
output still renders.
Experiment results (pulse)
statsig results my_experiment --control "Control" --test "Test"
Audit logs
statsig audit-logs --limit 10
statsig audit-logs --after 2025-01-01 --before 2025-03-01
statsig audit-logs --tag my-team
Update resources
These calls fully replace the gate/experiment — any field omitted from the body gets wiped. Always start by fetching the current data object, edit it, then submit.
Body sources, in priority order:
- inline
<BODY> arg
--body-file <PATH> (- for stdin)
- piped stdin (when not a TTY)
statsig get gate my_gate --json | jq '.data' > body.json
$EDITOR body.json
statsig update-gate my_gate --body-file body.json --dry-run
statsig update-gate my_gate --body-file body.json
cat body.json | statsig update-gate my_gate --dry-run
cat body.json | statsig update-experiment my_experiment
statsig update-gate my_gate '{"isEnabled": true, "rules": [...]}'
--dry-run fetches the current resource, runs diff -u against the proposed body, and exits without sending. Use it before any non-trivial change.
Debug
statsig tools
Output
- Default: JSON from the Statsig API
--json: same but explicitly requested (for scripting clarity)
Notes
- For investigating incidents (correlating Statsig changes with deploys), use
darren:statsig-history which queries Datadog events
- Token auto-refreshes after 1 hour via AWS Secrets Manager
- Max 100 results per list query (Statsig API limit)