---
title: "Desktops and screens"
description: "Open an environment's desktop in your browser, and let agents see and control it."
---

> Documentation Index
> Fetch the complete documentation index at: https://regent.c4n.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Desktops and screens

## Add a desktop

```sh
regent create web --desktop
```

A Linux desktop is Xfce with Chromium. macOS environments always have one. `reset --desktop`
adds it to an existing environment; `--desktop=false` removes it.

## Open it

```sh
regent desktop web
```

This opens the desktop in your browser with [Screen Relay](https://screen-relay.dev), at its
actual size. The connection goes through Rex when it's installed, otherwise over ssh; the
desktop is never exposed to your network. `--url-only` prints the address instead.

## Control it from scripts and agents

`regent screen` runs Screen Relay's commands in the environment:

```sh
regent screen web run -- chromium https://example.com   # start an app on the desktop
regent screen web screenshot shot.png                   # saved on this Mac
regent screen web click 0.5 0.25                        # fractions of the screen, 0 to 1
regent screen web type 'hello'
regent screen web key ctrl+l
regent screen web status
```

`regent screen web help` lists every command. Agents work in a loop: take a screenshot, look,
act, take another.

## Chromium

Chromium is the desktop's one browser: whoever opens it, you or an agent, sees the same
window. It isn't started for you. It listens for DevTools on `127.0.0.1:9222` inside the
environment, so browser tools and Playwright can attach to it (`DISPLAY=:1`).

Source: https://regent.c4n.dev/docs/guides/desktop/index.mdx
