CUPComputer Use Protocol
Platform Guides

Linux

CUP on Linux using AT-SPI2 accessibility framework.

Overview

On Linux, CUP uses the AT-SPI2 (Assistive Technology Service Provider Interface) framework via PyGObject (Python) or gdbus + xdotool (TypeScript).

Requirements

  • AT-SPI2 enabled (default on most GNOME/KDE desktops)
  • Python: python3-gi and gir1.2-atspi-2.0
  • TypeScript: gdbus and xdotool (system packages)

AT-SPI2 must be enabled. On most desktop environments it's on by default. If not, set the environment variable ATSPI_ENABLED=1.

Setup

Install system dependencies, then CUP. See Installation for full details.

# Ubuntu/Debian — system packages
sudo apt install python3-gi gir1.2-atspi-2.0  # Python
sudo apt install dbus xdotool                  # TypeScript

How it works

The Linux adapter connects to AT-SPI2 via D-Bus, traversing the accessibility tree exposed by applications. GTK and Qt apps generally have good AT-SPI2 support.

Role mapping

AT-SPI2 RoleCUP Role
ROLE_PUSH_BUTTONbutton
ROLE_CHECK_BOXcheckbox
ROLE_COMBO_BOXcombobox
ROLE_ENTRYtextbox
ROLE_LINKlink
ROLE_IMAGEimg
ROLE_LISTlist
ROLE_LIST_ITEMlistitem
ROLE_MENUmenu
ROLE_MENU_ITEMmenuitem
ROLE_PROGRESS_BARprogressbar
ROLE_RADIO_BUTTONradio
ROLE_SLIDERslider
ROLE_TABLEtable
ROLE_LABELtext
ROLE_FRAMEwindow

Action mapping

CUP ActionLinux (AT-SPI2) Implementation
clickDoAction("click"/"press"/"activate")
typeEditableText.SetTextContents, fallback to xdotool type
setvalueValue.SetCurrentValue
toggleDoAction("toggle"/"click")
expandDoAction("expand or activate")
collapseDoAction("collapse")
selectSelection.SelectChild / DoAction("click")
scrollxdotool mouse wheel at element center

Platform-specific properties

For the full platform-specific property schema, see Node Structure.

Troubleshooting

Empty tree

Ensure AT-SPI2 is running:

dbus-send --session --print-reply --dest=org.a11y.Bus /org/a11y/bus org.a11y.Bus.GetAddress

Electron apps

Electron apps need --force-renderer-accessibility flag for full AT-SPI2 support.

On this page