Skip to content

cliclick

Scriptable mouse and keyboard events, for automating apps that expose no API.

Homebrew formula Direct download

What it does

cliclick synthesises input events: move the cursor, click, double-click, drag, scroll, type a string, press modifiers and key codes. Coordinates are absolute screen pixels, and a w: command inserts waits between steps.

cliclick m:500,300 c:. w:200 t:"hello"
cliclick kd:cmd t:s ku:cmd      # Cmd-S
cliclick p                       # print current cursor position

Notes

  • Needs Accessibility permission in System Settings; without it commands are accepted and silently do nothing.
  • Coordinate-based automation is brittle across display changes. Prefer AppleScript or Shortcuts when the target app is scriptable, and keep cliclick for the ones that are not.

Alternative to

AlternativeTypeTrade-off
AppleScript / osascriptBuilt inScripts the app properly when the app supports it
HammerspoonOpen sourceLua, and far more capable for anything conditional
Keyboard MaestroPaidA recorder and image-based targeting
ShortcutsBuilt inThe supported route, when the app exposes actions

Install

brew install cliclick

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on