agent-statsig

Statsig feature flag CLI for AI agents

Language
Go
Version
0.2.0
License
MIT
Category
CLI Tool

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

Features

01

Four entity types — feature gates, dynamic configs, experiments, segments

02

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

03

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

04

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

05

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

06

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

07

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

08

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 --api-key console-YOUR_KEY

API keys are stored in macOS Keychain when available. Use Console API keys, not client/server SDK keys.

02 · Test the connection

>_
$ agent-statsig project test

03 · List feature gates

>_
$ agent-statsig gate list

Returns NDJSON by default for token-efficient streaming.

Usage

>_ List feature gates
$ agent-statsig gate list
>_ Check gate status for a user
$ agent-statsig gate check my_feature --user-id 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 --type user_id --values user1,user2
>_ List experiments
$ agent-statsig experiment list
>_ Get dynamic config
$ agent-statsig config get pricing_tiers