Feature flags and A/B tests that live in your repo as Markdown files.
One command to install. No signup. No dashboard to rot in.
Contents
Quickstart
In your app's folder, next to package.json:
npm create dif@latest
This installs @dif.sh/cli with your package manager and runs dif init,
which sets up the dif/ workspace and installs the SDK for your framework.
Or install the CLI globally:
npm install -g @dif.sh/cli
No Node? Install the standalone binary
# macOS / Linux: Homebrew
brew install dif-sh/tap/dif
# macOS / Linux: single static binary, no Node required
curl -fsSL https://dif.sh/install.sh | sh
Then, in your repo:
dif init # scaffold dif/, config, agent files
dif connect --key dif_pk_live_... # connect to dif.sh Cloud (optional)
dif new home-hero-cta --surface home # draft an experiment file
# open dif/experiments/active/home-hero-cta.md and set `status: active`
dif validate # check everything
dif build # generate the TS client + context.json
Or use the built-in skills. dif init installs Claude Code skills into
.claude/skills/, so you can drive the same loop in plain English and let the
agent run the commands:
| Skill | Ask for | What it does |
|---|
dif-generate-surfaces | "Set up dif surfaces for this app" | Reads your routes and pages, proposes the surface set, writes the files |
dif-setup-analytics | "Set up dif analytics" | Installs page views, plans and adds events, checks they arrive in dif analytics |
dif-author-experiment | "Add a flag for the new checkout, mobile only" | Drafts the frontmatter, picks weights, runs dif validate |
dif-conclude-experiment | "Conclude checkout-cta-v2" | Gets the result from dif.sh Cloud, writes the decision from its numbers, archives the file, logs the learning |
dif-triage-experiments | "Triage my experiments" | Reads the dif.sh Cloud overview, then ramps, turns off or concludes each experiment that needs action, one PR each |
dif-connect-cloud | "Connect this repo to dif Cloud" | Signs the CLI in with a browser code, links or creates the dif.sh Cloud project, writes its key, runs dif build |
dif new drafts the file with your git email as owner. Open it, write the
hypothesis, set status: active, and run dif build. Then install the
runtime (npm install @dif.sh/sdk, zero dependencies), import the generated
client once at boot, and call dif() at the render site: