docs/under the hood/develop
Develop Snip
Run Snip from source, change it, and send a pull request.

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.
/mcp.Run from source
Do these four steps in your clone of the repository. Use two Terminal windows.
- 1Install and follow main
$npm run setup -- --mainSetup writes the config files, installs the dependencies, creates the database and builds Snip.app. --main follows main, not releases.
- 2Start the app
$npm run devVite serves the app with hot reload at http://localhost:5173.
- 3Start the capture agent
$npm run captureRun it in the second Terminal window. Captures wait in the queue until it runs.
- 4Examine the setup
$npm run doctorThe doctor prints one line for each problem, with its fix.
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.
- Icon
- Golden tile
- Library
- Your real library
- MCP
- http://localhost:5173/mcp
- Icon
- Blue blueprint tile
- Library
- A separate test library
- MCP
- http://localhost:5273/mcp
Configuration
Setup writes two config files with new secrets. It never changes a file that exists.
SESSION_SECRET, CAPTURE_TOKEN and DEV_LOGIN for the app.SNIP_URL, CAPTURE_TOKEN and the options for the capture agent.Capture agent options
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.
Send a pull request
Bug reports, ideas and pull requests are welcome. Do these steps for each pull request.
- Fork the repository and make a branch from main.
- Keep each pull request to one change. For a large change, open an issue first.
- Run the checks above.
- Open the pull request and fill in the template.
- 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.
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.

