Getting Started
Installation
Install the CUP SDK for Python or TypeScript.
Install
pip install computeruseprotocolnpm install computeruseprotocolOptional extras (Python)
# Linux AT-SPI2 support
sudo apt install python3-gi gir1.2-atspi-2.0
# Web adapter (Chrome DevTools Protocol)
pip install computeruseprotocol[web]
# Screenshot support
pip install computeruseprotocol[screenshot]
# MCP server
pip install computeruseprotocol[mcp]Platform requirements
CUP auto-detects your operating system and loads the appropriate platform adapter.
| Platform | Adapter | Requirements |
|---|---|---|
| Windows | UIA via COM | Windows 10+ |
| macOS | AXUIElement | macOS 12+, accessibility permission |
| Linux | AT-SPI2 | python3-gi + gir1.2-atspi-2.0 |
| Web | Chrome DevTools Protocol | Chrome running with --remote-debugging-port |
On macOS, you'll need to grant accessibility permissions to your terminal or IDE in System Settings > Privacy & Security > Accessibility.
Verify installation
python -m cupnpx cupThis captures the foreground window's UI tree and prints it in compact format. You should see output like:
# CUP 0.1.0 | windows | 2560x1440
# app: Terminal
# 12 nodes (45 before pruning)
[e0] win "Terminal" 100,50 1200x800
[e1] doc "Terminal" 100,50 1200x800
[e2] tbx "Command input" 110,720 1180x32 {foc,edt} [clk,typ]