xdotool

Simulate keyboard/mouse input and manage X11 windows from CLI

brewmacoslinux
Try with needOr install directly
Source

About

Fake keyboard/mouse input and window management for X

Commands

xdotool

Examples

Type text into the active window$ xdotool type 'Hello World'
Move mouse to coordinates and click$ xdotool mousemove 100 200 click 1
Find and activate a window by name$ xdotool search --name 'Firefox' windowactivate