@agent-sh/computer-use-linux 0.7.17 → 0.7.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -56
- package/npm/README.md +143 -84
- package/package.json +3 -2
- package/pi/extension/generated-tools.ts +884 -24
- package/skills/computer-use-linux/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h1>computer-use-linux</h1>
|
|
3
|
-
<p><strong>
|
|
3
|
+
<p><strong>Native Linux desktop control for AI agents — over MCP, Pi native tools, and CLI.</strong></p>
|
|
4
4
|
<p>
|
|
5
5
|
<a href="https://github.com/agent-sh/computer-use-linux/actions/workflows/ci.yml"><img src="https://github.com/agent-sh/computer-use-linux/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
6
6
|
<a href="https://crates.io/crates/computer-use-linux"><img src="https://img.shields.io/crates/v/computer-use-linux.svg" alt="crates.io"></a>
|
|
@@ -11,55 +11,89 @@
|
|
|
11
11
|
|
|
12
12
|
> Running open models for your company? [**Tiyuvta**](https://tiyuvta.ai/services/) helps with model choice, deployment and optimization, and fine-tuning on your hardware or cloud account.
|
|
13
13
|
|
|
14
|
-
`computer-use-linux`
|
|
14
|
+
`computer-use-linux` gives AI agents real, structured control of a local Linux desktop: semantic AT-SPI accessibility trees, bounded screenshots, compositor-aware window targeting, Wayland/X11 input synthesis, single-round-trip post-action verification, and a click-through on-screen activity indicator across **GNOME, KDE Plasma/KWin, Hyprland, niri, COSMIC, i3, and X11/EWMH**.
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
Pick the setup that matches your agent or shell workflow:
|
|
19
|
+
|
|
20
|
+
| Host / workflow | Install command |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| **Claude Code** (plugin + skill) | `claude plugin marketplace add agent-sh/computer-use-linux && claude plugin install computer-use-linux@computer-use-linux` |
|
|
23
|
+
| **Codex CLI** (plugin + skill) | `codex plugin marketplace add agent-sh/computer-use-linux && codex plugin add computer-use-linux@computer-use-linux` |
|
|
24
|
+
| **Pi Coding Agent** (native lazy-loaded tools) | `pi install npm:@agent-sh/computer-use-linux` |
|
|
25
|
+
| **Hermes Agent** (CLI + skill + MCP server) | `npm install -g @agent-sh/computer-use-linux && hermes skills tap add agent-sh/computer-use-linux && hermes skills install agent-sh/computer-use-linux/computer-use-linux && hermes mcp add computer-use-linux --command computer-use-linux --args mcp` |
|
|
26
|
+
| **CLI + any stdio MCP client** (npm) | `npm install -g @agent-sh/computer-use-linux` |
|
|
27
|
+
| **CLI + system setup from source** | `git clone https://github.com/agent-sh/computer-use-linux && cd computer-use-linux && ./install.sh` |
|
|
28
|
+
| **Rust crate (`crates.io`)** | `cargo install computer-use-linux` |
|
|
29
|
+
|
|
30
|
+
Verify desktop readiness from the shell (after installing the CLI on `PATH` via `npm install -g @agent-sh/computer-use-linux`, `./install.sh`, or `cargo install computer-use-linux`):
|
|
15
31
|
|
|
16
32
|
```bash
|
|
17
|
-
npm install -g @agent-sh/computer-use-linux
|
|
18
33
|
computer-use-linux doctor | jq .readiness
|
|
34
|
+
computer-use-linux setup # enable AT-SPI accessibility bridge if needed
|
|
35
|
+
computer-use-linux setup-window-targeting # install GNOME Wayland window-control extension if needed
|
|
19
36
|
```
|
|
20
37
|
|
|
21
|
-
The
|
|
38
|
+
> **Plugin-only or Pi-only installs:** The Claude Code / Codex plugin launcher and `pi install` manage private cached binaries and do not add `computer-use-linux` to `PATH`. Either run the MCP `doctor` / `setup_accessibility` / `setup_window_targeting` tools (or `computer_use_linux_doctor` in Pi) directly from your agent, or also install the CLI above when you want shell subcommands on `PATH`.
|
|
22
39
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`computer-use-linux` is a Rust MCP server and CLI for Linux desktop control. The crate ships the main `computer-use-linux` binary plus a small `computer-use-linux-cosmic` helper used only for COSMIC Wayland window management. Any MCP host — Codex Desktop's Linux build, Claude Desktop, [Hermes Agent](https://github.com/NousResearch/hermes-agent), or your own client — can spawn it and gain full control of the local Linux desktop: read accessibility trees, list and focus windows, take screenshots, click, drag, scroll, type, and invoke semantic accessibility actions.
|
|
40
|
+
The Rust crate is published as [`computer-use-linux`](https://crates.io/crates/computer-use-linux) and the npm package as [`@agent-sh/computer-use-linux`](https://www.npmjs.com/package/@agent-sh/computer-use-linux). Prebuilt `x86_64` and `aarch64` Linux binaries ship with the [latest release](https://github.com/agent-sh/computer-use-linux/releases/latest).
|
|
26
41
|
|
|
27
|
-
|
|
42
|
+
> Need an **isolated** desktop where the agent never touches your real mouse, keyboard, or focused window? Use the sibling project [**`agent-workspace-linux`**](https://github.com/agent-sh/agent-workspace-linux) alongside this one.
|
|
28
43
|
|
|
29
|
-
|
|
30
|
-
- **Window targeting is compositor-aware.** The window registry tries GNOME Shell extension, GNOME Shell Introspect, COSMIC Wayland helper, KWin DBus scripting, Hyprland `hyprctl`, the niri IPC socket, i3 IPC, and generic X11/EWMH in order, then reports exactly which backend won or why each backend failed.
|
|
31
|
-
- **Semantic selectors, not pixel coordinates.** Tools like `click`, `perform_action`, and `set_value` accept `role` / `name` / `text` / `states` selectors backed by AT-SPI. Pixel coordinates remain available as a fallback for rendering-only surfaces (canvas, games, X clients without ATK).
|
|
32
|
-
- **One JSON readiness report.** `computer-use-linux doctor` returns a structured document covering platform, portals, AT-SPI, windowing, input, and a `readiness` summary with explicit blockers and a recommended next step. MCP hosts can render or surface that to the user without parsing prose.
|
|
33
|
-
|
|
34
|
-
The crate was extracted from [`codex-desktop-linux`](https://github.com/avifenesh/codex-desktop-linux) (the Linux distribution of Codex Desktop), which still bundles this binary as a built-in plugin. This standalone repo is the upstream.
|
|
44
|
+
## What this is
|
|
35
45
|
|
|
36
|
-
|
|
46
|
+
`computer-use-linux` is a Rust MCP server and CLI for Linux desktop control. It ships three binaries — the main `computer-use-linux` server/CLI, the `computer-use-linux-cosmic` Wayland toplevel helper for COSMIC, and the `computer-use-linux-indicator` click-through activity overlay. Any MCP host — Claude Code, Codex CLI, Codex Desktop's Linux build, [Pi Coding Agent](#pi-coding-agent), [Hermes Agent](https://github.com/NousResearch/hermes-agent), Claude Desktop, or your own client — can spawn it to inspect accessibility trees, list and focus windows, take screenshots, click, drag, scroll, type, and invoke semantic accessibility actions.
|
|
37
47
|
|
|
38
|
-
MCP
|
|
48
|
+
Most computer-use MCP servers are macOS-only (they lean on AppKit, AXUIElement, CGEvent). The few that target Linux either drive `xdotool` against an X11 root window or shell out to OCR over screenshots. Five things set this one apart:
|
|
39
49
|
|
|
40
|
-
**
|
|
50
|
+
- **Wayland actually works.** Pointer actions use `/dev/uinput` or `org.freedesktop.portal.RemoteDesktop` on Wayland, with `ydotool` / `ydotoold` as the fallback. Literal text prefers KDE clipboard integration on Plasma, `wtype` on compatible Wayland compositors, and portal keysyms on other Wayland sessions, including GNOME with ydotool installed. Portal text startup or conversion errors fail the call without replaying text through ydotool. Raw ydotool text accepts printable ASCII, tab and newline only, and its physical US key positions can produce different text under the active layout. Screenshots use the GNOME Shell DBus screenshot method when present, `org.freedesktop.portal.Screenshot` otherwise, then on a native X11 session a root-window `GetImage` (device pixels, no toolkit scaling), and finally spawn `gnome-screenshot` for background/systemd contexts where the DBus paths are denied.
|
|
51
|
+
- **Window targeting is compositor-aware.** The window registry tries GNOME Shell extension, GNOME Shell Introspect, COSMIC Wayland helper, KWin DBus scripting, Hyprland `hyprctl`, the niri IPC socket, i3 IPC, and generic X11/EWMH in order, then reports exactly which backend won or why each backend failed. Terminal windows are enriched with their controlling TTY and foreground process so agents can target "the terminal running `pytest`" directly.
|
|
52
|
+
- **Semantic selectors first, pixel coordinates when needed.** Tools like `click`, `perform_action`, and `set_value` accept `role` / `name` / `text` / `states` selectors or `element_index` values backed by AT-SPI, and every mutating tool can return a post-action screenshot and updated accessibility tree in the same round trip. Pixel coordinates remain available for rendering-only surfaces (canvas, games, X clients without ATK).
|
|
53
|
+
- **Visible to humans, invisible to screenshots.** While an agent acts, `computer-use-linux-indicator` renders a click-through overlay with a per-agent cursor glide, click ripple, keycaps/typing banner, screen-edge glow, and status pill — and hides automatically under a shared capture lock before any screenshot is read.
|
|
54
|
+
- **One JSON readiness report.** `computer-use-linux doctor` returns a structured document covering platform, portals, AT-SPI, windowing, input, and a `readiness` summary with explicit blockers and a recommended next step. MCP hosts can render or surface that to the user without parsing prose.
|
|
41
55
|
|
|
42
|
-
|
|
43
|
-
- `setup_accessibility` — enables GNOME's `org.gnome.desktop.interface toolkit-accessibility` setting so toolkit apps expose AT-SPI trees
|
|
44
|
-
- `setup_window_targeting` — installs and enables the bundled GNOME Shell extension when `org.gnome.Shell.Introspect` is locked down
|
|
56
|
+
The crate was extracted from [`codex-desktop-linux`](https://github.com/avifenesh/codex-desktop-linux) (the Linux distribution of Codex Desktop), which bundles this backend for its native Computer Use feature. This standalone repo is the upstream.
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
## MCP tools & features
|
|
47
59
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
| Category | Tool | What it does |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| **Diagnostics & setup** | `doctor` | Single-shot JSON readiness report (platform, portals, accessibility, windowing, input, readiness summary, and capability map). |
|
|
63
|
+
| | `setup_accessibility` | Enables and verifies GNOME's `org.gnome.desktop.interface toolkit-accessibility` setting so toolkit apps expose AT-SPI trees. |
|
|
64
|
+
| | `setup_window_targeting` | Installs and enables the bundled GNOME Shell extension when `org.gnome.Shell.Introspect` is locked down. |
|
|
65
|
+
| **Discovery & observation** | `get_app_state` | Combined screenshot + compacted AT-SPI accessibility tree with stable `element_index` handles. Scope with `app_name_or_bundle_identifier` or a window target (`window_id`, `pid`, `app_id`, `wm_class`, `title`). |
|
|
66
|
+
| | `screenshot` | Bounded PNG or JPEG capture of the full desktop (`full_screen: true` or no target) or a raised and cropped target window (`window_id`, `pid`, `app_id`, `wm_class`, `title`, `raise_window`). |
|
|
67
|
+
| | `list_windows` | Compositor windows with `window_id`, title, `app_id`, `wm_class`, PID, focus state, client type (`wayland`/`x11`), bounds, and terminal TTY/process metadata. |
|
|
68
|
+
| | `focused_window` | The window currently holding keyboard focus. |
|
|
69
|
+
| | `list_apps` | Running desktop applications visible to the AT-SPI registry. |
|
|
70
|
+
| **Input** | `click` | Click by `element_index`, semantic selector (`role`/`name`/`text`/`states`), or desktop/window-relative coordinates (`left`/`right`/`middle`, `click_count`). |
|
|
71
|
+
| | `drag` | Desktop coordinate drag from `(start_x, start_y)` to `(end_x, end_y)`. |
|
|
72
|
+
| | `scroll` | Page-based vertical/horizontal scroll on an element, window, or pixel coordinate. |
|
|
73
|
+
| | `press_key` | Single keys or chords (`Ctrl+L`, `Alt+F4`, `Return`), optionally focusing a target window or terminal first. |
|
|
74
|
+
| | `type_text` | Literal text entry, optionally targeted at a window or terminal (`tty`, `terminal_pid`, `terminal_command`, `terminal_cwd`). |
|
|
75
|
+
| **Semantic actions** | `perform_action` | Invoke any AT-SPI action exposed by an element (`Press`, `Activate`, `Toggle`, `Jump`, …); defaults to the primary action. |
|
|
76
|
+
| | `set_value` | Write directly to a settable accessibility element (text fields, sliders, spinners). |
|
|
77
|
+
| **Window management** | `activate_window` | Focus a window by `window_id`, `pid`, `app_id`, `wm_class`, `title`, or terminal selectors. |
|
|
78
|
+
| | `move_window` / `resize_window` | Reposition or resize a window in desktop coordinates (GNOME Shell extension and X11/EWMH backends). |
|
|
79
|
+
| **Opt-in host tools** | `complete_interaction` | Parameter-free desktop completion notification (`notify-send`); registered only when `COMPUTER_USE_LINUX_NOTIFY_ON_COMPLETE=1`. |
|
|
80
|
+
| | `run_shell` | Bounded non-login `/bin/sh -c` execution; registered only when `COMPUTER_USE_LINUX_ENABLE_SHELL=1` (absent by default). |
|
|
81
|
+
|
|
82
|
+
### Post-action observation in one round trip
|
|
83
|
+
|
|
84
|
+
All mutating tools (`click`, `drag`, `scroll`, `press_key`, `type_text`, `perform_action`, `set_value`, `activate_window`, `move_window`, and `resize_window`) accept optional post-action observation parameters so an action and its verification complete in a single MCP tool call:
|
|
85
|
+
|
|
86
|
+
- `screenshot_after: true | "screen" | "window" | false` — capture after the action is dispatched and the indicator overlay is hidden (`true` or `"screen"` for full desktop, `"window"` cropped to the action's target window or the focused window when untargeted)
|
|
87
|
+
- `format`, `quality`, `scale`, `max_width`, `max_height`, `max_bytes` — same screenshot payload controls as `screenshot` and `get_app_state`
|
|
88
|
+
- `include_tree: true` — include a fresh compacted AT-SPI accessibility tree and update cached `element_index` values
|
|
89
|
+
|
|
90
|
+
When post-action screenshot capture succeeds, the image is returned as the first MCP `image` content block alongside the JSON action summary and `screenshot` metadata. If the action succeeds (`ok: true`) and only the post-action screenshot or tree capture fails, `ok` remains `true` and the error is reported in `screenshot_error` / `accessibility_error` and appended to `message`.
|
|
91
|
+
|
|
92
|
+
### Screenshot sizing & coordinate scaling
|
|
53
93
|
|
|
54
94
|
Screenshot payloads are size-bounded by default before they are returned to the MCP host: max 1920 px width/height and 2 MiB image bytes, with hard caps even when callers request more. Agents that need more detail can pass `max_width`, `max_height`, `max_bytes`, `scale`, `format: "jpeg"`, or `quality`, preferably with a window target or crop. PNG remains the default; JPEG lets callers trade lossless pixels for a smaller payload before the byte cap forces further resizing. Returned screenshot metadata includes `coordinate_width`, `coordinate_height`, `scale`, `format`, and `quality` so callers can convert from a downscaled preview to desktop coordinate pixels.
|
|
55
95
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- `click` — by element index, semantic selector, or desktop coordinate pixels
|
|
59
|
-
- `drag` — desktop coordinate drag (start / end)
|
|
60
|
-
- `scroll` — page-based scroll on an element or at a pixel location
|
|
61
|
-
- `press_key` — keys / chords; can focus a window or terminal first
|
|
62
|
-
- `type_text` — literal text input, optionally targeted at a window or terminal
|
|
96
|
+
### Input & semantic targeting contracts
|
|
63
97
|
|
|
64
98
|
For a plain left `click` by element index or selector, a recognized native
|
|
65
99
|
AT-SPI `click`, `press`, or `toggle` action takes precedence
|
|
@@ -84,17 +118,7 @@ On X11, text input sends LF and CRLF line endings as Return, with one newline pe
|
|
|
84
118
|
|
|
85
119
|
On GNOME, a read-only keymap preflight rejects the whole string before input if a character is absent or requires a modifier level Mutter cannot synthesize. The background reader cannot establish the active layout group, so every configured group must support the text. This can reject text that works in one of several groups; use `set_value` on an editable field instead. The check requires `libxkbcommon.so.0` at runtime and stops after a two-second keymap read deadline. It does not cover held modifiers or a keymap changed concurrently with typing.
|
|
86
120
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- `perform_action` — invoke any AT-SPI action exposed by an element (`Press`, `Activate`, `Toggle`, …); defaults to the primary action
|
|
90
|
-
- `set_value` — write to a settable accessibility element (text fields, sliders, spinners)
|
|
91
|
-
|
|
92
|
-
**Navigation**
|
|
93
|
-
|
|
94
|
-
- `activate_window` — focus a window by `window_id`, `pid`, `app_id`, `wm_class`, `title`, or terminal selectors
|
|
95
|
-
- `move_window` / `resize_window` — reposition or resize a window in desktop coordinates (GNOME Shell extension backend); useful to recover windows that are partially off-screen
|
|
96
|
-
|
|
97
|
-
**On-screen indicator**
|
|
121
|
+
### On-screen indicator
|
|
98
122
|
|
|
99
123
|
While an agent acts, the server drives `computer-use-linux-indicator`, a click-through overlay that shows what it is doing: a software cursor tinted per agent that glides to each coordinate `click`, `drag`, or `scroll` target and ripples on click (AT-SPI actions such as `perform_action`, `set_value`, and element clicks show in the pill without moving it, since no pointer moves); keycaps for `press_key` and a typing line for `type_text`; a glow along every screen edge; and a status pill such as *Claude is using your computer · click*. Pointer actions wait 350 ms so the cursor lands before the real input. While `screenshot` or `get_app_state` captures the screen, the overlay draws nothing, so agents never see it: not their own, not one shown for another agent, and not one that another agent starts mid-capture. This holds with `COMPUTER_USE_LINUX_INDICATOR=0` too, which only stops a server from showing its own actions. The capture waits for the compositor only when something was on screen. The agent name comes from the MCP client's `clientInfo`.
|
|
100
124
|
|
|
@@ -104,12 +128,6 @@ Screenshot processing uses one blocking worker per server. Captures enter one pi
|
|
|
104
128
|
|
|
105
129
|
Captures require the shared capture lock and, when an overlay is running, its acknowledgement that it has hidden. A missing or invalid acknowledgement, a stalled socket, or a failed lock returns a capture error. Concurrent captures keep separate holds; their acknowledgements are exchanged in order.
|
|
106
130
|
|
|
107
|
-
**Conditional host execution**
|
|
108
|
-
|
|
109
|
-
- `complete_interaction` - optional desktop completion notification, registered only with `COMPUTER_USE_LINUX_NOTIFY_ON_COMPLETE=1`. Repeated calls can create repeated notifications; it does not provide desktop exclusivity.
|
|
110
|
-
|
|
111
|
-
- `run_shell` — same-user `/bin/sh -c` execution without login-profile loading, registered only when the server operator starts the MCP process with `COMPUTER_USE_LINUX_ENABLE_SHELL=1`. It is deliberately absent by default and is not a sandbox.
|
|
112
|
-
|
|
113
131
|
### MCP safety contract
|
|
114
132
|
|
|
115
133
|
`computer-use-linux` is not a read-only data source. It can observe the local desktop and, when a mutating tool is called, can change real application state. The `tools/list` response includes MCP `ToolAnnotations` so hosts can surface this distinction before invocation:
|
|
@@ -160,11 +178,11 @@ If you run on a desktop not covered above, or a covered backend does not come up
|
|
|
160
178
|
|
|
161
179
|
## Install
|
|
162
180
|
|
|
163
|
-
|
|
181
|
+
`./install.sh`, `cargo install`, the npm wrapper, and the Claude/Codex plugin launcher all install `computer-use-linux`, `computer-use-linux-cosmic` (COSMIC Wayland helper), and `computer-use-linux-indicator` (on-screen activity overlay) together automatically. Only manual prebuilt-binary installs need you to download all three release assets.
|
|
164
182
|
|
|
165
183
|
### Option A — `./install.sh` from a clone
|
|
166
184
|
|
|
167
|
-
Installs system packages on Debian/Ubuntu, Fedora/RHEL-like, Arch-like, or Artix systems; installs Rust if needed; builds
|
|
185
|
+
Installs system packages on Debian/Ubuntu, Fedora/RHEL-like, Arch-like, or Artix systems; installs Rust if needed; builds all three release binaries (`computer-use-linux`, `computer-use-linux-cosmic`, and `computer-use-linux-indicator`); installs them to `~/.local/bin`; configures `ydotoold` as a systemd user service when available; enables GNOME AT-SPI settings when running under GNOME; and installs the bundled GNOME Shell extension on GNOME Wayland.
|
|
168
186
|
|
|
169
187
|
```bash
|
|
170
188
|
git clone https://github.com/agent-sh/computer-use-linux
|
|
@@ -178,7 +196,7 @@ computer-use-linux doctor | jq .readiness
|
|
|
178
196
|
|
|
179
197
|
### Option B — `cargo install` (Rust binaries, no system setup)
|
|
180
198
|
|
|
181
|
-
Installs
|
|
199
|
+
Installs all three Rust binaries from crates.io. You still handle the system-level pieces yourself: AT-SPI, desktop portals, the optional `ydotoold` fallback, and the GNOME extension if you need the GNOME Wayland exact-focus backend.
|
|
182
200
|
|
|
183
201
|
```bash
|
|
184
202
|
cargo install computer-use-linux
|
|
@@ -203,7 +221,7 @@ computer-use-linux setup-window-targeting # GNOME Shell extension
|
|
|
203
221
|
|
|
204
222
|
### Option C — npm wrapper (binary download)
|
|
205
223
|
|
|
206
|
-
Good for users who already have Node.js and want a no-Rust install. The npm package downloads and verifies the matching
|
|
224
|
+
Good for users who already have Node.js and want a no-Rust install. The npm package downloads and verifies the matching `computer-use-linux`, `computer-use-linux-cosmic`, and `computer-use-linux-indicator` binaries during install, then the wrapper wires `COMPUTER_USE_LINUX_COSMIC_HELPER` and `COMPUTER_USE_LINUX_INDICATOR_BIN` to the bundled helpers automatically.
|
|
207
225
|
|
|
208
226
|
```bash
|
|
209
227
|
npm install -g @agent-sh/computer-use-linux
|
|
@@ -230,7 +248,7 @@ for binary in computer-use-linux computer-use-linux-cosmic computer-use-linux-in
|
|
|
230
248
|
done
|
|
231
249
|
```
|
|
232
250
|
|
|
233
|
-
You will still need
|
|
251
|
+
You will still need AT-SPI enabled (`computer-use-linux setup`) and one input backend reported ready by `doctor` (start `ydotoold` only when using the ydotool fallback).
|
|
234
252
|
|
|
235
253
|
## Wire it into your MCP host
|
|
236
254
|
|
|
@@ -270,7 +288,7 @@ already bundles Computer Use; do not install both there.
|
|
|
270
288
|
|
|
271
289
|
### Codex Desktop (Linux build)
|
|
272
290
|
|
|
273
|
-
|
|
291
|
+
[`codex-desktop-linux`](https://github.com/avifenesh/codex-desktop-linux) includes a native `computer-use-linux` feature that embeds and stages this backend inside the app's unified Computer Use plugin. Enable `computer-use-linux` via `make setup-native` (or in `linux-features/features.json` followed by `make install-native`), then toggle **Settings → Computer use → Any App** in the desktop app. Do not register a second standalone `computer-use-linux` MCP server inside Codex Desktop when the native feature is enabled.
|
|
274
292
|
|
|
275
293
|
### Claude Code (CLI)
|
|
276
294
|
|
package/npm/README.md
CHANGED
|
@@ -1,29 +1,76 @@
|
|
|
1
|
-
# computer-use-linux
|
|
1
|
+
# @agent-sh/computer-use-linux
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Native Linux desktop observation and control for AI agents — published as
|
|
4
4
|
[`@agent-sh/computer-use-linux`](https://www.npmjs.com/package/@agent-sh/computer-use-linux).
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
`
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Do not use widget-local or raw GDK surface coordinates. A window target is
|
|
21
|
-
required.
|
|
6
|
+
Provides:
|
|
7
|
+
- **`computer-use-linux` CLI & stdio MCP server** (`computer-use-linux mcp`)
|
|
8
|
+
- **Native Pi coding agent extension** (`computer_use_linux_*` tools)
|
|
9
|
+
- **Bundled helpers**: `computer-use-linux-cosmic` (COSMIC window targeting) and `computer-use-linux-indicator` (on-screen agent activity overlay)
|
|
10
|
+
|
|
11
|
+
> **Security note**: this server can control the local Linux desktop. Tools such as
|
|
12
|
+
> `click`, `type_text`, `press_key`, `perform_action`, and `set_value` are
|
|
13
|
+
> mutating and can change real application state. The MCP tool list includes
|
|
14
|
+
> `ToolAnnotations` so hosts can distinguish read-only observation from mutating
|
|
15
|
+
> desktop actions.
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
### 1. CLI & MCP server
|
|
22
20
|
|
|
23
21
|
```bash
|
|
24
22
|
npm install -g @agent-sh/computer-use-linux
|
|
25
23
|
computer-use-linux doctor
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Configure in any MCP client:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"computer-use-linux": {
|
|
32
|
+
"command": "computer-use-linux",
|
|
33
|
+
"args": ["mcp"]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Pi coding agent (native tools)
|
|
40
|
+
|
|
41
|
+
```bash
|
|
26
42
|
pi install npm:@agent-sh/computer-use-linux
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
When installed through Pi, the package supplies native, dynamically loaded
|
|
46
|
+
`computer_use_linux_*` tools. No separate MCP adapter or manual MCP
|
|
47
|
+
configuration is required. Native tools require Pi 0.84.4 or newer; the
|
|
48
|
+
standalone CLI wrapper retains Node.js 18 support.
|
|
49
|
+
|
|
50
|
+
In Pi codemode, native tools return `{ text, images, isError }`. Pass image
|
|
51
|
+
blocks directly to `image(result.images[0])` and check `isError` before using
|
|
52
|
+
a result.
|
|
53
|
+
|
|
54
|
+
### 3. Claude Code & Codex CLI plugins
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Claude Code
|
|
58
|
+
claude plugin marketplace add agent-sh/computer-use-linux
|
|
59
|
+
claude plugin install computer-use-linux@computer-use-linux
|
|
60
|
+
|
|
61
|
+
# Codex CLI
|
|
62
|
+
codex plugin marketplace add agent-sh/computer-use-linux
|
|
63
|
+
codex plugin add computer-use-linux@computer-use-linux
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The plugin registers the MCP server and caches private release binaries on first
|
|
67
|
+
start (it does not put `computer-use-linux` on `PATH`; also run step 1 if you
|
|
68
|
+
want the shell CLI).
|
|
69
|
+
|
|
70
|
+
### 4. Hermes Agent
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install -g @agent-sh/computer-use-linux
|
|
27
74
|
hermes skills tap add agent-sh/computer-use-linux
|
|
28
75
|
hermes skills install agent-sh/computer-use-linux/computer-use-linux
|
|
29
76
|
hermes mcp add computer-use-linux --command computer-use-linux --args mcp
|
|
@@ -31,40 +78,6 @@ hermes mcp test computer-use-linux
|
|
|
31
78
|
hermes mcp configure computer-use-linux
|
|
32
79
|
```
|
|
33
80
|
|
|
34
|
-
For an optional MCP completion notification, set
|
|
35
|
-
`COMPUTER_USE_LINUX_NOTIFY_ON_COMPLETE=1` in the server environment and have the
|
|
36
|
-
agent call `complete_interaction` after its desktop work. `notify-send` must be
|
|
37
|
-
installed with an available desktop notification service. The cue is best effort
|
|
38
|
-
and does not provide exclusive desktop ownership.
|
|
39
|
-
This cue is available only to directly spawned MCP hosts; the native Pi extension
|
|
40
|
-
does not yet forward the flag or include the tool in its catalog.
|
|
41
|
-
|
|
42
|
-
On GNOME Wayland the remote-control portal asks again for every new server
|
|
43
|
-
process. Set `COMPUTER_USE_LINUX_PERSIST_REMOTE_DESKTOP=1` in that process's
|
|
44
|
-
environment to reuse a restore token instead. The first dialog still appears.
|
|
45
|
-
Leave it unset to keep the prompt. The repository README records where the
|
|
46
|
-
token is stored and who can read it.
|
|
47
|
-
|
|
48
|
-
On niri, export the session's `NIRI_SOCKET` to the server. Window listing and
|
|
49
|
-
exact focus use `niri msg` with a direct IPC fallback. Missing positions or
|
|
50
|
-
unknown/mixed output scaling leave window-relative coordinates unavailable;
|
|
51
|
-
focus the target and inspect a fresh full-screen screenshot before using
|
|
52
|
-
desktop coordinates.
|
|
53
|
-
|
|
54
|
-
If accessibility is disabled, run `computer-use-linux setup`. Setup writes and
|
|
55
|
-
reads back GNOME's `toolkit-accessibility` setting and warns if only runtime
|
|
56
|
-
accessibility is available. Restart target apps if their trees remain empty.
|
|
57
|
-
|
|
58
|
-
To explicitly keep that saved setting enabled during desktop automation, run
|
|
59
|
-
`computer-use-linux guard-accessibility` in a foreground terminal. It registers
|
|
60
|
-
a passive AT-SPI window-activation listener and reasserts the current user's
|
|
61
|
-
GNOME `toolkit-accessibility` key after resets, verifying each write by readback.
|
|
62
|
-
This affects other apps using the same user setting. MCP, setup, and
|
|
63
|
-
`get_app_state` never start it automatically. Stop with Ctrl-C or SIGTERM before
|
|
64
|
-
disabling accessibility; stopping removes its listener and ends writes without
|
|
65
|
-
disabling other clients or restoring an old value. An app launched during a
|
|
66
|
-
reset may still need restarting, so this is not a complete GNOME toggle fix.
|
|
67
|
-
|
|
68
81
|
The generated Hermes config should look like this:
|
|
69
82
|
|
|
70
83
|
```yaml
|
|
@@ -76,45 +89,91 @@ mcp_servers:
|
|
|
76
89
|
connect_timeout: 30
|
|
77
90
|
```
|
|
78
91
|
|
|
79
|
-
|
|
92
|
+
## What the package installs
|
|
93
|
+
|
|
94
|
+
The package downloads the matching Linux `x86_64` or `aarch64` binary from the
|
|
80
95
|
GitHub release for this package version and verifies the `.sha256` asset before
|
|
81
96
|
installing it. It also installs the matching `computer-use-linux-cosmic` helper
|
|
82
97
|
used for COSMIC desktop window targeting and the `computer-use-linux-indicator`
|
|
83
98
|
overlay that shows agent activity on screen (`COMPUTER_USE_LINUX_INDICATOR=0`
|
|
84
99
|
turns it off).
|
|
85
100
|
|
|
86
|
-
When installed through Pi, the package supplies native, dynamically loaded
|
|
87
|
-
`computer_use_linux_*` tools. No separate MCP adapter or manual MCP
|
|
88
|
-
configuration is required. Native tools require Pi 0.84.4 or newer; the
|
|
89
|
-
standalone CLI wrapper retains Node.js 18 support.
|
|
90
|
-
|
|
91
|
-
In Pi codemode, native tools return `{ text, images, isError }`. Pass image
|
|
92
|
-
blocks directly to `image(result.images[0])` and check `isError` before using
|
|
93
|
-
a result.
|
|
94
|
-
|
|
95
101
|
If you already built or installed the binary yourself, set
|
|
96
102
|
`COMPUTER_USE_LINUX_BIN=/path/to/computer-use-linux` to make the wrapper use
|
|
97
103
|
that executable instead.
|
|
98
104
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
105
|
+
## Post-action observation & completion cue
|
|
106
|
+
|
|
107
|
+
Mutating tools (`click`, `drag`, `scroll`, `press_key`, `type_text`,
|
|
108
|
+
`perform_action`, `set_value`, `activate_window`, `move_window`, and
|
|
109
|
+
`resize_window`) accept `screenshot_after: true | "screen" | "window"`,
|
|
110
|
+
`format`/`quality`/`scale`/`max_width`/`max_height`/`max_bytes`, and
|
|
111
|
+
`include_tree: true` to return a post-action screenshot and/or compacted AT-SPI
|
|
112
|
+
tree in the same tool result.
|
|
113
|
+
|
|
114
|
+
For an optional MCP completion notification, set
|
|
115
|
+
`COMPUTER_USE_LINUX_NOTIFY_ON_COMPLETE=1` in the server environment and have the
|
|
116
|
+
agent call `complete_interaction` after its desktop work. `notify-send` must be
|
|
117
|
+
installed with an available desktop notification service. The cue is best effort
|
|
118
|
+
and does not provide exclusive desktop ownership.
|
|
119
|
+
This cue is available only to directly spawned MCP hosts; the native Pi extension
|
|
120
|
+
does not yet forward the flag or include the tool in its catalog.
|
|
121
|
+
|
|
122
|
+
## Desktop setup & compositor notes
|
|
123
|
+
|
|
124
|
+
- **Accessibility setup**: If accessibility is disabled, run `computer-use-linux setup`. Setup writes and
|
|
125
|
+
reads back GNOME's `toolkit-accessibility` setting and warns if only runtime
|
|
126
|
+
accessibility is available. Restart target apps if their trees remain empty.
|
|
127
|
+
- **Foreground accessibility guard**: To explicitly keep that saved setting enabled during desktop automation, run
|
|
128
|
+
`computer-use-linux guard-accessibility` in a foreground terminal. It registers
|
|
129
|
+
a passive AT-SPI window-activation listener and reasserts the current user's
|
|
130
|
+
GNOME `toolkit-accessibility` key after resets, verifying each write by readback.
|
|
131
|
+
This affects other apps using the same user setting. MCP, setup, and
|
|
132
|
+
`get_app_state` never start it automatically. Stop with Ctrl-C or SIGTERM before
|
|
133
|
+
disabling accessibility; stopping removes its listener and ends writes without
|
|
134
|
+
disabling other clients or restoring an old value. An app launched during a
|
|
135
|
+
reset may still need restarting, so this is not a complete GNOME toggle fix.
|
|
136
|
+
- **GNOME Wayland portal persistence**: On GNOME Wayland the remote-control portal asks again for every new server
|
|
137
|
+
process. Set `COMPUTER_USE_LINUX_PERSIST_REMOTE_DESKTOP=1` in that process's
|
|
138
|
+
environment to reuse a restore token instead. The first dialog still appears.
|
|
139
|
+
Leave it unset to keep the prompt. The repository README records where the
|
|
140
|
+
token is stored and who can read it.
|
|
141
|
+
- **niri**: On niri, export the session's `NIRI_SOCKET` to the server. Window listing and
|
|
142
|
+
exact focus use `niri msg` with a direct IPC fallback. Missing positions or
|
|
143
|
+
unknown/mixed output scaling leave window-relative coordinates unavailable;
|
|
144
|
+
focus the target and inspect a fresh full-screen screenshot before using
|
|
145
|
+
desktop coordinates.
|
|
146
|
+
|
|
147
|
+
## Input & coordinate contracts
|
|
148
|
+
|
|
149
|
+
- **Click vs. semantic actions**: Plain left `click` by element index or selector prefers a native AT-SPI
|
|
150
|
+
`click`, `press`, or `toggle` action over toolkit bounds,
|
|
151
|
+
avoiding pointer-coordinate conversion when that action is available. Explicit
|
|
152
|
+
`activate`/`jump` requests belong in `perform_action`, not `click`, even when
|
|
153
|
+
bounds are missing. Explicit
|
|
154
|
+
`x`/`y`, right clicks, and multi-clicks retain pointer semantics. For coordinate
|
|
155
|
+
`click` or `scroll` with `relative: true`, use the clipped target-window
|
|
156
|
+
screenshot crop origin and divide preview coordinates by screenshot `scale`.
|
|
157
|
+
Do not use widget-local or raw GDK surface coordinates. A window target is
|
|
158
|
+
required.
|
|
159
|
+
- **X11 text input**: X11 text input sends LF and CRLF line endings as Return. Focused terminals
|
|
160
|
+
accept keyboard input even when AT-SPI does not expose EditableText. Focus
|
|
161
|
+
feedback describes the target; re-observe its contents to confirm input.
|
|
162
|
+
- **Hyprland `type_text`**: On Hyprland, `type_text` passes one literal wtype argument after `--` for a
|
|
163
|
+
classified nonsecret field, avoiding stdin keymap-refresh corruption in Electron.
|
|
164
|
+
Argument text is visible in process listings, so confirmed password roles are
|
|
165
|
+
rejected. Terminals and ambiguous roles (`Entry`/`Text`, `text box`, unreadable
|
|
166
|
+
roles), or a missing/incomplete/timed-out probe, use private stdin for at most
|
|
167
|
+
100 Unicode characters per call. This includes terminals with AT-SPI support;
|
|
168
|
+
they can still contain password prompts. Larger ambiguous-field text must be
|
|
169
|
+
split into smaller calls or, for a nonterminal field, accessibility enabled.
|
|
170
|
+
The input probe has its own 1.5-second budget; the 250 ms indicator probe only
|
|
171
|
+
masks text. Both protections apply with the indicator disabled. Other compatible
|
|
172
|
+
compositors retain their existing stdin path. Wtype rejects NUL and text over
|
|
173
|
+
131,071 UTF-8 bytes before focusing a window or displaying text. `ok: true`
|
|
174
|
+
confirms dispatch only; every text backend leaves field contents unverified.
|
|
175
|
+
Re-observe before retrying. Exact window focus alone does not suppress missing-focus
|
|
176
|
+
warnings: only a complete scoped tree containing window/menu chrome without
|
|
177
|
+
content makes the feedback informational. Such trees get a conditional
|
|
178
|
+
Electron/Chromium hint computed before compaction; this is not positive Electron
|
|
179
|
+
detection.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-sh/computer-use-linux",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "Linux desktop
|
|
3
|
+
"version": "0.7.19",
|
|
4
|
+
"description": "Native Linux desktop control for AI agents (MCP server, Pi tools, and CLI): semantic AT-SPI accessibility trees, screenshots, compositor window targeting, Wayland/X11 input, and an on-screen activity indicator.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"homepage": "https://github.com/agent-sh/computer-use-linux#readme",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"linux",
|
|
19
19
|
"wayland",
|
|
20
20
|
"accessibility",
|
|
21
|
+
"claude-code",
|
|
21
22
|
"hermes-agent",
|
|
22
23
|
"codex",
|
|
23
24
|
"pi-package"
|