---
title: "alis preview"
url: "https://docs.alisx.com/reference/cli/preview/"
---
# alis preview

Say where a service's frontend answers, so your coding agent can open it in the browser its own tools drive and you can open it yourself. Nothing is launched.

## Synopsis

```bash
alis preview [<pkg>|<path>] [flags]
```

Also available as `alis service preview`.

## Description

Start the service first with `alis run`. The address is, in order: `--url`, `--port`, `ALIS_APP_URL`, the port in the service's `.claude/launch.json`, the Makefile's `APP_URL`, the `server.port` of a Vite app at the service root (else 5173), else `localhost:8080`. Without an argument the service is the nearest folder above the current one with a `launch.json` or a Makefile `run` target, else with a `package.json` dev script.

On a laptop the agent opens the result's `url` with its own browser tools (Claude in Chrome, the Codex browser, a Playwright MCP), which drive your own browser on the machine; the `next` field says so. On a workstation the result carries the port's public address (`workstation_url`), behind the platform sign-in: you open it in your own browser, where every page has the Alis toolbar, and the agent drives that tab through the workstation's `page_*` tools, or its own Playwright browser at `url` with the sign-in you shared from the toolbar.

## Flags

| Flag | Type | Default | Meaning |
|---|---|---|---|
| `--port <n>` | int | | The frontend answers at `http://localhost:<port>`. |
| `--url <address>` | string | | The frontend answers at exactly this address (a path such as `/checkout` included). |

Plus the [global flags](https://docs.alisx.com/reference/cli/index.md#global-flags). `--split`, `--ssh` and `--dry-run`, which belonged to the retired terminal-browser launch, are still accepted and do nothing; a note on stderr says so.

## Examples

```bash title="Terminal"
alis preview
alis preview --port 5173
alis preview --url http://localhost:5173/checkout
alis preview --json
```

## Result

`--json` prints `dir`, `url`, `port`, `source` (`url`, `port`, `env`, `launch.json`, `makefile`, `vite` or `default`), `guessed` when nothing in the folder looks like a frontend, and `next` for the agent. On a workstation it adds `workstation_url`, `ssh_alias`, `shell_url` and `hint`.

Never use preview for logs or operation status; those come from `alis logs` and `alis operations`.
