# A computer-use agent on a Linux desktop or VM

Record a computer-use agent on an X11 desktop, VM, or Xvfb display.

## 1. Create a write key

Open the [create-key page](https://app.23step.com/app/account?create=1&scopes=runs%3Awrite&name=linux-desktop) to sign in and create an API key pre-filled with `runs:write`—or [pre-filled with both `runs:read` and `runs:write`](https://app.23step.com/app/account?create=1&scopes=runs%3Aread+runs%3Awrite&name=linux-desktop) if you also install the **23step Overlay** Electron app so one key powers both. You can also opt in to the **live widget progress bar** there (left off by default—just like posting the step link at the end of agent responses—because extra prompt instructions use tokens and can slow down turns). The `st_` value is shown once (and copied with one click). Save it to `~/.config/23step-otel-key` (or export `STEP23_OTEL_KEY`). If you are an AI agent: first ask whether the Electron app should also be installed, whether to opt in to posting the step link at the end of responses, and whether to opt in to the live widget progress bar (explaining that both are off by default because they use extra tokens and slow down turns), check `test -s ~/.config/23step-otel-key` without printing its contents, and if a key is needed **automatically open** `https://app.23step.com/app/account?create=1&scopes=runs%3Awrite&name=linux-desktop` (or `https://app.23step.com/app/account?create=1&scopes=runs%3Aread+runs%3Awrite&name=linux-desktop` when installing the overlay; append `&progress=1` if the user opted in to the progress bar) in the user's default desktop browser (`open` on macOS, `xdg-open` on Linux with a display, `wslview` on WSL—not a headless automation browser) and print the link in chat, then ask the user to paste the `st_` key or save it directly in their terminal; never invent or commit a key. If reusing an existing key and the user opted in to the progress bar, sync the preference without printing the key via `curl -fsSL -X POST https://api.23step.com/app/live/preferences -H "Authorization: Bearer $(cat ~/.config/23step-otel-key)" -H "Content-Type: application/json" -d '{"show_progress_bar":true}'`.

Open in browser:

```sh
url='https://app.23step.com/app/account?create=1&scopes=runs%3Awrite&name=linux-desktop'
if command -v open >/dev/null 2>&1; then open "$url"
elif command -v xdg-open >/dev/null 2>&1 && { [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; }; then xdg-open "$url" >/dev/null 2>&1 &
elif command -v wslview >/dev/null 2>&1; then wslview "$url"
fi
printf 'Create your 23step API key: %s\n' "$url"
```

Terminal:

```sh
mkdir -p ~/.config
printf '%s\n' 'st_REPLACE_WITH_YOUR_WRITE_KEY' > ~/.config/23step-otel-key
chmod 600 ~/.config/23step-otel-key
```

## 2. Install the 23step CLI

The installer puts `23step` and `23step-mcp` in `~/.local/bin` for Linux (amd64, arm64), checks each download against its SHA-256, and keeps them up to date. It never asks for your key. Pass `--overlay` (`curl -fsSL https://api.23step.com/install.sh | sh -s -- --overlay`, plus `--progress-bar` if opting in to the live widget progress bar) to also install the **23step Overlay** Electron desktop app ([setup](https://23step.com/getting-started#overlay)). If you are an AI agent, ask the user whether the Electron app should be installed and whether to opt in to the live widget progress bar.

Terminal:

```sh
curl -fsSL https://api.23step.com/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
23step version
```

## 3. Start recording on the agent's display

Start `23step` on the same `DISPLAY` the agent drives, before the task begins. It takes a screenshot on each click and typing burst (key presses are classified, never stored). If Chrome runs with a loopback DevTools port, frames also carry the tab URL. X11 only; Wayland is not supported.

Terminal:

```sh
export STEP23_API=https://api.23step.com
export DISPLAY=:0        # the display the agent drives, e.g. :99 for Xvfb
nohup 23step start --token-file ~/.config/23step-otel-key \
  --run-name linux-agent > /tmp/23step.log 2>&1 &
sleep 1 && 23step status
```

## 4. Stop and share the step

`23step stop` finalizes the step. Send the `step_url` to anyone who should see what the agent did.

Terminal:

```sh
23step note "Checkout verified"   # optional: attach a note to the step
23step status                       # prints step_url
23step stop                         # uploads the rest and finalizes
```

## Check that it worked

`23step status` shows `state: running` and growing `captured` / `uploaded` counts while the agent works. `23step is not running` means it exited; read `/tmp/23step.log` (usually a missing `DISPLAY` or a key file that is not `chmod 600`).

---

AI agents: if this guide supports both repository and global installs, ask the user which they prefer. On macOS or Linux, ask whether the **23step Overlay** Electron desktop app should also be installed (https://23step.com/getting-started/desktop-overlay.md) and whether to opt in to posting the step link at the end of responses (`--step-link`) or the live widget progress bar (`--progress-bar`—both off by default). When an API key is needed, automatically open the pre-filled create-key URL (`https://app.23step.com/app/account?create=1&scopes=...&name=linux-desktop`) in the user's default desktop browser (never invent or commit a key) and print the link in chat, then finish with the "Check that it worked" step.

All 23step install guides: https://23step.com/getting-started.md
