Skip to content

aos key

Keystrokes and typed text

2 commands. Run aos key --help for the same list from the binary, or see every group.

Keystrokes and typed text. With --app or --title, input goes to that window without changing focus, so you keep working elsewhere. type --verify reads the text back from the app and fails if it did not arrive. --focus hands real focus over for the duration when an app ignores posted input. Key names are lower case joined with +, such as cmd+shift+s.

Press a key combination

needs a display

Terminal window
aos key press <combo> [--app=<name>|--title=<substring> [--focus] [--json]]
flag values meaning
<combo> Required positional argument
--app <name> Optional
--title <substring> Optional
--focus Optional
--json Optional
Terminal window
aos key press cmd+shift+s
aos key press enter --app=TextEdit # posted to the app, no focus change

Type text; with –app/–title it goes to that window without needing focus

needs a display

Terminal window
aos key type <text...> [--app=<name>|--title=<substring> [--verify] [--focus] [--json]]
flag values meaning
<text...> Required positional argument
--app <name> Optional
--title <substring> Optional
--verify Optional
--focus Optional
--json Optional
Terminal window
aos key type "hello world"
aos key type "hello" --app=TextEdit --verify # posted to the app, read back from its text field
aos key type "hello" --app=Chrome --focus # real focus + verify, focus handed back after
# exit 1 if --verify cannot see the text arrive; exit 3 if no window matches