How window-scoped screenshots work
mainWindow-scoped screenshots capture only a specific application window. This reduces noise (no dock or menu bars) and improves model accuracy.
Even though the screenshot only shows the window, the coordMap includes the window's position on the desktop. This allows you to use coordinates relative to the screenshot while the CLI automatically maps them to the correct global desktop coordinates.
Workflow:
- List windows to find the target ID:
usecomputer window list --json. - Capture the window:
usecomputer screenshot ./tmp/app.png --window <WINDOW_ID> --json. - Click within that window using the emitted
coordMap:usecomputer click -x 400 -y 220 --coord-map "<COORD_MAP_FROM_STEP_2>".
# 1. find the window ID
usecomputer window list --json
# 2. screenshot that window
usecomputer screenshot ./tmp/app.png --window 12345 --json
# 3. click using the coord-map
usecomputer click -x 400 -y 220 --coord-map "200,100,1200,800,1568,1045"usecomputer window list --json
usecomputer screenshot ./tmp/app.png --window 12345 --json
usecomputer click -x 400 -y 220 --coord-map "200,100,1200,800,1568,1045"