Skip to content

[Feedback Requested] [Community Tooling] Introducing flagctl: Ergonomic CLI for flagd & OpenFeature GitOps Feature Flag Workflows #565

Description

@khan-rasul

Summary

Hi OpenFeature & flagd maintainers,

I have built and released flagctl, an open-source CLI tool designed to simplify managing flagd feature flag configurations (flags.json / flags.yaml) for GitOps workflows.

Motivation

CNCF OpenFeature and flagd provide a vendor-neutral specification and high-performance in-process evaluation engine. However, manually authoring and maintaining flags.json or flags.yaml in Git repositories—especially managing complex JsonLogic targeting rules, progressive percentage rollouts, and multi-language code cleanup—can be error-prone for development teams.

flagctl provides an ergonomic CLI interface to safely create, update, target, ramp, deprecate, audit, and generate code accessors for flagd configurations.

Key Capabilities

  • Progressive Feature Launches (flagctl launch): Ramp feature percentages up/down (flagctl launch ramp --percent 50), configure multi-variant splits, or run cohort-specific progressive launches with spec-compliant Bucket ID support ({ "var": "<bucketId>" }).
  • Ordered Rule Targeting (flagctl target): Configure allowlists, denylists, and SemVer version gates with automatic tier-based priority ordering and overlap analysis hints.
  • Immutable Flag Keys: Enforces flag key immutability to prevent telemetry fragmentation and broken runtime references.
  • Safe 2-Stage Deprecation: flagctl deprecate tags flags as deprecated while preserving state: ENABLED to prevent runtime FLAG_NOT_FOUND errors while freezing further edits.
  • Code-Aware Deletion Guard: flagctl delete scans source code (TypeScript, Go, Python, Java, C#, PHP, Rust) and blocks flag removal if active code references exist.
  • Codebase Auditor: flagctl audit scans source code for missing flags, orphaned flags, and uncleaned deprecated flags (includes --strict mode for CI/CD pipelines).
  • Type-Safe Accessors: flagctl generate produces strongly-typed wrapper accessors for TypeScript and Go for compile-time flag safety.
  • Offline Schema Registry: Embedded versioned JSON schemas (v0) enable validation without internet access.

Usage Example

# 1. Initialize flagctl workspace
flagctl init --language typescript

# 2. Create typed feature flag
flagctl create --key new-checkout-flow --type boolean --default on

# 3. Add Rule Targeting (Allowlist & Denylist)
flagctl target add --key new-checkout-flow --attribute email --operator endsWith --value '@company.com' --variant on
flagctl target add --key new-checkout-flow --attribute email --operator endsWith --value '@competitor.com' --variant off --top

# 4. Progressive Feature Launch
flagctl launch add --key new-checkout-flow --percent 20 --variant on
flagctl launch ramp --key new-checkout-flow --percent 50

# 5. Inspect ordered rule chain & validate schema
flagctl target list --key new-checkout-flow
flagctl validate && flagctl audit

Feedback

I would love to hear your thoughts about this and if this makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions