CLI

The pagereflect CLI

Updated Jun 2, 20264 min read
Examples
On this page

Install & auth

The CLI ships in the same `pagereflect` package as the MCP server. Run it with `npx -y pagereflect <command>`; no global install is required, and running through npx keeps the CLI and the MCP server on the same latest version. The simplest way to authenticate is `npx -y pagereflect login`, which signs you in through the browser and stores an org-scoped token at `~/.pagereflect/credentials.json`. Add `--no-browser` on a headless machine for the device-code flow.

For CI or unattended use, set the `PAGEREFLECT_API_KEY` environment variable instead, using a key from Settings, API keys (see API keys); an env key overrides any stored login. For a self-hosted or preview instance, set `PAGEREFLECT_API_URL` to point at it.

HTTP
npx -y pagereflect login
npx -y pagereflect account
npx -y pagereflect audit https://example.com

Commands

`account` shows the connected organization and key. `audit <url>` runs an audit with live progress, and takes an optional `--site` to attach it to an existing site. `run <runId>` shows a run's status. `report <reportId>` prints a report and accepts `--format json` or `--format pdf_url`.

`sites` lists your sites, `history <siteId>` shows recent runs (with `--limit`), and `schedule <siteId>` shows the re-audit schedule. These mirror the API reference exactly.

MCP mode

Running `pagereflect mcp` starts the stdio MCP server instead of a one-shot command. That is the mode Claude Desktop and Claude Code use; see Connect PageReflect to Claude with MCP.

Feedback

Was this page helpful?

The pagereflect CLI, PageReflect docs