diff --git a/cli/commands.mdx b/cli/commands.mdx index c0a90bfe60..6d6b78ea8c 100644 --- a/cli/commands.mdx +++ b/cli/commands.mdx @@ -34,6 +34,7 @@ mint dev [flags] | Flag | Description | | --- | --- | | `--port` | Port to run the local preview on. Defaults to `3000`. | +| `--host` | Expose the local preview on your network. Without this flag, the preview is only available at `localhost`. | | `--no-open` | Do not open the browser automatically. | | `--groups` | Space-separated list of user groups to mock for preview. For example, `--groups admin user`. | | `--signed-in` | Preview as a signed-in reader with no groups. Use `--groups` to preview as specific groups. Without either flag, the preview shows the signed-out view. | diff --git a/cli/preview.mdx b/cli/preview.mdx index e8e8790215..fde17304b0 100644 --- a/cli/preview.mdx +++ b/cli/preview.mdx @@ -80,6 +80,16 @@ mint dev --port 3333 If the port is already in use, the CLI automatically tries the next available port. +## Preview on other devices + +By default, the local preview only accepts connections from your own computer at `localhost`. To open the preview on a phone or another computer on your network, use the `--host` flag: + +```bash +mint dev --host +``` + +The CLI then prints a network URL that other devices on the same network can open. + ## Skip OpenAPI processing If you have many OpenAPI files, skip OpenAPI processing during local development to improve performance with the `--disable-openapi` flag: