Sign In

@corralimited/snapdiff-cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@corralimited/snapdiff-cli

Command-line interface for SnapDiff. Capture screenshots, run visual diffs, and manage project baselines from the terminal or CI.

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

@corralimited/snapdiff-cli

Command-line interface for SnapDiff. Capture screenshots, run visual diffs, and manage project baselines from the terminal or CI.

# One-off
npx @corralimited/snapdiff-cli --help

# Or install globally
npm install -g @corralimited/snapdiff-cli

Setup

Get an API key at https://snapdiff.ai/dashboard, then export it:

export SNAPDIFF_API_KEY=sd_live_...

(Alternatively, pass --api-key to any command.)

Commands

snapdiff snapshot <url>

Capture a screenshot of a URL.

snapdiff snapshot https://example.com
snapdiff snapshot https://example.com --full-page --width 1440
snapdiff snapshot https://example.com --selector ".hero" --dark-mode

snapdiff diff <before> <after>

Compare two URLs (or ss_xxx screenshot ids) visually.

snapdiff diff https://example.com https://staging.example.com
snapdiff diff https://example.com https://staging.example.com \
  --threshold 0.05 --ignore ".timestamp" --ignore "#ad-banner" --full-page

Exits with code 2 when the pages differ (the result JSON is still printed). Useful in CI:

snapdiff diff $PROD_URL $STAGING_URL > diff.json || echo "::warning::Visual change detected"

snapdiff diff-baseline <project> <page> <after>

Compare a URL against the stored baseline for a project + page (+ branch). Server-side baseline resolution — single round trip.

snapdiff diff-baseline acme-marketing pricing https://staging.acme.com/pricing
snapdiff diff-baseline acme-marketing pricing https://staging.acme.com/pricing --branch feat/redesign

Same exit codes as diff: 0 match, 2 differs, 1 error.

snapdiff projects ls / snapdiff projects get <projectId>

snapdiff projects ls
snapdiff projects get prj_X3V-3SzmJ61WIdxY

Global flags

FlagNotes
--api-key <key>Override the SNAPDIFF_API_KEY env var.
--api-url <url>Point at a non-default API base. Mostly for testing.

Exit codes

CodeMeaning
0Success (e.g. diff matched).
1Error — invalid args, network, API error. Message goes to stderr.
2Diff command ran, but pages did not match. Result JSON is still printed to stdout.

License

MIT — see LICENSE.

Keywords

snapdiff

FAQs

Package last updated on 14 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts