CLI

The pagereflect CLI

Updated Sep 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 & MCP (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 whoami
npx -y pagereflect audit https://example.com

Commands

Session: `login` connects your account in the browser, `logout` removes the stored credential, `whoami` shows the connected account, and `doctor` checks Node, config, auth, and connectivity.

Audits and sites: `account` shows the connected organization and key. `audit <url>` runs an audit with a live progress bar and takes an optional `--site <id>` to attach it to an existing site; add `--no-wait` to queue and exit, or `--timeout <sec>` to cap the wait (default 300). `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.

Actions: `actions` lists action items with `--status`, `--priority`, `--site`, `--assignee`, and `--limit` filters. `action:update <actionId>` changes `--status`, `--priority`, `--assignee`, `--due-at`, `--title`, or `--description`. `action:comment <actionId> --body "..."` adds a comment. `action:brief <actionId>` shows a brief and `action:brief:request <actionId>` queues one. `actions:handoff <ids...>` generates a handoff prompt, with `--format markdown` or `--format cursor`.

Every command accepts `--json` for raw output, `--api-key` and `--api-url` to override the environment, `--no-color`, and `--debug` for full stack traces. 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