Skip to content

Capture

Capture screenshots of any URL or upload your own PNGs — no test framework required.

Terminal window
npm install -g @pxdiff/cli

Define your targets in a JSON file:

[
{
"name": "homepage",
"url": "https://your-app.com",
"viewport": { "width": 1280, "height": 720 }
},
{
"name": "homepage-mobile",
"url": "https://your-app.com",
"viewport": { "width": 375, "height": 812 }
}
]
Terminal window
pxdiff login
pxdiff project set myorg/myproject
pxdiff capture targets.json --local
pxdiff diff
- run: |
pxdiff capture targets.json
pxdiff diff
env:
PXDIFF_API_KEY: ${{ secrets.PXDIFF_API_KEY }}

If you generate PNGs yourself (e.g. from Puppeteer, Selenium, or any other tool), upload a directory of them:

Terminal window
pxdiff upload ./screenshots --local
pxdiff diff
- run: |
pxdiff upload ./screenshots
pxdiff diff
env:
PXDIFF_API_KEY: ${{ secrets.PXDIFF_API_KEY }}

Snapshot names are derived from filenames (minus the .png extension).

See the CLI reference for all options.