@flagpilot/cli
v1.0.1
Published
Official CLI for FlagPilot — manage feature flags from your terminal.
Downloads
31
Maintainers
Readme
@flagpilot/cli
Official command-line interface for FlagPilot — manage feature flags directly from your terminal.
Installation
npm install -g @flagpilot/cliVerify the installation:
flagpilot --versionLogin
Authenticate with your FlagPilot secret API key:
flagpilot login <your-api-key>Your key is stored locally at ~/.flagpilotrc.json. You can also set the FLAGPILOT_SECRET_KEY environment variable instead.
Initialize Project
Point the CLI at your FlagPilot API endpoint (defaults to the hosted service):
export FLAGPILOT_SECRET_KEY=fk_secret_xxxxxxxxxxxxxxxxOnce authenticated, all commands target the project associated with your API key.
Common Commands
List all flags
flagpilot listCreate a flag
flagpilot create checkout-v2 --description "New checkout flow"Toggle a flag
flagpilot toggle checkout-v2 on
flagpilot toggle checkout-v2 offSet rollout percentage
flagpilot set checkout-v2 --rollout 25List stale flags
flagpilot stale
flagpilot stale --environment production --status needs_review
flagpilot stale --jsonManage target users
flagpilot users add checkout-v2 usr_beta_1
flagpilot users remove checkout-v2 usr_beta_1
flagpilot users list checkout-v2Authentication
The CLI authenticates using a FlagPilot secret API key. You can provide it in two ways:
Login command — stored in
~/.flagpilotrc.json:flagpilot login fk_secret_xxxxxxxxxxxxxxxxEnvironment variable — useful in CI/CD:
export FLAGPILOT_SECRET_KEY=fk_secret_xxxxxxxxxxxxxxxx
The CLI checks for a stored key first, then falls back to the environment variable.
Documentation
Full documentation is available at tryflagpilot.com/docs.
License
MIT
