Lighthouse CLI
$ lighthouse Official Med RiskLighthouse CLI launches headless Chrome against any URL to measure Core Web Vitals, accessibility, best practices, and SEO, emitting structured --output=json reports for automated performance regression checks.
npm install -g lighthouse Deterministic Core Web Vitals and accessibility scoring belongs in lighthouse --output=json; use browser subagents for interactive UI workflows.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Provides --output=json, --only-categories, and --quiet, though raw JSON reports are huge and require jq filtering plus --chrome-flags='--headless'.
- Supports
--output=json,--only-categories, and--quiet
Read-only page audit, though headless Chrome executes remote JavaScript and writes reports to disk unless --output-path=stdout is set.
- Executes target page JS inside Chrome during audit
Requires Node.js plus a local Chrome/Chromium installation (often tricky inside minimal Docker containers).
- Depends on Node.js and local Chrome/Chromium binary
Authoritative Core Web Vitals, accessibility, and SEO diagnostics, though each run takes ~10–30 seconds.
- Canonical Google Chrome performance and accessibility audit engine
Official Google Chrome project (GoogleChrome/lighthouse) under Apache-2.0.
- Official
GoogleChrome/lighthouserepository
Extensive docs on flags, budgets, and Chrome flags.
- Official docs at developer.chrome.com/docs/lighthouse
Security, Auth & Guardrails
Supports transient --extra-headers JSON for authenticated staging audits; stores no credentials.
Free, Apache-2.0 open-source; requires Chrome/Chromium installed locally.
# Lighthouse CLI Agent Rules - Always pass `--chrome-flags='--headless'`, `--output=json`, and `--quiet` (avoid `--view`, which opens a browser window). - Pipe large `--output-path=stdout` JSON through `jq`—raw Lighthouse reports often exceed 500 KB.
Agent-Ready Command Recipes
Safe Read-Only Queries
lighthouse https://example.com --chrome-flags='--headless' --only-categories=performance,seo --output=json --output-path=stdout --quiet | jq '{perf: .categories.performance.score, seo: .categories.seo.score}' Audits selected categories headlessly (--only-categories), prints JSON to stdout, and extracts scores with jq.
Controlled Writes & Previews
lighthouse http://localhost:4321 --chrome-flags='--headless' --output=json --output-path=./lh-report.json --quiet
Writes the full Lighthouse JSON report locally for detailed audit inspection.
Strengths for Agents
- + Industry-standard Core Web Vitals, accessibility, and SEO scoring.
- +
--only-categoriesand--output=jsonenable targeted automated checks.
Caveats & Pitfalls
- ! Raw Lighthouse JSON reports are massive (hundreds of KB) and will blow up agent context unless filtered via
jq. - ! Requires a local Chrome/Chromium binary and takes 10–30s per page.