@snapshot-site/cli
v0.1.0
Published
Official CLI for the Snapshot Site API
Maintainers
Readme
Snapshot Site CLI
Official CLI for the Snapshot Site API.
Install
pnpm add -g @snapshot-site/cliCreate your API token in Snapshot Site Console:
- https://console.snapshot-site.com
Usage
export SNAPSHOT_SITE_API_KEY=your_key
snapshot-site screenshot --url https://snapshot-site.com --full-size
snapshot-site analyze --url https://snapshot-site.com --enable-summary --enable-quality
snapshot-site compare --before-url https://snapshot-site.com --after-url https://staging.snapshot-site.com --full-sizeLogin and local config
The CLI can persist your API key in a local config file:
snapshot-site login --api-key ss_live_xxx
snapshot-site whoami-config
snapshot-site logoutConfig path:
~/.config/snapshot-site/config.jsonEnvironment variables still work and override the saved config:
export SNAPSHOT_SITE_API_KEY=ss_live_xxx
export SNAPSHOT_SITE_BASE_URL=https://api.prod.ss.snapshot-site.comComplete examples
Take a screenshot and save the PNG
snapshot-site screenshot \
--url https://snapshot-site.com/pricing \
--width 1440 \
--full-size \
--hide-cookie \
--output ./pricing.json \
--save-image ./pricing.pngAnalyze a page with summary and quality checks
snapshot-site analyze \
--url https://snapshot-site.com \
--width 1440 \
--full-size \
--enable-summary \
--enable-quality \
--output ./analysis.json \
--save-image ./analysis.pngCompare staging vs production and save before/after/diff
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-assetsCompare from a JSON payload
snapshot-site compare \
--input ./compare-payload.json \
--output ./compare.json \
--save-image ./compare-assetsSave assets locally
snapshot-site screenshot --url https://snapshot-site.com --save-image
snapshot-site analyze --url https://snapshot-site.com --enable-quality --save-image ./analysis.png
snapshot-site compare --before-url https://snapshot-site.com --after-url https://staging.snapshot-site.com --save-image ./compare-outputPublish
pnpm run prepublishOnly
npm publish --access public