FlipFlag CLI is a lightweight command-line tool for managing feature flags and tracking development tasks directly in your repository.
- π Task Management: Start and stop work sessions with time tracking
- π Flag Synchronization: Upload feature flags to FlipFlag platform
- πΏ Git Integration: Automatically create/switch Git branches
- β±οΈ Time Tracking: Record when features are being worked on
- π₯ Team Collaboration: Store contributor information from Git
- π CI/CD Ready: Integrate with GitLab, GitHub Actions, CircleCI, and more
FlipFlag CLI stores all data in a local .flipflag.yml file, making it easy to version control your feature flags alongside your code.
Install globally:
npm install -g @flipflag/cliOr install locally:
npm install @flipflag/cli --save-devRun with:
flipflagThis file is created automatically when you run the first flipflag start command.
Example:
TASK-1:
description: ""
contributor: "dev@example.com"
type: "feature"
times:
- started: "2025-01-01T10:00:00.000Z"
finished: "2025-01-01T12:30:00.000Z"
- started: "2025-01-02T09:00:00.000Z"
finished: nullFlipFlag CLI provides three main commands:
start- Start working on a taskstop- Stop working on a tasksync- Upload feature flags to FlipFlag API
flipflag start TASK-1If TASK-ID is missing, the CLI will ask you to enter it interactively.
During startup, you may be prompted to choose:
- task type (
featureorbugfix) - whether to create/switch to a Git branch
- whether to enable time tracking
flipflag start TASK-2 --type=bugfix --branch --timeflipflag start TASK-3 --no-timeStops the last open time interval:
flipflag stop TASK-1If the ID is omitted, you will be asked to enter it.
If the --branch flag is enabled:
featureβ creates/uses branch:feature/TASK-IDbugfixβ creates/uses branch:bugfix/TASK-ID
Behavior:
- if branch exists β switches to it
- if branch does not exist β creates it and switches to it
If --time is enabled, then flipflag start will:
- create a time entry with
{ started, finished: null }; - wait until you press Enter;
- write the
finishedtimestamp.
Example:
flipflag start TASK-5
# ...work...
# press Enter to stop tracking| Flag | Description |
|---|---|
--type=feature / --type=bugfix |
Task type |
--branch |
Create/switch Git branch |
--no-branch |
Do not touch Git branches |
--time |
Enable time tracking |
--no-time |
Disable time tracking |
flipflag stop TASK-IDCloses the latest unfinished time interval.
Upload feature flags from .flipflag.yml to FlipFlag platform:
flipflag sync --private-key "your_private_key"export FLIPFLAG_PRIVATE_KEY="your_private_key"
flipflag sync| Option | Environment Variable | Description | Required |
|---|---|---|---|
--private-key KEY |
FLIPFLAG_PRIVATE_KEY |
Private API key | β Yes |
--public-key KEY |
FLIPFLAG_PUBLIC_KEY |
Public API key | β No |
--api-url URL |
FLIPFLAG_API_URL |
API endpoint | β No |
--config PATH |
- | Config file path | β No |
# Basic sync
export FLIPFLAG_PRIVATE_KEY="priv_abc123..."
flipflag sync
# Custom config file
flipflag sync --config .flipflag.production.yml
# Self-hosted API
flipflag sync --api-url "https://flipflag.your-company.com"GitLab CI/CD:
sync-features:
stage: sync
image: node:20-alpine
only:
- main
script:
- npm install -g @flipflag/cli
- flipflag sync --private-key "$FLIPFLAG_PRIVATE_KEY"GitHub Actions:
- name: Sync Feature Flags
run: |
npm install -g @flipflag/cli
flipflag sync --private-key "${{ secrets.FLIPFLAG_PRIVATE_KEY }}"π Complete CI/CD Guide: See CLI_SYNC.md for detailed integration examples with GitLab, GitHub Actions, CircleCI, Jenkins, and Azure Pipelines.
flipflag helpflipflag start TASK-10 --type=feature --branch --time
# press Enter when done...
flipflag stop TASK-10flipflag start TASK-21 --no-time --no-branchIf Git email is not configured, Flipflag will use:
FLIPFLAG_USER="myname@example.com"
npx flipflag start TASK-1- Feature Flag Sync Guide - Complete guide for syncing flags and CI/CD integration
- CI/CD Examples - Ready-to-use configurations for various platforms
- FlipFlag SDK - Client SDK for feature flag management
- Website: https://flipflag.dev
- Dashboard: https://cloud.flipflag.dev
- Documentation: https://docs.flipflag.dev
- GitHub: https://github.com/flipflag-dev/cli
- NPM: https://www.npmjs.com/package/@flipflag/cli
MIT
Made with β€οΈ by the FlipFlag team