feature-flags

Featured

Creating and using feature flags in sidecar for gating experimental functionality. Covers flag registration, checking flags in code, config file and CLI overrides, and priority resolution. Use when adding feature flags, toggling features, or gating new functionality behind flags.

AI & Automation 1,041 stars 80 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Feature Flags Feature flags gate experimental functionality behind user-configurable settings, enabling safe rollout (default off), user opt-in, and easy rollback. ## Checking Feature State ```go import "github.com/marcus/sidecar/internal/features" if features.IsEnabled("tmux_interactive_input") { // Feature-gated code } ``` ## Adding a New Feature Flag 1. Define the feature in `internal/features/features.go`: ```go var MyNewFeature = Feature{ Name: "my_new_feature", Default: false, Description: "Description of what this enables", } ``` 2. Add to the `allFeatures` slice: ```go var allFeatures = []Feature{ TmuxInteractiveInput, MyNewFeature, // Add here } ``` 3. Use the feature check in your code: ```go if features.IsEnabled("my_new_feature") { // New functionality } ``` ## User Configuration ### Config file (`~/.config/sidecar/config.json`) ```json { "features": { "flags": { "tmux_interactive_input": true } } } ``` ### CLI override (takes precedence over config) ```bash sidecar --enable-feature=tmux_interactive_input sidecar --disable-feature=tmux_interactive_input sidecar --enable-feature=feature1,feature2 # Multiple features ``` Unknown feature names in CLI flags produce a warning but do not prevent startup. ## Priority Order Feature state resolves in this order (first match wins): 1. CLI override (`--enable-feature`, `--disable-feature`) 2. Config file (`features.flags` in config.json) 3. Defau...

Details

Author
marcus
Repository
marcus/sidecar
Created
7 months ago
Last Updated
today
Language
Go
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category