Computer Use Linux

Desktop control for AI agents · Linux · Windows · macOS

Your agent can run commands. Now it can use the screen.

Your AI agent sees every window and uses a real mouse and keyboard. Linux first, Windows and macOS too.

./install.sh && computer-use-linux setup

MIT · Linux · Windows · macOS (preview) · Python 3.9+

Setups documented for

  • Claude Desktop
  • Claude Code
  • Cursor
  • Continue
  • Roo
  • Aider
  • Codex CLI
  • Gemini CLI
  • your own CLI
  • remote agents over HTTP
  • models without tool calling
  • vision models
  • headless servers

The problem

Agents live in the terminal. Your work lives on the screen.

Coding agents edit files and run builds. The moment a task needs a settings dialog, a running app or another terminal, they stop and hand it back to you. The usual ways around that each break somewhere.

  1. Screenshot every step

    The model looks at the whole screen, guesses coordinates, clicks, then takes another screenshot to see what happened.

    Where it breaks: every step is a vision call, so it is slow and costly, and a few pixels off is a wrong click. Text already on screen is read back from an image.

  2. An integration per app

    APIs, SDKs and browser drivers are exact, but each one covers a single program and has to be built and maintained.

    Where it breaks: desktop apps without an API, and the terminals already open on screen, stay out of reach.

  3. X11 automation scripts

    xdotool and similar tools were made for X11, where any client could read and type into any window.

    Where it breaks: Wayland closed that door. The usual workaround, ydotool, writes to /dev/uinput, which needs root or a udev rule.

Computer Use Linux takes the most direct channel the desktop already offers, and falls back to pixels only when nothing else is there.

How it works

Structure first. Pixels last.

Before it looks at a single pixel, Computer Use Linux asks the desktop what it already knows. Each step down is used only when the one above has nothing to give.

  1. Ask the window manager

    The window manager lists every window with its title, app, position and focus: KWin, Sway, Hyprland or EWMH on Linux, Win32 on Windows, CGWindowList on macOS. The agent can bring one forward, minimize or close it, including apps that publish nothing else.

    Channel KWin · EnumWindows · CGWindowList Model receives text

    $ computer-use-linux windows
    * win:{c31f…}  org.kde.konsole  1100x780+0+0      api : claude — Konsole
      win:{8c1e…}  systemsettings   760x540+1180+60   Appearance — System Settings
      win:{a41f…}  firefox          880x560+1060+520  Player — Mozilla Firefox
  2. Read the accessibility tree, act by name

    Buttons, switches and fields come with names and roles, through AT-SPI, UI Automation or the macOS accessibility API. The agent presses “Dark” by its name. The mouse does not move, and nothing depends on where the control is drawn.

    Channel AT-SPI · UI Automation · AX Model receives text

    $ computer-use-linux find "Dark" --window win:{8c1e…}
    atspi:4:0/2/7	[checkbox] Dark  <toggle,click>
    $ computer-use-linux click atspi:4:0/2/7 --json
    { "ok": true, "ref": "atspi:4:0/2/7" }
  3. Read terminal text directly

    Konsole tabs and tmux panes hand over their text along with the program running in each; Windows consoles, Terminal.app and iTerm2 hand over theirs too. No screenshot, no OCR, no focus change.

    Channel Konsole D-Bus · tmux · AttachConsole · Terminal.app Model receives text

    $ computer-use-linux term-read konsole:7891:2
    ● Running test suite…
      tests/test_api.py ........F.F
    ✗ 2 failed · test_login, test_refresh
    Should I fix them? (y/n, or tell me)
  4. Only then: screenshot and click pixels

    For games, canvas apps and Chromium apps not started through launch. The shot is cropped to one window and scaled for the model; a pixel in that image is mapped back to the screen and clicked through the system's own input: the RemoteDesktop portal, XTEST or Sway IPC, SendInput, CGEvent.

    Channel spectacle / grim · GDI · screencapture Model receives one image

    $ computer-use-linux screenshot --window win:{a41f…} --max-width 1568
    $ computer-use-linux click 440 190 --from-shot --json
    { "ok": true, "x": 1500, "y": 710, "button": "left" }

