flagdash-cli-0.1.1 is not a library.
FlagDash CLI
Interactive terminal UI for FlagDash — manage feature flags, remote configs, AI configs, and webhooks from your terminal. Built with Rust and Ratatui.
Installation
Homebrew (macOS/Linux)
Shell script
|
npm
Cargo (build from source)
Quick Start
# Launch the TUI (prompts for API key on first run)
# Or pass options directly
On first run, enter your management API key. It will be saved to ~/.config/flagdash/config.toml.
Features
- Dashboard — Overview with flag/config/webhook/AI config counts
- Flags — List, create, edit, delete, toggle per environment, set rollout percentage, manage targeting rules, A/B variations, and schedules
- Remote Config — List, create, edit, delete, set values per environment
- AI Configs — List, create, edit, delete markdown-based AI config files with folder grouping
- Webhooks — List, create, edit, delete endpoints, view delivery logs
- Environments — View all environments (read-only)
- Search — Filter flags, configs, and AI configs with
/ - Read-only mode — Automatically detected for
client_andserver_API keys
Keyboard Shortcuts
Global
| Key | Action |
|---|---|
1-6 |
Switch sidebar sections |
j/k or ↑↓ |
Navigate lists |
Enter |
Open detail view |
Esc |
Go back |
/ |
Search/filter |
q |
Quit |
List Views
| Key | Action |
|---|---|
c |
Create new resource |
d |
Delete selected |
t |
Toggle flag (flags only) |
Detail Views
| Key | Action |
|---|---|
e |
Edit resource |
t |
Toggle flag on/off (flags only) |
r |
Edit rollout percentage (flags only) |
u |
Edit targeting rules (flags only) |
v |
Edit variations (flags) / Edit value (configs) |
s |
View schedules (flags only) |
Configuration
Config file: ~/.config/flagdash/config.toml
[]
= "management_xxx"
[]
= "https://flagdash.io"
[]
= "prj_xxx"
= "env_xxx"
Priority
CLI args > environment variables > config file
Environment Variables
| Variable | Description |
|---|---|
FLAGDASH_API_KEY |
Management API key |
FLAGDASH_BASE_URL |
API base URL (default: https://flagdash.io) |
FLAGDASH_PROJECT_ID |
Default project ID |
FLAGDASH_ENVIRONMENT_ID |
Default environment ID |
API Key Tiers
| Prefix | Tier | Permissions |
|---|---|---|
management_ |
Management | Full CRUD on all resources |
server_ |
Server | Read-only (mutations disabled in UI) |
client_ |
Client | Read-only (mutations disabled in UI) |
Development
# Build (debug)
# Build (release, optimized)
# Run
# Test
# Lint
# Format
Building & Releasing
Releases are automated via GitHub Actions. To publish a new version:
1. Bump the version
Edit Cargo.toml:
[]
= "0.2.0" # bump this
2. Tag and push
The cli-v* tag triggers the cli-release.yml workflow, which:
- Builds binaries for 6 targets (linux amd64/arm64, macOS amd64/arm64, Windows amd64/arm64)
- Creates a GitHub Release with all binaries attached
- Publishes to crates.io (
cargo publish) - Publishes npm wrapper (
@flagdash/clion npmjs.com) - Updates Homebrew formula in
flagdash/homebrew-tap
Required Secrets
| Secret | Purpose |
|---|---|
CRATES_IO_TOKEN |
Publish to crates.io |
NPM_TOKEN |
Publish @flagdash/cli to npm |
SDK_SYNC_TOKEN |
Push to flagdash/homebrew-tap repo |
Manual / Local Build
# Debug build
# Release build (optimized, stripped)
# The binary is at:
# target/release/flagdash (macOS/Linux)
# target/release/flagdash.exe (Windows)
Cross-compilation
For cross-compiling to other platforms locally, use cross:
# Linux ARM64 from macOS
# Linux AMD64 from macOS
Distribution Channels
| Channel | How it works |
|---|---|
| Homebrew | Formula in flagdash/homebrew-tap repo, auto-updated by CI on release |
| npm | Wrapper package @flagdash/cli runs a postinstall script that downloads the binary |
| crates.io | Standard cargo publish, users install with cargo install flagdash-cli |
| Shell script | install.sh detects OS/arch, downloads the binary from GitHub Releases |
| GitHub Releases | Pre-built binaries for all platforms attached to each release |
Setting Up Homebrew Tap (First Time)
- Create a repo
flagdash/homebrew-tapon GitHub - The CI workflow pushes the formula to
Formula/flagdash.rbin that repo - Users install with
brew install flagdash/tap/flagdash
Setting Up npm (First Time)
- Create the
@flagdashorg on npmjs.com - Generate an automation token, save as
NPM_TOKENsecret - The wrapper package at
sdk/flagdash-cli/dist/npm/is published by CI
Setting Up crates.io (First Time)
- Create an account on crates.io
- Generate an API token, save as
CRATES_IO_TOKENsecret - Ensure the
flagdash-clicrate name is available (or you own it)
License
MIT