> ## Documentation Index
> Fetch the complete documentation index at: https://www.lettercamp.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Local preview

> Preview Lettercamp pages with live reload, choose a port, and access the preview from another device.

Run this command from the publication directory containing `settings.json` and `pages/`:

```bash theme={null}
npx lettercamp dev
```

Open the preview URL printed in your terminal. The CLI starts on port `3000` by
default. If that port is busy, it tries `8888`, `4000`, `5000`, `6000`, `7000`, and
`8000`, in that order. If all are busy, it tries `3001`, `3002`, and onward. The CLI
prints the port it selected. Changes to pages, imported React components, and `settings.json` reload automatically.
Press **Ctrl+C** to stop the server.

| Option | Description | Default |
| - | - | - |
| `-p, --port <number>` | Start at this port, from `1` to `65535`, and try higher ports sequentially if busy. Overrides the default port order. | `3000` |
| `--host <address>` | Host address to listen on. | `localhost` |
| `--open` | Open the preview in your browser. | Off |

Use a different port and open the preview automatically:

```bash theme={null}
npx lettercamp dev --port 3001 --open
```

To preview from another device on your local network, listen on all interfaces:

```bash theme={null}
npx lettercamp dev --host 0.0.0.0
```

On the other device, open your computer's local IP address on the selected port,
such as `http://192.168.1.10:3000`. This makes the preview accessible to devices that
can reach your computer.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.