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.
Nothing runs on our servers. Open source under the Functional Source License.
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
Write a flag
One JSON file per flag in flags/. Rules, rollouts, segments, expiry, and an owner. Your editor autocompletes it from the schema.
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.
Merge
The flags are compiled into a Worker and deployed to your Cloudflare account. Global in seconds. No database to warm up.
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.
| new_checkout_v2 | rule north-america-50pct | |
| country | US, CA → US, CA, GB | |
| rollout | 25% → 50% | widens exposure |
| fixtures | 8 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.
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.
@opsgit/flags-sdk
Polling client for servers, remote client for browsers and apps. Typed, tiny, with ETag revalidation built in.
@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.
@opsgit/mcp
The MCP server. Gives Claude Code, Codex, Cursor and any MCP client the flag operations as tools.
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.
| Capability | opsgit | Unleash | |
|---|---|---|---|
| Where a flag lives | A JSON file in your repo | Their dashboard and API | Their admin UI, backed by Postgres |
| How a change is reviewed | A pull request, with a preview of who it affects | Approval workflows on higher tiers | Change requests on paid plans |
| Where it runs | A Worker in your Cloudflare account | LaunchDarkly's cloud | A server you host, or theirs |
| What you operate | Nothing. Merge deploys it | Nothing | The Unleash server and its database |
| How servers evaluate | In-process, from a bundle fetched once | SDKs stream rules from LaunchDarkly | SDKs poll your Unleash server |
| What you pay for | Nothing beyond your Cloudflare bill | Service connections and client-side MAU, after a free tier | Seats on paid plans; open source is free to self-host |
| Source | Source-available, Apache 2.0 after two years. SDKs MIT | Proprietary | Open source core |
| Time to first flag | One command, two secrets, one PR | Sign up, create a project, add SDK keys | Deploy 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.