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 positionNotes
- 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
| Alternative | Type | Trade-off |
|---|---|---|
AppleScript / osascript | Built in | Scripts the app properly when the app supports it |
| Hammerspoon | Open source | Lua, and far more capable for anything conditional |
| Keyboard Maestro | Paid | A recorder and image-based targeting |
| Shortcuts | Built in | The supported route, when the app exposes actions |
Install
brew install cliclick