lighthouse-ci

Installation
SKILL.md

Lighthouse CI

Overview

Lighthouse CI is the lhci command-line tool (npm package @lhci/cli, latest 0.15.1) that runs Lighthouse several times against your URLs, aggregates the runs, fails the build when assertions break, and uploads the reports. Reports can go to free temporary public storage, to your own Lighthouse CI server (history and build diffs), or to the local filesystem.

Lab runs measure First Contentful Paint, Largest Contentful Paint, Cumulative Layout Shift and Total Blocking Time. Interaction to Next Paint is a field metric and Lighthouse cannot measure it in CI; Total Blocking Time is the lab stand-in. Scores vary between runs, so assert on the median or optimistic value of several runs.

Instructions

Run it locally first

npm install --save-dev @lhci/cli@0.15.x
npx lhci healthcheck                         # checks config, Chrome and upload settings
npx lhci autorun --collect.numberOfRuns=3    # collect + assert + upload

In autorun, flags with values must use = (--collect.numberOfRuns=5, not a space). Without a config file, autorun uses collect.staticDistDir if it finds a build folder, otherwise an npm script named serve:lhci. Options can also come from lighthouserc.js, .json, .yml or LHCI_* environment variables.

Installs
3
GitHub Stars
197
First Seen
Mar 13, 2026