copied to clipboard
Go CLI  ·  open source  ·  v0.1.0

snapr.

Snap  ·  Crawl  ·  Document

Automated screenshots & PDFs for any web project — local dev, live site, or CI pipeline.

go install github.com/kdairatchi/snapr@latest
snapr — automated screenshots and PDFs

Everything screenshot automation needs

From a single URL to a full CI/CD visual regression pipeline in one binary.

Snap Anything

Single URL, config file, or live dev server — snapr handles all three entry points with the same output quality.

Crawl Automatically

Discover routes via sitemap or link crawl. Same-origin only. Configurable depth and worker count.

Config Driven

snapr.toml — define named routes, output paths, viewports, and project groups once.

CI/CD Ready

GitHub Action, goreleaser binaries, visual regression diff with --fail-on-diff.

Five commands, full workflow

Everything from a quick one-off capture to a full visual regression pipeline.

snapr snap — capture a URL or config
# single URL snapr snap http://localhost:4000 # from config, multi-viewport snapr snap --config snapr.toml --viewports mobile,desktop --workers 6 # full-page PDF snapr snap http://localhost:4000 --format pdf --full
snapr crawl — auto-discover and capture all routes
# crawl a local dev server snapr crawl http://localhost:4000 # sitemap-first, cap at 20 pages snapr crawl https://prowlrbot.com --sitemap --max 20 --workers 8
snapr serve — start server, snap, shut down
# spin up hwaro, wait for :4000, capture, kill snapr serve --cmd "hwaro serve" --port 4000 --config snapr.toml # works with any dev server snapr serve --cmd "npm run dev" --port 3000 snapr serve --cmd "hugo server" --port 1313 --wait 10
snapr diff — pixel-diff two screenshot directories
# compare baseline vs current, fail on any diff snapr diff screenshots/baseline screenshots/current --fail-on-diff # stricter threshold, ignore tiny changes snapr diff screenshots/v1 screenshots/v2 --threshold 0.05 --min-percent 1.0
snapr report — generate a self-contained HTML gallery
# default: screenshots/ → screenshots/report.html (base64-embedded) snapr report # named report for a deploy preview snapr report --title "prowlrbot.com — deploy preview" --out docs/gallery.html

Get snapr

Requires Chrome or Chromium on the host machine.

# requires Go 1.22+ go install github.com/kdairatchi/snapr@latest # make sure $GOPATH/bin is in your $PATH export PATH="$(go env GOPATH)/bin:$PATH"
brew tap kdairatchi/tap brew install snapr
# download for your platform https://github.com/kdairatchi/snapr/releases # verify checksum (Linux/macOS) sha256sum -c checksums.txt # extract and move to PATH tar -xz snapr < snapr_linux_amd64.tar.gz sudo mv snapr /usr/local/bin/

Drop-in CI integration

One step adds screenshot capture to any workflow. The action installs the binary, verifies the sha256 checksum, and puts snapr on $PATH automatically.

  • Captures on every push, uploads as a workflow artifact
  • Visual regression — diffs PRs against baseline, fails the check on change
  • Deploy preview — snap a live site after deployment completes
  • Publish self-contained HTML report with embedded base64 images
.github/workflows/screenshots.yml
name: screenshots on: [push] jobs: snap: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Screenshot uses: kdairatchi/snapr@v1 with: config: snapr.toml upload: true # optional: visual regression on PRs - if: github.event_name == 'pull_request' run: snapr diff screenshots/baseline screenshots/current --fail-on-diff

snapr vs gowitness

gowitness is a great recon tool. snapr is built for project documentation and CI/CD visual regression.

Feature snapr gowitness
Screenshot capture
PDF output
Dev server lifecycle (snapr serve)
Pixel-diff visual regression
Self-contained HTML gallery
Multi-viewport capture
GitHub Action
snapr.toml config
Bulk recon / large URL lists