Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Lighthouse CLI

$ lighthouse Official Med Risk
Google Chrome · Browser & Web · Apache-2.0 · macos / linux / windows

Lighthouse 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.

FCRS-1.0 Score
80 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g lighthouse
CLI vs MCP Decision CLI Only

Deterministic Core Web Vitals and accessibility scoring belongs in lighthouse --output=json; use browser subagents for interactive UI workflows.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 19 / 25

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
Trust & Safety 21 / 25

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
Setup & Portability 10 / 15

Requires Node.js plus a local Chrome/Chromium installation (often tricky inside minimal Docker containers).

  • Depends on Node.js and local Chrome/Chromium binary
Utility & Efficiency 13 / 15

Authoritative Core Web Vitals, accessibility, and SEO diagnostics, though each run takes ~10–30 seconds.

  • Canonical Google Chrome performance and accessibility audit engine
Maintenance & Lineage 9 / 10

Official Google Chrome project (GoogleChrome/lighthouse) under Apache-2.0.

  • Official GoogleChrome/lighthouse repository
Docs & Verifiability 8 / 10

Extensive docs on flags, budgets, and Chrome flags.

  • Official docs at developer.chrome.com/docs/lighthouse

Security, Auth & Guardrails

Auth Modes
No Auth Config File
Credential Storage

Supports transient --extra-headers JSON for authenticated staging audits; stores no credentials.

Side Effects
Read-Only Local Write
Cost & Quotas

Free, Apache-2.0 open-source; requires Chrome/Chromium installed locally.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Run a headless performance and SEO audit as JSON
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

Save full JSON audit report to disk
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-categories and --output=json enable 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.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI