Develop Snip

Run Snip from source, change it, and send a pull request.

Node.js 22.18+ or 24.11+React 19, Hono, PlaywrightSource-available

Snip is one Cloudflare Worker that runs in two places: on your Mac through Wrangler, or in your Cloudflare account. A capture agent on your Mac does the browsing. This page shows how the parts fit and how to work on them.

How Snip is built

The repository has one folder for each part. Start in the folder of the part that you change.

web/
What it holdsThe gallery (Vite, React 19, Tailwind v4, shadcn/ui) and the Worker API (Hono on Cloudflare Workers, with D1, R2 and KV). The Worker also serves MCP at /mcp.
capture/
What it holdsThe capture agent: Node.js and Playwright. It records VP9 WebM video with WebCodecs.
desktop/
What it holdsSnip.app, the Electron menu-bar app for Apple silicon Macs.
plugins/snip/
What it holdsThe agent plugin: the MCP config and the snip skill.
web/site/
What it holdsThe public site on usesnip.dev. It is static files only.

Run from source

Do these four steps in your clone of the repository. Use two Terminal windows.

  1. 1
    Install and follow main$npm run setup -- --main

    Setup writes the config files, installs the dependencies, creates the database and builds Snip.app. --main follows main, not releases.

  2. 2
    Start the app$npm run dev

    Vite serves the app with hot reload at http://localhost:5173.

  3. 3
    Start the capture agent$npm run capture

    Run it in the second Terminal window. Captures wait in the queue until it runs.

  4. 4
    Examine the setup$npm run doctor

    The doctor prints one line for each problem, with its fix.

ResultThe app runs at http://localhost:5173 with no sign-in. You appear as the DEV_LOGIN name in web/.dev.vars.

Test with Snip Dev

Snip Dev.app is a second app with its own test library. Use it to test a change without touching your real library.

$npm run app:dev:build
Snip
Golden tile
Your real library
http://localhost:5173/mcp
Snip Dev
Blue blueprint tile
A separate test library
http://localhost:5273/mcp

Configuration

Setup writes two config files with new secrets. It never changes a file that exists.

web/.dev.varsSESSION_SECRET, CAPTURE_TOKEN and DEV_LOGIN for the app.
capture/.envSNIP_URL, CAPTURE_TOKEN and the options for the capture agent.

Capture agent options

SNIP_URL
Defaultlocalhost:5173
What it doesThe app that the capture agent serves. Cloud mode sets it for you.
HEADLESS
Defaulttrue
What it doesSet false to see the browser while it captures.
DISMISS_POPUPS
Defaulttrue
What it doesSet false to keep cookie banners and popups in captures.
ALLOW_PRIVATE_URLS
Defaultfalse
What it doesSet true to capture localhost and private-network sites.
STORAGE_STATE
Defaultnone
What it doesA Playwright sign-in file for Use my saved sign-in.
CHROMIUM_PATH
DefaultPlaywright
What it doesUse your own Chrome in place of the Playwright Chromium.
BROWSER_IDLE_SECONDS
Default120
What it doesSeconds that Chromium stays open after the last capture.

The README lists all 16 options, with the settings for recording quality and contact sheets. CAPTURE_TOKEN must match in both files.

Run the checks

Run these checks before you open a pull request. CI runs the same core checks, and the core check must pass.

Terminal
$npm run typecheck$npm run build -w web$npx playwright install chromium # one time, for the browser tests$npm test$npm run test:browser

Send a pull request

Bug reports, ideas and pull requests are welcome. Do these steps for each pull request.

  1. Fork the repository and make a branch from main.
  2. Keep each pull request to one change. For a large change, open an issue first.
  3. Run the checks above.
  4. Open the pull request and fill in the template.
  5. On your first pull request, a bot asks you to agree to the CLA. Reply with the sentence that it gives you. You do this one time.
ResultThe maintainer reviews your pull request. Only the maintainer merges into main.
LicenseApache License 2.0 with the Commons Clause

You can use, self-host, change and fork Snip for free, also at work. You cannot sell it: no paid product, hosted service or paid support whose value comes mainly from Snip.