Skip to main content

Syntax

agent-desktop mouse-click --xy <x,y> [--button <button>] [--count <n>]

Description

Performs a mouse click at absolute screen coordinates. Supports left, right, and middle buttons, as well as double and triple clicks.
For accessibility-first element clicking, use click which attempts AX API actions before falling back to mouse simulation.

Parameters

--xy
string
required
Absolute screen coordinates in format x,y (e.g., 500,300). Coordinates are measured from the top-left corner of the primary display.
--button
string
default:"left"
Mouse button to use:
  • left - Primary button
  • right - Secondary button (context menu)
  • middle - Middle button (scroll wheel click)
--count
number
default:"1"
Number of clicks to perform:
  • 1 - Single click
  • 2 - Double click
  • 3 - Triple click

Examples

Single left-click

agent-desktop mouse-click --xy 500,300
Response:
{
  "version": "1.0",
  "ok": true,
  "command": "mouse-click",
  "data": {
    "clicked": true,
    "x": 500.0,
    "y": 300.0,
    "count": 1
  }
}

Right-click for context menu

agent-desktop mouse-click --xy 500,300 --button right
Response:
{
  "version": "1.0",
  "ok": true,
  "command": "mouse-click",
  "data": {
    "clicked": true,
    "x": 500.0,
    "y": 300.0,
    "count": 1
  }
}

Double-click

agent-desktop mouse-click --xy 500,300 --count 2
Double-clicks at the coordinates (useful for opening files or selecting words).

Triple-click with middle button

agent-desktop mouse-click --xy 500,300 --button middle --count 3

Use Cases

  • Click precise pixel coordinates not exposed via accessibility
  • Interact with custom-rendered UI (games, design tools)
  • Right-click to open context menus at specific locations
  • Double-click to open files or select words
  • Triple-click to select entire lines or paragraphs
  • Middle-click for browser tab operations or paste

Button Types

ButtonCommon Use
leftPrimary selection, button activation
rightContext menus, secondary actions
middleScroll wheel click, paste on Linux

Build docs developers (and LLMs) love