# Preview websites and use the terminal

See a website a bot is running on its computer, and open a command line on the bot's computer yourself.

Canonical page: https://themachine.myapps.ai/docs/desktop/cloud-computer/preview-and-terminal

## Preview a website (Browser tab)

When a bot builds a website or web app, it usually **runs** it on its
computer to test it. The **Browser** tab lets you see that website.

### What "localhost:3000" means

When a bot runs a website on its computer, it gives it an address like
`localhost:3000`. *localhost* means "this computer" (the bot's), and the
number is the *port*, like a door number for that website. Different
websites on the same computer use different numbers.

### Open a preview

![The Browser tab previewing a website running on localhost:3000](/images/docs/desktop/computer-browser.webp)

1. Click the **monitor** icon in the chat header.
2. Open the **Browser** tab.
3. Websites the bot has started appear as **Running** chips. Click one.
   Or type an address, like `localhost:3000`, into **Address on the bot's
   computer** and click **Open**.

> **Don't see a Browser tab?**
> On Machine Desktop, the **Browser** tab only shows while it's the view you
> have open. The easiest way to preview a site is the **Browser** window in
> the [Live view](/docs/desktop/live/live-view#browser): type `localhost:3000`
> into its address bar. To open the **Browser** tab itself, choose **Go → Real
> Browser** in the Live view's menu bar. On phones, the **Browser** tab is
> always there.

If nothing is running, you'll see *"Nothing to show yet"*. Ask the bot to
start the site:

> Run the site so I can preview it.

### Other ways to see it

- **In the chat:** when a bot starts a website, a live preview appears in the
  conversation, with **Reload preview** and **Open in browser**.
- **File or Server:** when the page is an HTML file the bot wrote, the chat
  preview and the Live view's **Browser** window show a small switch, **Show
  the page from** **File** or **Server**. **File** (the default) shows the
  file itself, so the page still shows after the server has stopped.
  **Server** shows the running server, for pages that need it, like ones that
  load data.
- **Share it:** create a public link to send to anyone. See [Find, share, and
  export](/docs/desktop/chat/find-share-export).
- **Put it online for good:** see [Deployments](/docs/desktop/deployments).

## Use the terminal (Terminal tab)

The **Terminal** tab is a command line on the bot's computer. It's for people
who are comfortable typing commands. **You don't need it to use Machine**:
the bot does all of this for you. It's there if you want to look around or
run something yourself.

### Open the terminal

1. Click the **monitor** icon in the chat header.
2. Open the **Terminal** tab.

It opens in the bot's workspace folder. Opening it wakes the computer if it
was asleep.

### Buttons

Each terminal has its own tab at the top, like a terminal app.

| Button | What it does |
|---|---|
| **+** (*New terminal*) | Opens another terminal in a new tab. |
| **×** on a tab | Closes that terminal. Closing the last one opens a fresh one. |
| **Reconnect** | Appears if the connection dropped. Click it to start the shell again. |

The terminal session ends when you close the panel. Programs you started in
it stop too. Switching to another part of the panel, like the **Computer**
tab, doesn't end it: your terminals keep running, with their history, until
you come back.

### Keyboard shortcuts

The terminal uses the same keys as Windows Terminal:

| Keys | What they do |
|---|---|
| **Ctrl+C** | Copies the selected text. With nothing selected, it stops the running command, as usual. |
| **Ctrl+V** | Pastes. |
| **Ctrl+Shift+C** / **Ctrl+Shift+V** | Copy and paste, always. |
| **Ctrl+Shift+T** | Opens a new terminal. |
| **Ctrl+Shift+W** | Closes the current terminal. |
| **Ctrl+Tab** / **Ctrl+Shift+Tab** | Switches to the next or previous terminal. |
| **Right-click** | Copies the selected text, or pastes when nothing is selected. |

On a Mac, **⌘** also works in place of **Ctrl**, except for switching
terminals, which is always **Ctrl+Tab**.

### Useful commands

| Command | What it does |
|---|---|
| `ls` | List files in the current folder. |
| `cd foldername` | Go into a folder. `cd ..` goes up one. |
| `cat filename` | Show a text file. |
| `pwd` | Show which folder you're in. |

Anything you change in the terminal changes the thread's computer, so the bot
will see it too.
