Skip to content

thanatosartcoder/flagwiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚩 flagwiz

Interactive CLI wizard to set up feature flags for any JavaScript or TypeScript project.

What it does

  1. Detects your framework — Next.js, Nuxt, React, Vue, Angular, NestJS, Express, React Native, Expo, Flutter
  2. Lets you pick a provider — PostHog, LaunchDarkly, Flagsmith, GrowthBook, Unleash, ConfigCat — or a custom in-memory solution
  3. Generates production-ready files — client wrapper, React hooks / Vue composables / Angular services / NestJS modules depending on your stack
  4. Defines your initial flags — interactively, with env-variable overrides built in

Usage

# Run directly with npx
npx flagwiz

# Or install globally
npm install -g flagwiz
flagwiz

Providers supported

Provider Free tier Self-host Best for
🦔 PostHog 1M req/mo Flags + analytics bundle
🚀 LaunchDarkly Developer plan Enterprise governance
🏴 Flagsmith 50k req/mo Open-source + remote config
📊 GrowthBook Unlimited (OSS) A/B testing + warehouse-native
Unleash Unlimited (OSS) Data sovereignty
🐱 ConfigCat 10 flags, unlimited seats Simple + team-friendly
🔧 Custom n/a No deps, env-driven, zero cost

Framework support

Generates framework-specific adapters for:

  • Next.js — server/client aware, App Router compatible
  • React (Vite/CRA)<FeatureFlagsProvider> + useFlag() hook
  • Vue.js — composable useFeatureFlags() + plugin
  • Nuxt.js — composable ready
  • Angular@Injectable service + InjectionToken
  • NestJS@Injectable service + @Module
  • Express / Node — plain module
  • React Native / Expo — hooks
  • Flutter — Dart singleton service

Custom (in-memory) provider

The custom option generates zero-dependency feature flags:

import { featureFlags } from './lib/feature-flags'

// Check at runtime
featureFlags.isEnabled('new-checkout-flow') // → boolean

// Override via env (no restart needed in dev)
// FEATURE_NEW_CHECKOUT_FLOW=true

Flags are defined in a simple config file and can be overridden with env vars — great for local dev, staging, and CI environments without any external service.

Generated file structure

Custom provider

lib/feature-flags/
├── flags.ts         # Flag definitions + runtime resolver
├── adapter.tsx      # Framework adapter (hooks / composable / service)
├── index.ts         # Barrel export
└── README.md

External provider (e.g. PostHog)

lib/flags/
├── client.ts        # SDK wrapper with typed API
├── useFeatureFlag.ts # React/Vue hook
├── index.ts         # Barrel export
├── .env.example     # Env var template
└── README.md

Requirements

  • Node.js >= 18

Contributing

Contributions are welcome! Here's how to submit a pull request:

  1. Fork the repository on GitHub
  2. Clone your fork locally:
    git clone https://github.com/<your-username>/flagwiz.git
    cd flagwiz
  3. Install dependencies:
    npm install
  4. Create a branch for your change:
    git checkout -b feat/my-improvement
  5. Make your changes and test them locally:
    node src/index.js
  6. Commit with a clear message:
    git commit -m "feat: add support for XYZ"
  7. Push your branch and open a pull request:
    git push origin feat/my-improvement
    Then go to github.com/thanatosartcoder/flagwiz and click "Compare & pull request".

Good first contributions

  • Add support for a new provider (see src/providers/index.js)
  • Add support for a new framework (see src/utils/detector.js and src/utils/generator.js)
  • Improve error messages or CLI output

About

Interactive CLI wizard to set up feature flags for any JS/TS framework — Next.js, NestJS, Vue, Angular, React Native, Flutter and more

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors