What is @lhci/cli?
@lhci/cli is a command-line interface for Lighthouse CI, a tool for running Lighthouse audits on your web applications and tracking their performance over time. It allows you to set up, run, and manage Lighthouse CI in your CI/CD pipeline.
What are @lhci/cli's main functionalities?
Running Lighthouse CI
This command runs the Lighthouse CI autorun, which automatically sets up and runs Lighthouse audits on your web application. It is useful for integrating performance checks into your CI/CD pipeline.
npx @lhci/cli autorun
Collecting Data
This command collects Lighthouse reports for the specified URL. It can be used to gather performance data for different pages of your web application.
npx @lhci/cli collect --url=https://example.com
Uploading Data
This command uploads the collected Lighthouse reports to a specified target, such as temporary public storage or a custom server. It is useful for sharing and storing performance data.
npx @lhci/cli upload --target=temporary-public-storage
Setting Up Server
This command starts a Lighthouse CI server on the specified port. The server can be used to store and visualize Lighthouse reports over time.
npx @lhci/cli server --port=9001
Running Assertions
This command runs assertions based on Lighthouse scores and configurations. It is useful for enforcing performance budgets and ensuring that your web application meets certain performance criteria.
npx @lhci/cli assert --preset=lighthouse:recommended
Other packages similar to @lhci/cli
lighthouse
Lighthouse is an open-source, automated tool for improving the quality of web pages. It can be run as a Chrome Extension or from the command line. While @lhci/cli focuses on CI/CD integration and tracking performance over time, lighthouse is more general-purpose and can be used for ad-hoc performance audits.
sitespeed.io
Sitespeed.io is an open-source tool that helps you analyze and monitor the performance of your web site. It provides a wide range of metrics and can be integrated into your CI/CD pipeline. Compared to @lhci/cli, sitespeed.io offers more comprehensive performance analysis and monitoring capabilities.
webpagetest
WebPageTest is a tool that allows you to run performance tests on your web pages from multiple locations around the world using real browsers. It provides detailed performance reports and can be integrated into your CI/CD pipeline. While @lhci/cli is focused on Lighthouse audits, WebPageTest offers a broader range of performance testing options.