One core between any agent and the desktop

Adapters only know the core; the core only talks to channels the desktop already provides. If a backend is missing, the rest keep working and computer-use-linux caps says what is off.

Your agentany harness, any modelShell CLIcomputer-use-linuxMCPcomputer-use-linux-mcpHTTPcomputer-use-linux-httpText loopcomputer-use-linux-agentCorecomputer_use_linux.pyWindowsKWin · Win32 · CGWindowListControls by nameAT-SPI · UIA · AXMouse + keyboardportal · SendInput · CGEventOpen terminalsKonsole · wincon · TerminalIts own shelltmux · PTY · cmd.exeScreenshotsgrim · GDI · screencaptureYour desktopLinux · Windows · macOSYour agentany harness, any modelShellCLIMCPstdioHTTPtokenTextloopCorecomputer_use_linux.pyWindowsKWin · Win32 · CGWindowListControls by nameAT-SPI · UIA · AXMouse + keyboardportal · SendInput · CGEventOpen terminalsKonsole · wincon · TerminalIts own shelltmux · PTY · cmd.exeScreenshotsgrim · GDI · screencaptureYour desktopLinux · Windows · macOS

Speed

A click takes milliseconds, not a model turn.

Since v0.7 an agent no longer waits seconds between clicks. The slow parts were a fresh process for every command, rereading the whole window before each click, a cursor animation that held the click, and a separate model turn to check every step.

  • A warm service

    The first computer-use-linux call starts a background service; later calls reuse its open connections instead of rebuilding them. It restarts itself when the code changes and quits when idle.

    Measured
    CLI call 120 → 55–70 ms
  • No rereading the window

    Before a click only the path to the element is read. If its identity still matches, the rest of the tree is skipped; if anything moved, a full read finds it by identity, never by position.

    Measured
    ref lookup 18 → 3 ms
  • Fewer model turns

    do runs several steps in one call and stops at the first failure. --after reports what changed, new refs included, so checking is not a separate turn. wait polls inside.

    Measured
    N actions + check = 1 call
  • Screenshots in 0.1 s

    The frame is copied from the screen stream that is already open, one stream per monitor, so taking a screenshot no longer goes through the slow portal round trip.

    Measured
    1.6 s → 0.1 s, three monitors
  • Readable on many monitors

    By default only the monitor of the active window is captured, so text stays sharp instead of shrinking three screens into one image. --region zooms in, --screen picks another monitor.

    Measured
    image scale 0.32 → 0.82
  • Agents in parallel

    Give each agent a name with --agent. Each one gets its own service, its own pointer in its own colour and its own last screenshot, so one agent waiting never stalls another.

    Measured
    the other agent: 4.75 s → 0.2 s
$ computer-use-linux click-text Ekle --after
tıklandı: [button] Ekle  ref=@sp9w74h5y:e5
# sonrası @s92x34git — NexTest
+ [button] Tamam  ref=@s92x34git:e2

$ CUL_TRACE=1 computer-use-linux click @shi7xh2dc:e1
tıklandı
[trace]     çözümleme 6.1 ms ref=@shi7xh2dc:e1 yol=hızlı
[trace]     ağaç pencereleri 1.8 ms
[trace]     pencereler 1.3 ms
[trace]     kira 0.1 ms
[trace]     gönderim 1.1 ms
[trace]   click 10.7 ms ref=@shi7xh2dc:e1
[trace] komut click (servis) 10.8 ms
Real output from a GTK test app on Xvfb; the first three numbers come from computer-use-linux bench and CUL_TRACE=1 there. The last three were measured on a real KDE Plasma desktop with three monitors.

Replay

A session, replayed

Commands and output are in the exact format the CLI prints. The desktop is drawn, so you can see where each command lands.

computer-use-linux windows
* win:{c31f…} org.kde.konsole 1100x780+0+0 api : claude — Konsole win:{8c1e…} systemsettings 760x540+1180+60 Appearance — System Settings win:{a41f…} firefox 880x560+1060+520 Player — Mozilla Firefox
computer-use-linux terms
konsole:7891:2 claude ~/projects/api api : claude

