@browserless/cli
v10.9.18
Published
Command-line interface for headless browser automation. Take screenshots, generate PDFs, and extract content from websites.
Maintainers
Readme
@browserless/cli: CLI to interact with Browserless capabilities.
See CLI section our website for more information.
Install
Using npm:
npm install @browserless/cli -gAbout
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.
What this package does
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)
Available commands
| Command | Description |
|---------|-------------|
| screenshot <url> | Capture a screenshot with optional overlay and background |
| pdf <url> | Generate a PDF document from a web page |
| html <url> | Serialize the page content to HTML |
| text <url> | Extract plain text content from the page |
| lighthouse <url> | Run a Google Lighthouse audit and output JSON report |
| page-weight <url> | Analyze network requests and resource sizes |
| ping <url> | Get response info: status code, redirects, headers |
| status <url> | Get the HTTP status code |
| goto <url> | Navigate to a URL and return page/response info |
Note: The
lighthousecommand requires an extra installation.Please make sure to install the standalone package by running: npm install -g @browserless/lighthouse
How it fits in the monorepo
This package depends on:
| 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.
License
@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
