Dev Resources

๐ŸŽ Black Friday: 40% off the first payment of every plan, and Skip the queue for $29, through December 6.

dif is in the queue

It will be published on December 27, 2026.

From $29 instead of $49, live within minutes

  1. Added from GitHub

    Added from the open-source list.

  2. In the queue

    Until December 27, 2026.

  3. Live

    Listed on Dev Resources, with a link to its website.

dif favicon

dif

Open Source, Testing, Tooling

Feature flags and A/B tests as Markdown files in your git repo. A CLI validates them and compiles a typed TypeScript client. Open source, no signup.

dif's website screenshot

About dif

dif is a command-line tool for managing feature flags and A/B tests as files stored directly in a git repository. Each flag, experiment, holdout, or staged rollout is represented as a single markdown file with YAML frontmatter, organized into active and concluded directories. The CLI includes commands to initialize the folder structure, draft new experiments, validate configuration, preview variant assignments for a given user, build a typed client, and conclude tests by archiving them and logging outcomes.

The tool targets audiences by declared attributes such as country, plan, or returning-visitor status, with values resolved at runtime so no customer data is committed to the repository. It detects conflicts between experiments sharing an exclusion group at build time, failing the build rather than allowing collisions in production. Results can be sent to an external destination via `dif.track()` using a Dif Cloud key, or forwarded to systems like Segment, Amplitude, or a data warehouse through custom event handlers.

Each experiment is tied to a "surface" (a screen or area of the product), which maintains its own markdown file containing context and a running log of past learnings. New experiments drafted for a surface read this log, and concluding a test appends a decision summary to it. The product also generates a `context.json` file intended to be read by coding agents at the start of a session, surfacing active experiments and recent learnings. It supports web, server, React, and Svelte usage via an installable CLI and SDK.

Key features

  • Feature flags and A/B tests stored as markdown files in the repo, versioned with git
  • CLI commands to init, draft, validate, build, and conclude experiments
  • Build step resolves exclusion groups and fails the build on conflicting tests
  • Generates a typed client and a context.json file that coding agents read on session start
  • Audience targeting on declared attributes like country, plan, or returning_visitor without committing customer data

Frequently asked questions

Where are flags and experiments stored?

Each flag or experiment is a single .md file inside a dif/ folder checked into the repo, with active and concluded subfolders.

Does dif require a separate dashboard or login?

No, the CLI commands are scriptable and none of them open a browser or require logging in; dif qa gives a preview link instead of a dashboard.

How do I install and start using dif?

Install the CLI with npm install -g @dif.sh/cli and the SDK with npm install @dif.sh/sdk, then run dif init to set up the folder.

What frameworks or rendering approaches does dif support?

The same files and CLI work whether you render with Web, Server, React, or Svelte.

How are analytics and results tracked?

Adding a Dif Cloud key lets dif.track() compute lift automatically, or you can run dif init --events custom to forward events yourself to Segment, Amplitude, or your warehouse.

Ad
Thordata favicon

Thordata

Reliable residential proxies for web scraping and automation: over 100 million real residential IPs across 190+ countries, plus a SERP API, Web Scraper API and Web Unlocker.

Learn more
Ad
SerpApi - Search API favicon

SerpApi - Search API

SerpApi's Search API makes it easy and fast to scrape Google and other search engines.

Learn more

Featured products

  • SerpApi - Search API favicon
  • Thordata favicon

Show your product to thousands of developers

ยท 100k monthly pageviews
ยท 9k newsletter subscribers

Advertise your product