The agent asks what is on screen: every window with its ref, every terminal with the program in it.

Reach

What it reaches

The same commands on Linux, Windows and macOS. Each surface takes the most direct channel the system offers (the platform table below names it), and computer-use-linux caps says when one is missing.

  • Windows

    Every window on screen, including apps that publish no accessibility tree.

    Commands
    windows window REF activate
  • Mouse

    Your pointer is put back where it was right after each click.

    Commands
    click X Y scroll drag
  • Keyboard

    Any language. Text goes in as Unicode; where the channel can't carry a character, it is pasted and your clipboard restored.

    Commands
    type key ctrl+s
  • Controls by name

    Presses buttons and toggles without moving the mouse at all.

    Commands
    find click REF
  • Electron by name

    Starts Discord, VS Code or Slack with their tree switched on, so their buttons have names too.

    Commands
    launch vesktop
  • Open terminals

    Shows what runs in each one: claude, ssh, vim, a build.

    Commands
    terms term-read term-send
  • Its own shell

    Sessions survive between calls, so it can start something and check on it later.

    Commands
    run screen keys
  • Screen

    Crop and scale are remembered, so click X Y --from-shot lands on the right pixel. On Wayland the frame is copied from the screen stream the input service already holds, one stream per monitor, in about 0.1 s. By default you get the monitor of the active window; --region zooms in.

    Commands
    screenshot --screen --region --window
  • Agent cursor

    A second, visible arrow moves to where the agent works: short and nearly straight, so you notice it without watching it drift. Your mouse stays yours: clicks pass through it and focus never moves.

    Commands
    point cursor cursor-hide
  • Several agents at once

    Name each agent with --agent: it gets its own background service, its own pointer in its own Material Bibata colour and its own last screenshot. Reading runs in parallel; clicks and keys take turns, and type --window focuses and types in one step so another agent cannot steal the focus in between.

    Commands
    --agent type --window key --window
  • Something missing?

    One command reports which channels work on this machine and which packages the rest need.

    Commands
    computer-use-linux caps

Platforms

Three desktops, one set of commands.

Refs, output and flags are the same everywhere. Underneath, each platform gets its own channel, named in the table. How far each one is tested is stated per environment, not rounded up.

  • Linux

    KDE Plasma 6, GNOME, X11, Sway, Hyprland

    Tested

    • KDE Plasma 6 · WaylandReal desktop

      Run on a real desktop. Input tests run in a sandbox with its own D-Bus, a virtual KWin, portal and PipeWire.

    • X11Xvfb sandbox

      End-to-end suite on a headless X server: XTEST input, EWMH windows, screenshots, the CLI.

    • SwayHeadless Sway

      A real Sway 1.10, run headless: windows, clicks and scrolling through Sway IPC, typing with wtype, screenshots with grim.

    • HyprlandFake IPC

      hyprctl is replaced by a fake; not yet run on a real compositor.

    • GNOME 48Headless GNOME

      Verified on a real headless GNOME Shell 48 (Mutter): window list and find/click by name through AT-SPI, mouse and keyboard input, scrolling, screenshots. Input goes through the RemoteDesktop portal (asks once); headless setups can opt into direct Mutter input. Multi-monitor and the interactive portal dialog are not tested yet.

  • Windows

    Built for Windows 10 and 11

    Tested

    • Wine 1047/47 passed

      Real Windows Python under Wine, against a real Notepad window and a cmd.exe console. Not yet run on Windows 10 or 11 hardware.

      Click by name is untested: Wine's UI Automation has no control tree to walk.

  • macOS Preview

    Quartz events and the accessibility API

    Tested

    • Unit testsMock Quartz

      The logic is unit-tested against a fake Quartz library. Not yet run on a real Mac.

      Allow Accessibility and Screen Recording once, in System Settings.

Solid: a real desktop. Outline: a real display server, run headless or under Wine. Amber: logic checked against fakes. Dashed: not tested.

10 surfaces × 3 platforms

