aos menu
Search and run an app’s menu bar commands (macOS accessibility)
2 commands. Run aos menu --help for the same list from the binary, or see every group.
An app’s menu bar as a searchable list of commands, read through macOS accessibility: list prints every item as a path such as File > Export as PDF… (the frontmost app unless --app names one), and run presses one. An exact path always wins; otherwise the text must match exactly one path, and an ambiguous match is refused with the candidates listed, because running the wrong command cannot be undone. Menus are read and pressed without being opened. Needs the Accessibility permission. Windows and Linux exit 2 for now.
Commands
Section titled “Commands”aos menu list
Section titled “aos menu list”List every menu command of an app (frontmost by default) as a path
needs a display darwin only
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos menu list [--app=<name>] [--filter=<substring>] [--json]| flag | values | meaning |
|---|---|---|
--app |
<name> |
Optional |
--filter |
<substring> |
Optional |
--json |
Optional |
aos menu list --app=Previewaos menu list --filter=exportaos menu list --app=Safari --jsonaos menu run
Section titled “aos menu run”Run a menu command by path; exact path wins, else a unique substring
needs a display darwin only
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos menu run <path> [--app=<name>]| flag | values | meaning |
|---|---|---|
<path> |
Required positional argument | |
--app |
<name> |
Optional |
aos menu run "File > Export as PDF…" --app=Previewaos menu run "export as pdf" --app=Preview # unique substring