CLI Usage

Basic Commands

bash
# Audit all pillars
npx web-guard --url https://example.com
# Use a preset
npx web-guard --url https://example.com --preset recommended
# Specific pillars
npx web-guard --url https://example.com --pillars performance,seo
# Desktop emulation
npx web-guard --url https://example.com --device desktop
# JSON output for CI
npx web-guard --url https://example.com --json --ci

CLI Options

FlagDefaultDescription
--url <url>URL to audit
--preset <name>Use built-in preset (lenient, recommended, strict)
--device <type>mobileEmulation device (mobile or desktop)
--pillars <list>allComma-separated pillars to run
--jsonfalseJSON output mode
--cifalseCI mode (no colors, machine-readable)
--helpShow help message

Exit Codes

CodeMeaningDescription
0PassAll pillars passed their thresholds
1FailOne or more pillars failed
2ErrorConfiguration or runtime error

Available Pillars

PillarDescription
performanceLighthouse performance score + Web Vitals (LCP, CLS, INP, TTFB, FCP)
a11yWCAG accessibility violations via axe-core
seoTitle, meta description, headings, canonical, robots, sitemap
schemaJSON-LD structured data validation
securitySecurity response headers check
uxViewport, image dimensions, touch targets, font-display
Pillars run sequentially, sharing a single browser instance for efficiency. Performance uses its own Chrome instance via chrome-launcher.