Skip to main content

CLI Commands

Frontguard provides run, init, doctor, monitor, update-baselines, the fix-pattern commands, and the plugin subcommands.

Command list

frontguard runRun the visual regression pipeline (default command).
frontguard init [--ci]Detect framework and scaffold config (and a GitHub Action).
frontguard doctorDiagnose environment readiness before a run.
frontguard monitorRun visual checks against live production URLs.
frontguard update-baselinesAccept the current screenshots as new baselines.
frontguard plugin <cmd>install · uninstall · list plugins from npm.

frontguard run

The default command. Runs the full discover → render → diff → analyze → report pipeline.

FlagDescriptionDefault
-u, --url <url>Base URL to testconfig
-r, --routesComma-separated routes to testauto
-v, --viewportsComma-separated viewport widths375,768,1440
-b, --browserschromium, firefox, webkitchromium
-o, --outputOutput format: console, jsonconsole
-t, --thresholdPixel diff threshold (0–100)0.1

Exit codes

0

All passed (or only warnings / new pages)

1

Regressions detected

2

Pipeline errors (but no regressions)

frontguard monitor

Runs visual checks against live production URLs instead of a local dev server. Supports one-off checks, daemon polling, and webhook alerts.

terminal
# one-off check
$ frontguard monitor --url https://example.com --threshold 2

# daemon mode — check every 15 minutes, alert Slack
$ frontguard monitor --url https://example.com --interval 15 --webhook $SLACK_WEBHOOK