Skip to content

Instantly share code, notes, and snippets.

@ygerasimov
Last active February 12, 2026 15:36
Show Gist options
  • Select an option

  • Save ygerasimov/39124cf1bb03ad4ec0cc66a9d131799f to your computer and use it in GitHub Desktop.

Select an option

Save ygerasimov/39124cf1bb03ad4ec0cc66a9d131799f to your computer and use it in GitHub Desktop.
#!/bin/bash
# Download and install diffy cli tool.
wget -O /usr/local/bin/diffy https://github.com/diffywebsite/diffy-cli/releases/latest/download/diffy.phar
chmod a+x /usr/local/bin/diffy
# Authenticate
#diffy auth:login $DIFFY_API_KEY
# Create new set of screenshots.
NEW_SCREENSHOT_ID=$(diffy screenshot:create $DIFFY_PROJECT_ID prod)
# Get the latest set of screenshots
LATEST_SCREENSHOT_ID=$(diffy screenshot:list --limit=1 $DIFFY_PROJECT_ID | grep \'id\' | php -r 'print(preg_replace("/[^0-9]/", "", stream_get_contents(STDIN)));')
# Compare these two
diffy diff:create $DIFFY_PROJECT_ID $NEW_SCREENSHOT_ID $LATEST_SCREENSHOT_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment