Quick Start
Audit a Single URL
Run PS Guard against any URL to check its Web Vitals:
bash
npx ps-guard --url https://your-site.comSample Output
PS Guard reports each metric with pass/fail status:
bash
PS Guard — Performance Audit=============================
URL: https://your-site.comDevice: mobileScore: 87/100
Metrics: LCP 2340ms ✓ (threshold: 2500ms) CLS 0.12 ✗ (threshold: 0.1) INP 180ms ✓ (threshold: 200ms) TTFB 620ms ✓ (threshold: 800ms) FCP 1450ms ✓ (threshold: 1800ms)
Result: FAIL — 1 metric exceeded threshold
Hints for CLS: → Set explicit width/height on images and embeds → Avoid inserting content above existing content dynamically → Use CSS transform for animations instead of layout propertiesAudit with HTML Report
Generate a self-contained HTML report:
bash
npx ps-guard --url https://your-site.com --htmlThe report is saved to ./ps-guard-report/ by default. Open the HTML file in a browser to see visual score bars and detailed metrics.
Audit Entire Sitemap
Audit all pages from your sitemap.xml:
bash
npx ps-guard --sitemap https://your-site.com/sitemap.xml --max-urls 20Add to CI Pipeline
Add PS Guard to your GitHub Actions workflow:
yaml
- name: Setup Chrome uses: browser-actions/setup-chrome@v1
- name: Performance Audit run: npx ps-guard --url ${{ env.DEPLOY_URL }} --ci --jsonPS Guard exits with code 1 when thresholds fail, which will fail your CI build automatically.