# Install

npx, or a global install.

## Requirements

- Node.js 24 or newer.
- Google Chrome, or another Chromium browser, with the Page Scanner extension installed.

## Two ways

```bash
npx @page-scanner/cli --help         # no install
npm install -g @page-scanner/cli     # then just `page-scanner`
```

## Pair it

Once per machine:

```bash
page-scanner pair
```

It prints a port and a token and saves them to `~/.page-scanner/config.json`. Open the Page
Scanner settings page in Chrome, paste both into **Local agents**, name the browser, and press
**Connect**. `pair` waits up to two minutes and tells you when the browser arrives.

Chrome runs a separate copy of the extension in every profile, so your work profile and your
personal profile are two different browsers here. Naming them is how you tell them apart later.

## Updating

`npx @page-scanner/cli` asks npm for the newest version each time it runs, and installs it when it
is newer, so there is nothing to update. A global install stays on the version it installed, and
while it is there `npx` runs that copy too:

```bash
npm install -g @page-scanner/cli@latest
```

The next command that finds the old daemon still running shuts it down and starts its own. The
pairing in `~/.page-scanner/config.json` carries over, and the extension reconnects by itself, so
nothing needs pairing again.

If you also use the MCP server, keep the two on the same version. A command replaces a daemon of
any other version, so two versions on one machine keep replacing each other's daemon, and the
browser drops its connection each time.