The channel each capability uses on Linux, Windows and macOS
CapabilityLinuxWindowsmacOS Preview
Every window on screenKWin · hyprctl · swaymsg · EWMHGNOME: AT-SPI onlyEnumWindowsCGWindowList + AX
Real mouseXTEST · RemoteDesktop portal · Sway IPCSendInputCGEvent
Real keyboardXTEST · portal + clipboard · wtypeSendInput (Unicode)CGEvent (Unicode)
Press a button by nameAT-SPIUI Automationnot exercised under WineAccessibility (AX)
Electron and Chromium with their tree onflag + environmentflagflag
Open terminalsKonsole D-Bus, tmuxconsole buffer (AttachConsole)Terminal.app, iTerm2, tmux
Its own terminaltmux / PTYcmd.exetmux / PTY
Visible agent cursorX11/XWayland window · your cursor themelayered window · system arrowNSWindow · system arrow
ScreenshotsPipeWire stream (one per monitor) · spectacle · grim · XlibGDIscreencapture
Parallel agentsMaterial Bibata cursors · own daemonlayered windowNSWindow

Channels are read from the project README when this page is built.

Terminals

Eight agents open? One of them can run the others.

Every Konsole tab and tmux pane is listed with the program in its foreground, and so are Windows consoles and Terminal.app and iTerm2 windows. An agent can read another agent's screen, answer its question, or stop it with --key C-c.

None of it needs window focus or your keyboard. You keep working while it does.

$ computer-use-linux terms
konsole:7891:1       claude         ~/projects/api      api : claude
konsole:7891:2       claude         ~/projects/web      web : claude
konsole:7891:3       vim            ~/projects/docs     docs : vim
konsole:29769:1      ssh            ~                   deploy@staging

$ computer-use-linux term-send konsole:63308:1 'echo CUL_$((6*7))' --enter
$ computer-use-linux term-read konsole:63308:1
bash-5.2$ echo CUL_$((6*7))
CUL_42
bash-5.2$
Output in the exact CLI format; terminal names are examples. The last two commands ran in the test sandbox.

Last resort

When an app has nothing to read, it looks.

Games, canvas apps and Chromium apps started without computer-use-linux launch publish no controls. Take a screenshot cropped to one window and scaled for the model; it clicks on pixels in that image and Computer Use Linux converts them back to the screen.

screen = origin + image ÷ scale
(3000, 0) + (412, 230) ÷ 0.8333 = (3494, 276)
A window on a three-monitor desktop is cropped, scaled to 800 by 900, and a point in the image maps back to screen coordinates. HDMI-1 · x=0 DP-1 · x=1080 DP-2 · x=3000 800×900 · scale 0.8333 win:{3fd7…} 960×1080 (412, 230) (3494, 276)
A three-monitor layout, to scale. One point, two coordinate systems.

Compare

Where it stands

Compared with the kinds of tools in use today, not with named products. Each approach has its place; this is how they do on the work Computer Use Linux is built for.

Computer Use Linux Screenshot-only computer-use agents Classic RPA and xdotool scripts Per-app APIs and SDKs
Presses controls by name, not by coordinates YesAT-SPI · UI Automation · AX Noguesses coordinates from the image Partlysome RPA tools use selectors; xdotool clicks coordinates Yesinside that one app
Reads on-screen text without a vision model Yesaccessibility tree and terminal text Noevery read is an image Partlydepends on the tool Yesinside that one app
Works with apps that publish nothing to read Yesscreenshot fallback Yesits main mode Partlyblind coordinates Noneeds an API
Reads and answers terminals already open YesKonsole · tmux · Windows consoles · Terminal.app Partlyfrom pixels, when the window is visible Partlycan type, cannot read Noout of scope
Runs without root or admin rights, Wayland included YesWayland portal; user rights on Windows and macOS Partlydepends on setup; often a VM NoX11 only, or root for /dev/uinput Yesdoes not touch input
Plugs into any agent through a shell command Yesalso MCP, HTTP and a text loop Partlyusually tied to one model's tool format Yesit is a command too Partlyone integration per app

Categories, not products. “Yes” means the approach does it out of the box; “Partly” means it depends on the tool or the setup.

Numbers

By the numbers

