dif CLI
A CLI that keeps feature flags and A/B tests as Markdown in your repo and installs five Claude Code skills to run them.
- 114 ★ on the repository
- Last commit
Extended access
Why this level
- `dif init` creates files and skills in a project, and the cloud key sits in config and must not reach public Git.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/difDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- `dif init` creates files and skills in a project, and the cloud key sits in config and must not reach public Git.
This is third-party code. Review the repository files before installing.
What it does
`dif` turns every flag and experiment into a single Markdown file next to the code it changes. The file goes through pull request review and its history is the Git history. `dif init` scaffolds a `dif/` folder, config and agent files, `dif new` drafts an experiment, `dif validate` checks schema, owners and references, and `dif build` compiles a typed TypeScript client and `context.json`. Alongside the CLI, five skills land in `.claude/skills/`: `dif-generate-surfaces`, `dif-author-experiment`, `dif-conclude-experiment`, `dif-triage-experiments` and `dif-connect-cloud`. They drive the loop in plain English while the agent runs the commands. In code a flag is read through `dif()` from `@dif.sh/sdk`. dif.sh Cloud is optional and adds analytics.
Who it is for. Teams on Next.js, React or SvelteKit who want flags and A/B tests without a dashboard or a separate subscription.
Good fit when
- A new button should be shown to half of mobile users.
- An experiment is over and the decision must be written and the file archived.
- An agent should triage all active experiments and ramp, switch off or conclude each with one PR.
- The app is mapped into experiment surfaces by routes and pages.
- Flags are validated in CI with `dif validate`.
Not a fit when
- A dashboard with analytics without the cloud is wanted, since dif.sh Cloud computes results.
- The stack is not JavaScript or TypeScript, as the client compiles to TypeScript.
- CommonJS is required, but `@dif.sh/sdk`, `@dif.sh/react` and `@dif.sh/svelte` are ESM only.
Example request
Add a flag for the new checkout for mobile users only and check it with `dif validate`.Limitations
Experiment results and final decisions are computed by dif.sh Cloud, so the `dif-conclude-experiment` and `dif-triage-experiments` skills are incomplete without it. Connection uses a `dif_pk_live_...` key that must not be committed to a public repository. The `dif/generated/` folder is gitignored, so CI must run `dif build` before the app build, for example through `"prebuild": "dif build"`. The client and SDK are written in TypeScript and ship as ESM only.
How to disable. Uninstall the CLI with `npm uninstall -g @dif.sh/cli`, then remove the `dif/` and `.claude/skills/dif-*` folders from projects. If you connected the cloud, revoke the key in dif.sh Cloud.
FAQ
Is the cloud required?
No, the CLI and files work with no signup. dif.sh Cloud connects with `dif connect --key` and is needed for analytics and for skills that read results.
What does `dif init` install?
A `dif/` structure, config and agent files, including Claude Code skills in `.claude/skills/` plus `AGENTS.md` and `CLAUDE.md`.
How do I install without Node.js?
With Homebrew, `brew install dif-sh/tap/dif`, or as a single binary, `curl -fsSL https://dif.sh/install.sh | sh`.
How is a variant chosen in code?
Import the generated client and call `dif("home-hero-cta", {...})` with control and variant functions, then render with `cta()`.
Which commands does `dif` have?
Eight: `dif init`, `connect`, `new`, `validate`, `build`, `qa`, `conclude` and `scaffold-audiences`. `dif qa` traces the assignment chain for a user.
Discussion
No questions or reviews yet.
Related
CLI toolsBlack-box auditor runs a released CLI, catches side writes to disk and gives agents a command index with a readiness score.
Eleven skills for Claude Code and Codex: test audit, git worktree cleanup, plan pages, screen recording transcripts and 1Password sign-in
A CLI that opens a local git diff in the browser like GitHub's Files changed tab; comments copy out as prompts for an agent
A set of slash commands, skills and subagents for Claude Code: review, tests, security, releases, docs and GitHub to Linear sync
A Claude Code working configuration: a planner with per-milestone review, sub-agents and skills for analysis, refactoring and docs sync
A debugging tool for Claude Code that reads the session logs already saved on disk and shows exact file paths, diffs, model thinking and a category-by-category
README in short
A flag lives in the repository as a file, goes through review and is archived with its decision inside, so it does not rot in a dashboard detached from the code.