Flagsmith CLI
The Flagsmith CLI lets you manage flags, segments, features, projects and environments from your terminal, and evaluate flags the way an SDK would. This enables CI/CD, scripting, and development workflows use cases.
The Flagsmith CLI V2 is currently in open beta. We're excited for you to try it and provide any feedback via GitHub Issues.
Looking for the previous npm-based CLI (@flagsmith/cli)? Its documentation has moved to
Legacy CLI.
Installation
Install with the install script:
curl -fsSL https://raw.githubusercontent.com/Flagsmith/flagsmith-cli/main/install.sh | sh
This installs the binary to $HOME/.local/bin and adds it to your PATH.
On Windows:
irm https://raw.githubusercontent.com/Flagsmith/flagsmith-cli/main/install.ps1 | iex
You can also install with Go, run it via Docker, or download a pre-built archive from GitHub Releases. See the README for all installation options.
Quickstart
flagsmith init # log in, pick a project + environment, write flagsmith.json
flagsmith flag list # list the flags in the current environment
Usage
The CLI covers flags, segments, features, organisations, projects, environments, SDK-style flag evaluation, and raw API access. A few examples:
flagsmith flag enable my_feature # toggle a flag in the current environment
flagsmith evaluate --identity some_user # the flags an SDK would resolve for an identity
flagsmith environment document # output the local-evaluation environment document
flagsmith api /projects/ # call any Flagsmith endpoint with the CLI's credentials
Common conventions:
--jsonfor machine-readable output;--jq <expr>to filter it.- Static credentials:
FLAGSMITH_API_KEY(Admin API) orFLAGSMITH_ENVIRONMENT_KEY(SDK). - Self-hosted:
--api-urlorFLAGSMITH_API_URL.
For the full command reference, see the README.