CLI

CLI Installation

2 min read

The FlagPilot CLI provides environment toggling, project setups, and configuration replication directly from your local terminal session.

Global CLI Installation

Install the CLI module globally via npm:

Terminal
npm install -g @flagpilot/cli

@flagpilot/cli is published on npm. Verify the installation:

Terminal
flagpilot --version

Login Authentication

Authorize the CLI tool using your dashboard's API key:

Terminal
flagpilot login

Or pass the key directly as an argument. Your key is stored locally at ~/.flagpilotrc.json:

Terminal
flagpilot login fk_secret_xxxxxxxxxxxxxxxx

You can also authenticate via an environment variable instead — useful in CI/CD:

Terminal
export FLAGPILOT_SECRET_KEY=fk_secret_xxxxxxxxxxxxxxxx

Initialize Project

Connect the local folder context to a specific project:

Terminal
flagpilot init

Common Commands

  • flagpilot flags list — View all flags in the active project.
  • flagpilot toggle <key> — Flip a flag's evaluation state.
  • flagpilot stale — List unused or dead flags.
  • flagpilot list — List all flags.
  • flagpilot create checkout-v2 --description "New checkout flow" — Create a new flag.
  • flagpilot toggle checkout-v2 on / flagpilot toggle checkout-v2 off — Turn a flag on or off.
  • flagpilot set checkout-v2 --rollout 25 — Set the rollout percentage.
  • flagpilot stale --environment production --status needs_review / flagpilot stale --json — Filter stale flags or output as JSON.
  • flagpilot users add checkout-v2 usr_beta_1 / flagpilot users remove checkout-v2 usr_beta_1 / flagpilot users list checkout-v2 — Manage target users.

FAQ

How does CLI Installation interact with local caches?

Configurations are synced down using Edge Config or fallback REST triggers. The client automatically reads evaluations in-memory, resulting in sub-millisecond local evaluation times.

Where can I obtain support for CLI Installation?

You can open a support ticket in your dashboard, check the community roadmap, or consult the FlagPilot Platform Status page.

Was this page helpful?