Was this helpful?
# Initialize Reflag in your project (if not already setup)
npx reflag init
# Create a new flag
npx reflag flags create "My Flag"
# Generate TypeScript types for your flags
npx reflag flags types{
"$schema": "https://unpkg.com/@reflag/cli@latest/schema.json",
"baseUrl": "https://app.reflag.com",
"apiUrl": "https://app.reflag.com/api",
"appId": "ap123456789",
"typesOutput": [
{
"path": "gen/flags.d.ts",
"format": "react"
}
]
}npx reflag init [--overwrite]npx reflag new "My Flag" [--app-id ap123456789] [--key my-flag] [--key-format custom] [--out gen/flags.ts] [--format react]npx reflag loginnpx reflag logoutnpx reflag flags create "My Flag" [--app-id ap123456789] [--key my-flag] [--key-format custom]npx reflag flags list [--app-id ap123456789]npx reflag flags types [--app-id ap123456789] [--out gen/flags.ts] [--format react]npx reflag rules [--format <cursor|copilot>] [--yes]npx reflag mcp [--editor <editor>] [--scope <local|global>]# Generate types in CI/CD
npx reflag apps list --api-key $REFLAG_API_KEY# GitHub Actions example
- name: Generate types
run: npx reflag flags types --api-key ${{ secrets.REFLAG_API_KEY }}
# GitHub Actions example (using environment):
- name: Generate types (environment)
run: npx reflag flags types
env:
REFLAG_API_KEY: ${{ secrets.REFLAG_CI_API_KEY }}# Build the CLI
yarn build
# Run the CLI locally
yarn reflag [command]
# Lint and format code
yarn lint
yarn format