Counted from the v0.7.0 source every time this page is built. No estimates, no projections.

MCP tools
28
CLI commands
35
ways to plug in: shell, MCP, HTTP, text loop
4
desktop surfaces it reaches
10
harness setups documented
11
test suites, 4 of them in a throwaway desktop
23
lines of Python, core and adapters
15,171
root or admin rights needed
0

Why now

The pieces are in place.

No forecast needed. This is where the tools already are.

  1. Agents already work in terminals

    Coding agents such as Claude Code, Codex, Aider and Gemini CLI run in a shell. A shell command is the one interface they all share, so that is the interface Computer Use Linux speaks.

  2. MCP became a common tool protocol

    Editors and agent clients load tools over MCP. One Computer Use Linux server gives all of them the same desktop tools, with screenshots returned as images.

  3. Linux desktops moved to Wayland

    Wayland removed the X11 shortcuts that old automation relied on. The sanctioned way in is the xdg-desktop-portal RemoteDesktop interface, which asks the user once. On Linux, Computer Use Linux is built on it.

Roadmap

What exists, what comes next

The left column ships in the download today. The right column is planned, not built.

In v0.7.0 today

  • KDE Plasma: every window through KWin scripting, mouse and keyboard through the RemoteDesktop portal, approved once
  • X11 (XTEST, EWMH), Sway and Hyprland (their own IPC) behind the same commands; on Sway the mouse needs no extra package
  • Reading and typing into open Konsole tabs and tmux panes
  • 28 MCP tools, 35 CLI commands, an HTTP API and a text loop for models without tool calling
  • Windows: Win32 windows, Unicode input through SendInput, GDI screenshots, UI Automation, reading and typing into open consoles
  • macOS preview: Quartz input, CGWindowList windows, the accessibility tree, Terminal.app, iTerm2 and tmux
  • Electron and Chromium apps by name: computer-use-linux launch vesktop starts them with their tree switched on
  • A compact tree: hidden items and empty wrappers left out, and every control carries the ref to click it
  • Windows, terminals and the accessibility tree as live MCP resources
  • A user service for the HTTP adapter, with a token file and TLS, to drive another machine
  • A visible agent cursor on Linux, Windows and macOS that never touches your mouse, from every adapter: MCP, HTTP, CLI
  • Faster on Linux: screenshots from the live PipeWire stream, one stream per monitor (0.1 s instead of 1.6 s), clicks that never wait on the cursor animation
  • v0.7 speed: a background service for the CLI, a ref fast path, batches with do and cul_batch, --after change reports, wait, click-text, fill, bench and per-step timing
  • A pip package: pip install .[all] on Linux, Windows and macOS
  • Input tests in an isolated sandbox desktop, X11 in Xvfb, Sway on a headless compositor, Windows under Wine

Planned

  • Real Windows and Mac hardware. Run the suites on Windows 10 and 11 and on a Mac, then drop the preview label.
  • A real Hyprland, and GNOME beyond headless. Run Hyprland on a real compositor instead of fake IPC (it needs a KMS device), and test GNOME with several monitors and the interactive portal dialog.
  • Event-driven refresh. Listen to accessibility change events so an unchanged window is not read at all, and measure v0.7 on a real KDE desktop.

Connect

Plug it into your agent

Same core, four ways in. Pick whatever your harness already speaks.

Any harness that can run a command: Claude Code, Codex, Aider, opencode, a cron job. Give the agent the skill text and it knows the rest.

computer-use-linux skill        # paste into your agent's instructions
computer-use-linux observe --json

Safety

What it does to your machine

Asks once
On Wayland the desktop shows a remote-control dialog the first time; tick Allow restoring and it won't ask again (delete ~/.config/computer-use-linux/portal.json to take it back). On macOS you allow Accessibility and Screen Recording once. Windows and X11 don't ask.
Gives your pointer back
There is one pointer. A click borrows it and puts it back where it was.
No root, no admin
No /dev/uinput, no driver, no service running as another user. On Windows it runs as you; windows running as administrator stay out of reach unless Computer Use Linux is elevated too.
Closed to the network
The HTTP adapter will not listen beyond localhost without a token of at least 24 characters. The token can live in a file instead of the command line, and traffic can run over TLS. Requests from a browser are refused, so a web page cannot drive your desktop through localhost.
Tested where it can't hurt you
Input tests run in a throwaway desktop with its own D-Bus, a virtual KWin, its own portal and PipeWire. X11 runs in Xvfb, Windows in its own Wine prefix on a headless display.

