Skip to content

tommed/ducto-featureflags

A part of Project Ducto

Ducto Feature Flags

CI codecov

Lightweight, embeddable, and pluggable OpenFeature compatible feature flag engine for Go. Designed for pipelines, microservices, and event-driven systems.


✨ What is Ducto Feature Flags?

ducto-featureflags is a minimalist feature flag manager built in Go. It was designed as a reusable component for:

  • Data transformation pipelines (like Ducto)
  • Serverless functions
  • Microservices and APIs
  • CLI tools and test harnesses

It supports both static file-based flags and dynamic backends, and can be used as:

Please note that whilst Ducto Feature Flags is compatible with OpenFeature, it is not compliant with flagd because we support nested conditional statements, which cannot be reduced to flagd's simpler conditional system. Once flagd can support nested conditionals like 'and' and 'or', we will provide support.


✅ Features

  • 🔍 Evaluate flags at runtime
  • 🧩 Simple JSON/YAML flag format
  • ♻️ Optional hot-reloading (fsnotify)
  • 🤝 OpenFeature compatible
  • 🌐 Future: HTTP / Redis / Consul backends
  • 🔓 MIT licensed and reusable in other OSS projects

View the Specifications here.


🔧 Example Flag File

The simplest possible flag file is static like so:

{
  "ui": {
    "variants": {
      "beta": true,
      "stable": false
    },
    "defaultVariant": "stable"
  }
}

To make this more dynamic, you can add rules based on an EvalContext:

{
    "new_ui": {
      "variants": {
        "beta": true,
        "stable": false
      },
      "defaultVariant": "stable",
      "rules": [
        { "if": { "env": "prod", "group": "beta" }, "variant": "beta" },
        { "if": { "env": "prod" }, "variant": "stable" }
      ]
    }
}

You can also make use of YAML files, like this example here.


🧑‍💻 Usage (SDK)

store, err := featureflags.NewStoreFromFile("flags.json")
// assert no error

if store.IsEnabled("new_ui", featureflags.EvalContext{}) {
    // Enable experimental flow
}

📦 Use as an OpenFeature Provider

go get -u github.com/tommed/ducto-featureflags

Check our OpenFeature example here


📦 Install CLI

go install github.com/tommed/ducto-featureflags/cmd/ducto-flags@latest

CLI Usage

# Check if a single flag is enabled
ducto-flags -file flags.json -key new_ui -ctx env=prod -ctx region=EU

# Print all flags
ducto-flags -file flags.json -list

# Host a flags server (optional auth token)
ducto-flags serve -file flags.json [-token secret-123]

🛠️ Planned Backends

  • JSON file
  • YAML file
  • HTTP endpoint
  • OpenFeature compatibility
  • OpenFeature provider
  • Redis
  • Google Firestore
  • Env var overrides
  • Versioned flag API with auditing

🤖 Part of the Ducto Ecosystem

  • ducto-dsl – declarative data transformation engine
  • ducto-orchestrator – pluggable streaming runtime
  • ducto-featureflags – this repo

🧰 License

  • Code licensed under MIT
  • Logos and illustrations (and their likeness) are (c) Copyright 2025 Tom Medhurst, all rights reserved.