Command-line interface for headless browser automation. Take screenshots, generate PDFs, and extract content from websites.
npm install @browserless/cli> @browserless/cli: CLI to interact with Browserless capabilities.
See CLI section our website for more information.
Using npm:
``sh`
npm install @browserless/cli -g
This package provides a command-line interface for interacting with browserless capabilities directly from your terminal. It exposes the browserless binary that wraps the core browserless API into easy-to-use shell commands.
The @browserless/cli package allows you to:
- Take screenshots from URLs with gradient backgrounds, browser overlays, and device emulation
- Generate PDFs from web pages
- Extract content as HTML or plain text
- Run Lighthouse audits for performance analysis
- Analyze page weight (network requests, transfer size, resource size)
- Check URL status and response information (redirects, headers, status codes)
| Command | Description |
|---------|-------------|
| screenshot | Capture a screenshot with optional overlay and background |pdf
| | Generate a PDF document from a web page |html
| | Serialize the page content to HTML |text
| | Extract plain text content from the page |lighthouse
| | Run a Google Lighthouse audit and output JSON report |page-weight
| | Analyze network requests and resource sizes |ping
| | Get response info: status code, redirects, headers |status
| | Get the HTTP status code |goto
| | Navigate to a URL and return page/response info |
> Note: The lighthouse` command requires an extra installation.
>
> Please make sure to install the standalone package by running:
> npm install -g @browserless/lighthouse
| Dependency | Purpose |
|---------------------------|---------------------------------------------------------|
| browserless | Core API for all browser automation operations |
| @browserless/lighthouse | Lighthouse audit integration (used by lighthouse command) |
The CLI acts as a thin wrapper that parses command-line arguments, initializes a browserless instance, and delegates to the appropriate command handler.
@browserless/cli © Microlink, released under the MIT License.
Authored and maintained by Microlink with help from contributors.
The logo has been designed by xinh studio.
> microlink.io · GitHub microlinkhq · X @microlinkhq