Limits

  • Linux: KDE Plasma 6 on Wayland is tested on a real desktop, X11 on a real X server (Xvfb), Sway on a real headless compositor, GNOME Shell 48 on a real headless compositor, Hyprland with fake IPC. On GNOME the window list comes from AT-SPI only.
  • Windows: tested on Wine 10, not yet on real Windows 10 or 11. Wine's UI Automation can't walk the control tree, so click by name is untested there. Windows running as administrator are reachable only when Computer Use Linux runs as administrator too (UIPI).
  • macOS: the code is written and its logic tested against a fake Quartz, but it has not yet been verified on a real Mac. It ships as a preview.
  • Konsole exposes the visible screen only. For scrollback, run the agent in tmux.
  • Electron and Chromium apps publish their tree only when started with --force-renderer-accessibility. computer-use-linux launch adds it, but an app that is already running has to be restarted. Games and canvas apps are driven by screenshot and coordinates.
  • On Linux the visible agent cursor needs X11 or XWayland and does not show on Sway without XWayland. The Windows cursor is tested on Wine; the macOS cursor has not yet run on a real Mac.

Install

Install in three steps

Linux

  1. Download and unpack

    unzip computer-use-linux.zip && cd computer-use-linux

    computer-use-linux.zip (313 KB) · computer-use-linux.tar.gz (256 KB)

  2. Install the commands

    ./install.sh

    Puts computer-use-linux, computer-use-linux-mcp, computer-use-linux-http and computer-use-linux-agent in ~/bin, then lists anything missing.

  3. Grant access once

    computer-use-linux setup && computer-use-linux caps

    Turns on the accessibility tree and, on Wayland, opens the desktop's remote-control dialog: tick Allow restoring, press Share. X11 asks nothing.

Needs python3-dbus python3-gi xdg-desktop-portal-kde pipewire wl-clipboard. Optional: tmux python3-pil python3-xlib gstreamer1.0-pipewire, pip install mcp. Rather use pip? pipx install --system-site-packages . keeps the system's D-Bus and GObject bindings in view.

Windows

  1. Download and unpack

    Expand-Archive computer-use-linux.zip -DestinationPath .; cd computer-use-linux

    computer-use-linux.zip (313 KB)

  2. Install with pip

    py -m pip install .[all]

    Puts computer-use-linux, computer-use-linux-mcp, computer-use-linux-http and computer-use-linux-agent on your path. comtypes, for UI Automation, comes along.

  3. See what works

    computer-use-linux caps

    No permission dialog. Windows running as administrator are reachable only if Computer Use Linux runs as administrator too.

Needs Python 3.9 or newer, started with the py launcher. [all] adds pillow for cropping and scaling screenshots and mcp for the MCP server. Tested under Wine 10, not yet on real Windows 10 or 11.

macOS Preview

  1. Download and unpack

    unzip computer-use-linux.zip && cd computer-use-linux

    computer-use-linux.zip (313 KB) · computer-use-linux.tar.gz (256 KB)

  2. Install with pip

    python3 -m pip install '.[all]'

    Puts the four commands on your path. [all] adds screenshot scaling and the MCP server.

  3. Grant access once

    computer-use-linux setup && computer-use-linux caps

    Opens the Accessibility and Screen Recording prompts. Allow your terminal in System Settings → Privacy & Security; it is not asked again.

Needs Python 3.9 or newer. Optional: tmux for scrollback. Preview: tested against a fake Quartz, not yet on a real Mac.

Give your agent the desktop.

Unpack, install, approve once. For questions about the project, a partnership or an investment, write to us.

./install.sh && computer-use-linux setup

computer-use-linux.tar.gz (256 KB) · MIT · Linux · Windows · macOS (preview) · Python 3.9+