Take a screenshot
Capture a page and save both JSON output and an image locally.
snapshot-site screenshot \ --url https://snapshot-site.com/pricing \ --width 1440 \ --full-size \ --hide-cookie \ --output ./pricing.json \ --save-image ./pricing.png
Use the Snapshot Site CLI when you want reproducible screenshot, analyze, and compare jobs from the shell without wiring a full SDK first.
pnpm add -g @snapshot-site/cliSNAPSHOT_SITE_API_KEY=ss_live_xxx
The CLI gives teams a direct operational interface to Snapshot Site. It is useful when the workflow starts in the shell, in CI, or in a small automation script.
You can run screenshot, analyze, and compare directly from the terminal.
The CLI is a good fit for scripted checks before deployment or for recurring operational reviews.
You can log in once locally instead of exporting an API key in every shell session.
Returned screenshots and JSON payloads can be written straight to disk for review.
Install `@snapshot-site/cli` globally
Export `SNAPSHOT_SITE_API_KEY` or run `snapshot-site login`
Call `snapshot-site screenshot`, `analyze`, or `compare`
Save JSON or image outputs locally for review
Capture a page and save both JSON output and an image locally.
snapshot-site screenshot \ --url https://snapshot-site.com/pricing \ --width 1440 \ --full-size \ --hide-cookie \ --output ./pricing.json \ --save-image ./pricing.png
Run page analysis and persist both the JSON payload and image.
snapshot-site analyze \ --url https://snapshot-site.com \ --width 1440 \ --full-size \ --enable-summary \ --enable-quality \ --output ./analysis.json \ --save-image ./analysis.png
Compare two URLs and save the result set locally.
snapshot-site compare \ --before-url https://snapshot-site.com/pricing \ --after-url https://staging.snapshot-site.com/pricing \ --width 1440 \ --full-size \ --hide-cookie \ --threshold 0.1 \ --output ./compare.json \ --save-image ./compare-assets
Store credentials locally when you do not want to export the API key every time.
snapshot-site login --api-key ss_live_xxx snapshot-site whoami-config snapshot-site logout # saved config path ~/.config/snapshot-site/config.json
The CLI is useful when a developer needs immediate feedback without writing an application wrapper. It also provides a reviewed command contract that can later move into a CI job or operational script. The command should still define the visual state: target, viewport, full-page choice, readiness, cleanup, and output destination.
Use a harmless public fixture while verifying installation and authentication. Once the command succeeds, test one representative application route and store its configuration with the artifact. A screenshot without its command context is difficult to reproduce after the site or tool changes.
Local login is convenient on a trusted workstation. In CI, inject SNAPSHOT_SITE_API_KEY from the platform secret store and ensure the job does not echo environment variables. Pull requests from untrusted forks should not receive production credentials.
Validate or preselect the target URLs a script is allowed to capture. Avoid passing arbitrary user input from a shell or workflow event directly to a network service. Signed preview tokens and private result URLs should also be redacted from general logs.
Pin or deliberately update the CLI version, bound concurrency, classify failures, and cap retry. A validation or authentication error needs correction; a transient rate or service condition may justify delayed retry. Save JSON output for diagnostics while keeping sensitive values out of published artifacts.
For larger batches, use a durable job identity so rerunning a workflow does not create unexplained duplicates. Store the source or deployment identifier, viewport, CLI version, capture time, and review outcome with the generated file.
Use the authentication guide before adding secrets to CI and the error handling guide before automating retries.
It runs screenshot, rendered-page analysis, and visual comparison commands, and can save structured responses and returned assets for local or CI use.
Inject SNAPSHOT_SITE_API_KEY from the CI secret store into a protected job. Do not write a production credential into the repository, workflow output, or cached artifacts.
Use environment-based secret injection for ephemeral CI runners. The login command is more convenient for a trusted local workstation with protected configuration.
The hosted renderer needs a reachable HTTP or HTTPS target. Capture an authorized preview deployment, or use a local browser tool for a page available only on your machine.
Small bounded batches can. For large workloads, add controlled concurrency, retry classification, progress state, and idempotency instead of launching an unbounded loop.
Save the command options, CLI version, target or deployment identity, viewport, capture time, JSON response, and downloaded artifact together.
Use the CLI for result-oriented capture, analysis, and comparison. Use Playwright when the workflow must click, type, authenticate interactively, or assert browser behavior.
Place them in application or CI storage with access, retention, and deletion rules appropriate to the source page. Avoid publishing private evidence as a public artifact.
Start with an authorized public fixture, explicit viewport, and protected credential before moving the command into CI.