---
title: "Preview a service frontend"
url: "https://docs.alisx.com/how-to/alis-build/preview-a-service-frontend/"
---
# Preview a service frontend

Find the address a running service's web frontend answers at, and let your coding agent open it in the browser its own tools drive, so you both look at the same page.

## Prerequisites

- The service running locally.
- An agent with browser tools: Claude Code with Claude in Chrome, Codex with its browser, or any agent with a Playwright MCP.

## Steps

1. Start the service:

    ```bash title="Terminal"
    alis run
    ```

    It loads the product's `.alis/.env` and runs the Makefile `run` target, else the Go main package, else the first component it detects: a Go server in a subfolder, else a frontend app. Ctrl-C stops it.

2. Ask the agent to open the page. It runs:

    ```bash title="Agent runs"
    alis preview --json
    ```

    The address is chosen in order: `--url`, `--port`, `ALIS_APP_URL`, the port in the service's `.claude/launch.json`, the Makefile's `APP_URL`, a Vite app's `server.port` (else 5173), else `localhost:8080`. Nothing is launched: the agent opens the result's `url` with its browser tools and drives the page there (navigate, snapshot, click, read the console), in your own browser on the machine.

3. Point at a different address when needed:

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

=== "In a workstation's browser terminal"

    The result carries the port's public address (`workstation_url`), behind your sign-in. Open it in your own browser: every page has the Alis toolbar, and the agent drives your tab through the workstation's `page_*` tools, or its own Playwright browser with the sign-in you share from the toolbar. See [Annotate your app and let agents test it](https://docs.alisx.com/how-to/alis-build/watch-and-help-your-agents-browser.md).

=== "The dev server runs on a workstation, the agent on your laptop"

    Run `alis preview --json` on the workstation to get the port's public address, and open that.

Never use the preview for logs or operation status: use `alis logs` and `alis operations`.

Related: [alis preview](https://docs.alisx.com/reference/cli/preview.md), [alis run](https://docs.alisx.com/reference/cli/run.md).
