agent-statsig

Statsig feature flag CLI for AI agents

Language
Go
Version
0.3.0
License
MIT
Category
CLI Tool

A Statsig CLI for managing feature gates, dynamic configs, experiments, segments, and tags from the command line. Structured JSON output optimized for LLM consumption, with full CRUD, lifecycle management, and rule manipulation.

Features

01

Five entity types — feature gates, dynamic configs, experiments, segments, tags

02

Full CRUD + lifecycle — create, read, update, delete, enable, disable, archive

03

Rule manipulation — add, update, and remove targeting rules with criteria validation

04

Tag management — CRUD for tags and --tag flag on entity create/update

05

JSON Schema validation — dynamic config return values validated client-side

06

Structured output — JSON/YAML/NDJSON with classified errors (fixable_by: agent|human|retry)

07

Secure credential storage — macOS Keychain integration, multi-project support

08

Progressive documentation — top-level, per-entity reference, and criteria discovery

09

Single compiled Go binary — no runtime dependencies

Install

Homebrew

>_
$ brew install shhac/tap/agent-statsig

AI Agent Skill

>_
$ npx skills add shhac/agent-statsig

GitHub Release (macOS)

>_
$ curl -L https://github.com/shhac/agent-statsig/releases/latest/download/agent-statsig-darwin-arm64.tar.gz | tar xz

Go Install

>_
$ go install github.com/shhac/agent-statsig/cmd/agent-statsig@latest

Build from Source

>_
$ git clone https://github.com/shhac/agent-statsig.git && cd agent-statsig && make build

Getting Started

agent-statsig needs a Statsig Console API key before it can manage feature flags. Store credentials per project for multi-project support.

01 · Add your Statsig project

>_
$ agent-statsig project add myapp --console-key console-YOUR_KEY

Console API keys are required for management. Pass --client-key as well for gate evaluation (gate check). Keys are stored in macOS Keychain when available.

02 · Test the connection

>_
$ agent-statsig project test

03 · List feature gates

>_
$ agent-statsig gate list

Default output is JSON; pass --format jsonl for line-per-record streaming.

Usage

>_ List feature gates
$ agent-statsig gate list
>_ Check gate status for a user
$ agent-statsig gate check my_feature --user '{"userID":"user123"}'
>_ Create a new gate
$ agent-statsig gate create new_feature --description "Enable new checkout flow"
>_ Add a targeting rule
$ agent-statsig gate rule add new_feature --name "Beta users" --criteria user_id --value user1 --value user2
>_ List experiments
$ agent-statsig experiment list
>_ Get dynamic config
$ agent-statsig config get pricing_tiers