Lighthouse Integration¶
FAT Agent wraps Google Lighthouse CLI for accurate Core Web Vitals measurement including LCP, FID, CLS, and overall performance scores.
Usage¶
Options¶
| Flag | Default | Description |
|---|---|---|
--url |
Required | URL to audit |
--output |
stdout | Path for JSON results |
--preset |
desktop |
Device preset: desktop or mobile |
--categories |
performance |
Lighthouse categories to run |
Prerequisites¶
Lighthouse requires Node.js and Chrome/Chromium:
How It Works¶
- Check -- verifies Lighthouse CLI is installed
- Run -- executes
lighthousewith JSON output format - Parse -- extracts Core Web Vitals and category scores
- Merge -- results are available for integration with the main audit
Fallback Behaviour¶
When Lighthouse is not installed, the script:
- Logs a warning that Lighthouse is unavailable
- Returns an empty result set with a
lighthouse_available: falseflag - The main audit continues without Lighthouse data
- Performance scores use HTML-based heuristics instead
Output Format¶
{
"lighthouse_available": true,
"performance_score": 87,
"metrics": {
"first_contentful_paint": 1.2,
"largest_contentful_paint": 2.1,
"total_blocking_time": 150,
"cumulative_layout_shift": 0.05,
"speed_index": 2.8
},
"opportunities": [
{
"id": "render-blocking-resources",
"title": "Eliminate render-blocking resources",
"savings_ms": 450
}
]
}