CUPComputer Use Protocol
SDK Reference

CLI Usage

Use the CUP command-line tool to capture UI trees and debug accessibility.

Basic usage

python -m cup
npx cup

Captures the foreground window and prints the compact tree to stdout.

Options

FlagDescriptionExample
--scopeCapture scope--scope full
--appFilter by app name--app Discord
--depthMax tree depth (0 = unlimited)--depth 3
--json-outSave pruned CUP JSON to file--json-out tree.json
--full-json-outSave full (unpruned) CUP JSON to file--full-json-out full.json
--compact-outSave compact text to file--compact-out tree.txt
--platformForce platform adapter--platform web
--cdp-portChrome DevTools port--cdp-port 9222
--cdp-hostChrome DevTools host--cdp-host localhost
--verboseShow diagnostics--verbose

Examples

# Capture all windows
python -m cup --scope full

# Filter by app name
npx cup --app "VS Code"

# Save JSON output
python -m cup --json-out tree.json

# Capture Chrome via CDP
python -m cup --platform web --cdp-port 9222

# Run diagnostics
npx cup --verbose

MCP server

To run CUP as an MCP server, see MCP Setup.

On this page