Turn features on with a pull request

opsgit keeps your feature flags as plain JSON files in your repo. Change one in a PR, see exactly who it will affect before you merge, and ship it to a Cloudflare Worker you own. No dashboard, no vendor, no seats.

npx opsgit-flags init
Read the quickstart

Nothing runs on our servers. Open source under the Functional Source License.

0databases, KV stores, or cold reads. Flags are compiled into the Worker bundle.
1workflow file in your repo. Everything else lives in the public action.
~30sfrom opening a pull request to a preview comment on it.
$0on top of your Cloudflare bill. The free Workers tier covers 100k requests a day.

Your flags live in a vendor dashboard. Someone changes a rule at 4pm on a Friday. Nobody reviewed it, nothing in git shows it.

  • Rules you can't diff, review, or roll back with git.
  • Per-seat pricing for something that is ten lines of JSON.
  • A vendor outage that becomes your outage.
  • Targeting rules sent to every browser that asks.

opsgit makes the flag a file and the change a pull request. Review and history come from GitHub. Delivery comes from a Worker in your own Cloudflare account.

You keep the flags. We keep nothing.

How it works

Four steps, all of them in git

01

Write a flag

One JSON file per flag in flags/. Rules, rollouts, segments, expiry, and an owner. Your editor autocompletes it from the schema.

02

Open a pull request

The action validates every file, runs your fixtures, and posts a plain-English preview: what changed, for whom, and by how much.

03

Merge

The flags are compiled into a Worker and deployed to your Cloudflare account. Global in seconds. No database to warm up.

04

Evaluate

Servers download the bundle once and evaluate in-process. Browsers and apps call the Worker with a client key that never sees a rule.

The pull request

A flag change reads like a flag change

The preview comment is written for the reviewer, not the machine. Enabled or not, who it targets, what percentage, and whether anything expires. If a fixture fails, the check fails.

  • Deterministic rollouts

    A user bucketed in at 25% stays in at 50%. Hashing is MurmurHash3 over the flag key and user id.

  • First match wins

    Rules run top to bottom, conditions are ANDed. The comment names the rule a test user hit.

  • Fixtures

    Files in tests/ pin an expected value for a context. They run on every PR.

  • Stale flags

    A weekly issue lists flags past expiry or untouched for 90 days, with the owner tagged.

Widen checkout rollout to 50% · flags/new_checkout_v2.json
"rules": [{
"name": "north-america-50pct",
"conditions": [{ "attribute": "country", "operator": "in",
- "value": ["US", "CA"] }],
+ "value": ["US", "CA", "GB"] }],
- "rollout": 25,
+ "rollout": 50,
"value": true
opsgit flags preview
new_checkout_v2rule north-america-50pct
countryUS, CA → US, CA, GB
rollout25% → 50%widens exposure
fixtures8 passed, 0 failed

What's in the box

Everything a flag system needs. Nothing it doesn't.

Percentage rollouts

Bucket by user id, account id, or any attribute you name. Sticky across deploys and across flags.

Segments

Name a group once in segments/, reference it from any rule. Beta testers, internal staff, a customer on a special plan.

Semver targeting

Force an upgrade below 2.3.0, or ship a feature only to builds that can handle it. Prerelease tags compare correctly.

Expiry and ownership

Every flag can carry an owner and an expiry date. The weekly stale-flag issue makes cleanup someone's job.

Two kinds of keys

Server keys read the whole bundle. Client keys can only evaluate, only see flags marked client: true, and never learn a rule name.

Edge native

ETag caching, per-key rate limits on client traffic, and geo attributes filled in from Cloudflare when you don't send them.

For agents

Let your agent set it up

Flags are files and changes are pull requests, which is what Claude Code, Codex and Cursor are already good at. Paste one prompt. init writes an AGENTS.md so the agent knows the rules from then on.

Set up opsgit feature flags in this repo. Run `npx opsgit-flags init`, read the AGENTS.md it writes, commit the result on a branch and open a pull request. Then tell me the two repository secrets to add and the two wrangler commands to run for the API keys.

Prefer tools? Add the MCP server:CursorVS Code

Packages

Four small packages, all MIT

Zero runtime dependencies. Node, Bun, Deno, browsers, and Workers.

  • opsgit-flags

    The command line: init, create, validate, check, explain, diff, preview, build, stale. Also what the GitHub Action runs.

    npx opsgit-flags init
  • @opsgit/flags-sdk

    Polling client for servers, remote client for browsers and apps. Typed, tiny, with ETag revalidation built in.

    npm i @opsgit/flags-sdk
  • @opsgit/core

    The evaluation engine on its own. Give it a flag and a context, get a value and the reason. Use it in tests and build steps.

    npm i @opsgit/core
  • @opsgit/mcp

    The MCP server. Gives Claude Code, Codex, Cursor and any MCP client the flag operations as tools.

    npx -y @opsgit/mcp
Live from the demo Worker · client key
POST /v1/evaluate flag_key=api_rate_limit
404 not visible to client keys
GET /v1/flags
403 server keys only
POST /v1/evaluate flag_key=example_banner
200 { value: {…}, reason: "RULE_MATCH" } no rule name
GET /v1/flags (no key)
401

Security

Your targeting rules are yours

Most flag services hand the full rule set to every browser that asks. opsgit splits keys by role so that the public side of your app can only ask one question: what is the value for this user.

  • Flags are server-only unless you opt them in with client: true.
  • Keys are stored hashed and compared in constant time.
  • Client traffic is rate limited per key and IP at the data centre.
  • Request bodies are capped and contexts are scalar-only.
  • The GitHub Action is pinned to commit hashes, and so are its own dependencies.

Compared

Good products. A different place to keep your flags.

LaunchDarkly and Unleash are both solid. The difference is who holds the flags, who reviews a change, and who you pay.

CapabilityopsgitUnleash
Where a flag livesA JSON file in your repoTheir dashboard and APITheir admin UI, backed by Postgres
How a change is reviewedA pull request, with a preview of who it affectsApproval workflows on higher tiersChange requests on paid plans
Where it runsA Worker in your Cloudflare accountLaunchDarkly's cloudA server you host, or theirs
What you operateNothing. Merge deploys itNothingThe Unleash server and its database
How servers evaluateIn-process, from a bundle fetched onceSDKs stream rules from LaunchDarklySDKs poll your Unleash server
What you pay forNothing beyond your Cloudflare billService connections and client-side MAU, after a free tierSeats on paid plans; open source is free to self-host
SourceSource-available, Apache 2.0 after two years. SDKs MITProprietaryOpen source core
Time to first flagOne command, two secrets, one PRSign up, create a project, add SDK keysDeploy a server, then add SDK keys

Pricing

You already pay for the infrastructure

$0from us

The engine is source-available under the Functional Source License and becomes Apache 2.0 two years after each release. The SDK, core, and CLI are MIT. The Worker runs in your Cloudflare account on the free tier or the $5 a month paid tier.

  • Unlimited flags, environments, and seats. There is no seat.
  • Unlimited evaluations. Server SDKs evaluate locally and never call home.
  • Your data never leaves your GitHub org and your Cloudflare account.
  • No lock-in. The flags are JSON files you already have.