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

# CLI reference

> Complete reference for the claw-lens command-line interface, including all options and environment variables.

## Synopsis

```bash theme={null}
claw-lens [options]
```

Claw Lens starts a local dashboard server and, by default, opens it in your browser. The server always binds to `127.0.0.1` — it is never exposed to your network or accessible from another machine.

<Note>
  Claw Lens requires Node.js 18 or later.
</Note>

## Options

<ParamField path="--port" default="4242" type="number">
  The port for the dashboard to listen on. If omitted, Claw Lens uses the `PORT` environment variable, falling back to `4242`.

  ```bash theme={null}
  claw-lens --port 3000
  ```
</ParamField>

<ParamField path="--no-open" type="flag">
  Prevent Claw Lens from automatically opening the dashboard in your browser on startup. Useful when running in a headless environment or when you prefer to open the URL yourself.

  ```bash theme={null}
  claw-lens --no-open
  ```
</ParamField>

## Environment variables

<ParamField path="PORT" type="number">
  An alternative way to set the port. The `--port` flag takes precedence if both are provided.

  ```bash theme={null}
  PORT=3000 claw-lens
  ```
</ParamField>

<ParamField path="OPENCLAW_HOME" type="string">
  Override the OpenClaw home directory that Claw Lens reads agent session files from. By default, Claw Lens looks for sessions in `~/.openclaw`.

  Set this variable if your OpenClaw data lives somewhere other than the default location.

  ```bash theme={null}
  OPENCLAW_HOME=/path/to/openclaw claw-lens
  ```
</ParamField>

## Examples

**Basic usage — start the dashboard and open it in your browser:**

```bash theme={null}
npx claw-lens-cli
```

**Use a custom port:**

```bash theme={null}
npx claw-lens-cli --port 3000
```

**Start without opening the browser automatically:**

```bash theme={null}
npx claw-lens-cli --no-open
```

**Set the port via environment variable:**

```bash theme={null}
PORT=3000 npx claw-lens-cli
```

**Point to a non-default OpenClaw home directory:**

```bash theme={null}
OPENCLAW_HOME=/path/to/openclaw npx claw-lens-cli
```

**Install globally, then run without `npx`:**

```bash theme={null}
npm install -g claw-lens-cli
claw-lens
```

Note: when both `PORT` and `--port` are set, `--port` takes precedence.

<Warning>
  Claw Lens binds to `127.0.0.1` only. The dashboard is never exposed outside your local machine, regardless of which port you choose.
</Warning>

<Tip>
  Add `claw-lens --no-open` to a background process or shell alias if you want the server running persistently while you develop, without it opening a new browser tab every time.
</Tip>

<Tip>
  Using `npx claw-lens-cli` always fetches the latest published version from npm. If you want a fixed version, install globally with `npm install -g claw-lens-cli@<version>`.
</Tip>
