Retrieved article excerpt
Open article · Retrieved 2026-11-24T02:22:00.889368+00:00
# holm
`holm` provides isolated desktop boxes that agents can use to complete and drive real tasks. Each box runs a Linux desktop inside a container or microVM, where an agent can open web pages, drive native apps, take screenshots, move the pointer, type text, run commands, and transfer files. You can also watch the agent work or take control through a browser when it needs help.
[Nine frames of a desktop being driven from Rust: a page opening, a URL typed, text selected by a drag, a context menu, a paste, and a second screen](https://github.com/holm-inc/holm/blob/main/media/demo.gif)
## Contents
- [Quick start](https://github.com/holm-inc/holm#quick-start)
- [Choose an interface](https://github.com/holm-inc/holm#choose-an-interface)
- [Choose how to control the desktop](https://github.com/holm-inc/holm#choose-how-to-control-the-desktop)
- [Desktop operations](https://github.com/holm-inc/holm#desktop-operations)
- [Accessibility operations](https://github.com/holm-inc/holm#accessibility-operations)
- [Browser operations](https://github.com/holm-inc/holm#browser-operations)
- [Display and window operations](https://github.com/holm-inc/holm#display-and-window-operations)
- [Human control](https://github.com/holm-inc/holm#human-control)
- [Configure a desktop](https://github.com/holm-inc/holm#configure-a-desktop)
- [Box lifecycle and history](https://github.com/holm-inc/holm#box-lifecycle-and-history)
- [Server, REST, and MCP](https://github.com/holm-inc/holm#server-rest-and-mcp)
- [Runtimes](https://github.com/holm-inc/holm#runtimes)
- [Custom desktops and runtimes](https://github.com/holm-inc/holm#custom-desktops-and-runtimes)
- [What is inside the box](https://github.com/holm-inc/holm#what-is-inside-the-box)
- [Security](https://github.com/holm-inc/holm#security)
- [Examples](https://github.com/holm-inc/holm#examples)
- [Workspace crates](https://github.com/holm-inc/holm#workspace-crates)
- [Development and testing](https://github.com/holm-inc/holm#development-and-testing)
## Quick start
### Requirements
Install Rust 1.85 or newer and one supported runtime:
- Docker
- Podman
- nerdctl
- microsandbox, for a microVM instead of a container
There's no need to fetch or manage a separate desktop image. The image is built automatically from source the first time you launch a desktop. The initial build takes a few minutes, but later desktops with the same configuration start in seconds.
### Installation
#### Using Curl
```
curl -fsSL https://raw.githubusercontent.com/holm-inc/holm/main/scripts/install.sh | sh
```
#### Build from source
Build and install `holm` and `holmd` from the current source:
```
git clone https://github.com/holm-inc/holm.git
cd holm
cargo install --path . --locked
```
`holm` controls desktops from a shell and serves MCP over stdio. `holmd` keeps the REST and HTTP MCP service running.
Start and control a desktop:
```
BOX=$(holm new)
holm open "$BOX" https://example.com
holm screenshot "$BOX" screen.png
holm rm "$BOX"
```
See the [CLI guide](https://github.com/holm-inc/holm/blob/main/crates/holm-cli/README.md) for server and remote-fleet use.
### Use the Rust API
Add the API without the command dependencies:
```
[dependencies]
holm = { git = "https://github.com/holm-inc/holm", default-features = false }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
```
Launch a desktop, open a page, send input, and take a screenshot:
```
use holm::{Button, Computer, Point};
#[tokio::main]
async fn main() -> holm::Result<()> {
let computer = Computer::launch().await?;
computer.open_url("https://example.com").await?;
computer.click(Point::new(640, 81), Button::Left).await?;
computer.type_text("driven from rust").await?;
let _png = computer.screenshot().await?;
computer.shutdown().await
}
```
CLI:
```
BOX=$(holm new --url https://example.com)
holm mouse "$BOX" click 640 81 left
holm keyboard "$BOX" type "driven from the CLI"
holm screenshot "$BOX" screen.png
holm rm "$BOX"
```
`Computer::launch()` starts one 1280x800 screen. `viewer_url()` returns a browser URL where you can watch it. `shutdown()` stops and removes the container.
From this repository, run the complete example:
```
cargo run --example quickstart
```
## Choose an interface
### CLI
The `holm` command starts an ephemeral local server when no daemon is available. Start `holmd` when you need persistent traces, forks, remote access, or a fleet that survives command exits.
```
holmd
holm new --url https://example.com
holm ls
```
Set `HOLM_SERVER_URL` and, when required, `HOLM_SERVER_TOKEN` to use a remote server. Add `--local` to bypass the server for the smaller set of direct local commands.
See the [CLI guide](https://github.com/holm-inc/holm/blob/main/crates/holm-cli/README.md).
### Rust
The root `holm` package exports the desktop API. Disable its default `cli` feature when an application needs only the library:
```
holm = { git = "https://github.com/holm-inc/holm", default-features = false }
```
Optional features add the E2B, Vercel Sandbox, Daytona, and Modal clients, microsandbox library binding, and daemon storage backends: `e2b`, `vercel`, `daytona`, `modal`, `microsandbox`, `sqlite`, `postgres`, and `s3`.
### REST and Rust client
`holmd` exposes the complete remote API under `/v1`. The API supports box creation and lifecycle, action batches, frames, pages, windows, files, commands, takeovers, CDP access, traces, and forks.
Use [`holm-client`](https://github.com/holm-inc/holm/blob/main/crates/holm-client) from Rust or use HTTP directly. The wire types are in [`holm-api`](https://github.com/holm-inc/holm/blob/main/crates/holm-api).
### MCP
Use either interface:
- `holm mcp --stdio` for a local stdio MCP server
- `http://<server>/mcp` for Streamable HTTP served by `holmd`
Both interfaces expose the same boxes and tools. Hosts that support [MCP Apps](https://github.com/modelcontextprotocol/ext-apps) can show the live desktop beside tool results.
## Choose how to control the desktop
The crate provides three control methods. You can use more than one method in the same task.
**Screen coordinates** work with any visible application. Take a screenshot, select a point, and send mouse or keyboard input. Use this method when the application exposes no structured interface.
**Accessibility nodes** expose native widgets by role and name. Use them for file dialogs, settings panels, installers, and other native interfaces where coordinates can become stale.
**Chrome DevTools** controls Chromium pages directly. Use it to navigate, inspect the DOM, find elements, fill forms, evaluate JavaScript, and manage isolated browser sessions.
## Desktop operations
### Mouse and keyboard
Coordinates use device pixels. The top-left corner is `(0, 0)`.
```
let png = computer.screenshot().await?;
computer.move_to((640, 400)).await?;
computer.click((640, 400), Button::Left).await?;
computer.double_click((640, 400), Button::Left).await?;
computer.drag((100, 100), (400, 300), Button::Left).await?;
computer.type_text("hello").await?;
computer.press("ctrl+shift+p").await?;
computer.scroll((640, 400), Delta::down(3)).await?;
computer.scroll((640, 400), Delta::right(3)).await?;
let pointer = computer.cursor().await?;
```
CLI:
```
holm screenshot "$BOX" frame.png
holm mouse "$BOX" move 640 400
holm mouse "$BOX" click 640 400 left
holm mouse "$BOX" click 640 400 left --double
holm mouse "$BOX" drag 100 100 400 300 left
holm keyboard "$BOX" type "hello"
holm keyboard "$BOX" press "ctrl+shift+p"
holm mouse "$BOX" scroll 640 400 down 3
holm mouse "$BOX" scroll 640 400 right 3
holm mouse "$BOX" at
```
Complete Keyboard and Mouse reference:
```
holm keyboard <box> type <text> [--delay MS]
holm keyboard <box> press <key>... [--held shift,ctrl,alt,super]
holm keyboard <box> down <key> [--hold SECONDS]
holm keyboard <box> up <key>
holm mouse <box> move <x> <y> [--smooth|--human] [--seed N]
holm mouse <box> click <x> <y> [left|right|middle] [--double]
[--held shift,ctrl,alt,super]
[--smooth|--human] [--seed N]
holm mouse <box> drag <x1> <y1> <x2> <y2> [left|right|middle]
[--held shift,ctrl,alt,super]
[--smooth|--human] [--seed N]
holm mouse <box> path <x1> <y1> <x2> <y2> ... [left|right|middle]
[--held shift,ctrl,alt,super]
[--smooth|--human] [--seed N]
holm mouse <box> down [<x> <y>] [left|right|middle] [--hold SECONDS]
[--smooth|--human] [--seed N]
holm mouse <box> up [<x> <y>] [left|right|middle]
holm mouse <box> scroll [<x> <y>] up|down|left|right [NOTCHES]
holm mouse <box> scroll <x> <y> <DY> [DX]
holm mouse <box> at
```
The left button is the default. `--held` applies to a single click or a drag, not to `--double`. A scroll without coordinates uses the centre of the screen. In the signed form, positive `DY` moves down and positive `DX` moves right. `down` and `up` need the server and are not available with `--local`.
`scroll` moves the content below the given point. Positive `dy` moves down and positive `dx` moves right. A delta with both values sends one diagonal gesture.
Common key names work as expected. The crate converts names such as `enter`, `cmd`, and `pageup` to the display server's key names.
Keep these coordinate rules:
- Screenshots do not show the pointer. Use `cursor()` to read its position.
- Do not calculate a click from a scaled screenshot.
- Take a new screenshot after a person or another process changes the desktop.
- Take a new screenshot after an operation opens or raises a browser tab.
Hold modifiers as part of the pointer operation:
```
let screen = computer.primary();
let at = Point::new(640, 400);
let from = Point::new(100, 100);
let to = Point::new(400, 300);
screen.click_with(at, Button::Left, &[Held::Shift]).await?;
screen.drag_with(from, to, Button::Left, &[Held::Ctrl]).await?;
```
CLI:
```
holm mouse "$BOX" click 640 400 left --held shift
holm mouse "$BOX" drag 100 100 400 300 left --held ctrl
```
Modifier pointer operations are available on X11 and on Wayland.
Move the pointer with a smooth line or a repeatable human-like curve:
```
holm mouse "$BOX" move 640 400 --smooth
holm mouse "$BOX" click 640 400 left --human --seed 42
holm mouse "$BOX" drag 100 100 400 300 left --human --seed 42
```
The Rust API exposes the generated steps through `motion::path` and sends a full path in one operation:
```
use holm::{Desktop as _, Motion, Point, motion};
let from = Point::new(100, 100);
let to = Point::new(400, 300);
let steps = motion::path(from, to, Motion::Human, 42);
computer.move_along(&steps).await?;
computer
.drag_along(from, &steps, Button::Left, &[Held::Shift])
.await?;
```
Instant motion stays the default.
Use separate button operations only when a normal drag cannot express the interaction:
```
holm mouse "$BOX" down 400 400 left --hold 10
holm mouse "$BOX" move 900 600 --smooth
holm mouse "$BOX" up 900 600 left
```
A key can stay down between commands in the same way. Everything typed or clicked while it is down carries it:
```
holm keyboard "$BOX" down shift --hold 20
holm mouse "$BOX" click 300 200
holm mouse "$BOX" click 300 400
holm keyboard "$BOX" up shift
```
`down` takes one key, not a combination. The server lets a button or a key go after `--hold` (10 seconds unless told, 60 at most), when a person takes the screen over, and before the box is paused.
The Rust API exposes the same low-level operations:
```
use holm::Desktop as _;
computer
.button_down(Some(Point::new(400, 400)), Button::Left)
.await?;
computer.move_to(Point::new(900, 600)).await?;
computer
.button_up(Some(Point::new(900, 600)), Button::Left)
.await?;
computer.let_go(Button::Left).await?;
```
The server holds a CLI `down` for 10 seconds by default and 60 seconds at most. It releases the button when that limit