Skip to content

aos tab

Browser and terminal tabs: list, focus, open, send, close

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

Press a button or link in a browser tab’s page, without moving the mouse

needs a display darwin · windows only

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos tab click (--id=<tab id> | --url=<substring> | --title=<substring>) [--app=<name>] (--element=<ref> | --find=<label>) [--role=button|link|checkbox|radio|...] [--exact] [--nth=<n>] [--allow-focus] [--focus]
flag values meaning
--id <tab id> One of these is required
--url <substring> One of these is required
--title <substring> One of these is required
--app <name> Optional
--element <ref> One of these is required
--find <label> One of these is required
--role button, link, checkbox, radio, ... Optional
--exact Optional
--nth <n> Optional
--allow-focus Optional
--focus Optional
Terminal window
aos tab click --id=chrome:1658108662:1658109078 --element=e8
aos tab click --title="Telegram" --find=Send --role=button
# exit 3 when nothing matches or the page changed, 4 when several elements match

Close one tab (never the whole window)

needs a display darwin · windows only

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos tab close (--id=<tab id> | --title=<substring> | --url=<substring>) [--app=<name>] [--kind=<kind>] [--exact] [--expect-title=<substring>]
flag values meaning
--id <tab id> One of these is required
--title <substring> One of these is required
--url <substring> One of these is required
--app <name> Optional
--kind <kind> Optional
--exact Optional
--expect-title <substring> Optional
Terminal window
aos tab close --id=chrome:1658108662:1658109078
aos tab close --title=example --app=Chrome
aos tab close --id=safari:22718:2 --expect-title=Example
# exit 3 when no tab matches, 4 when several do (name one with --id)

Raise a tab’s window and select the tab

needs a display darwin · windows only

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos tab focus (--title=<substring> | --url=<substring> | --cwd=<substring> | --id=<tab id>) [--app=<name>] [--kind=<kind>] [--exact]
flag values meaning
--title <substring> One of these is required
--url <substring> One of these is required
--cwd <substring> One of these is required
--id <tab id> One of these is required
--app <name> Optional
--kind <kind> Optional
--exact Optional
Terminal window
aos tab focus --url=github.com/muthuishere/aos/pulls
aos tab focus --title=Inbox --app=Chrome
aos tab focus --cwd=aos --kind=terminal
# exit 3 when no tab matches

List the tabs of every browser and terminal window

needs a display darwin · windows only

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos tab list [--app=<name>] [--kind=browser|terminal|editor|files|other] [--window=<aos window id>] [--json]
flag values meaning
--app <name> Optional
--kind browser, terminal, editor, files, other Optional
--window <aos window id> Optional
--json Optional
Terminal window
aos tab list
aos tab list --kind=browser --json
aos tab list --app=Ghostty

Open a browser tab on a URL, or a terminal tab in a folder, in the background (–focus to bring it forward)

needs a display darwin · windows only

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos tab open [<url>] --app=<name> [--window=<id> | --new-window] [--cwd=<dir>] [--command=<cmd>] [--title=<t>] [--wt-window=<name>] [--focus] [--background]
flag values meaning
<url> Optional positional argument
--app <name> Required
--window <id> Optional
--new-window Optional
--cwd <dir> Optional
--command <cmd> Optional
--title <t> Optional
--wt-window <name> Optional
--focus Optional
--background Optional
Terminal window
aos tab open https://example.com --app=Chrome
aos tab open https://example.com --app=Safari --new-window
aos tab open --app=Ghostty --cwd=~/src/aos --command="task check"
aos tab open https://example.com --app=Chrome --focus # raise the window and show the new tab
# default is background: no window raise, no app activation; --background is accepted and does nothing extra
aos tab open --app=WindowsTerminal --wt-window=agents --title=build --cwd=C:\\src # Windows: named WT window

Read a browser tab’s page as markdown, with refs for its buttons, links and fields

needs a display darwin · windows only

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos tab read (--id=<tab id> | --url=<substring> | --title=<substring>) [--app=<name>] [--md | --json] [--focus]
flag values meaning
--id <tab id> One of these is required
--url <substring> One of these is required
--title <substring> One of these is required
--app <name> Optional
--md Optional
--json Optional
--focus Optional
Terminal window
aos tab read --id=chrome:1658108662:1658109078
aos tab read --url=web.whatsapp.com --json
# never switches tabs or raises a window: a tab its window is not showing is refused (exit 3);
# run `aos tab focus` on it first, or add --focus to let this command switch to it
# [e7] Message (textarea, empty) [e8] Send (button)

Type text or press a key in a terminal tab without focusing it

needs a display darwin · windows only

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos tab send --id=<tab id> (--text=<text> | --key=<combo>) [--expect-title=<substring>]
flag values meaning
--id <tab id> Required
--text <text> One of these is required
--key <combo> One of these is required
--expect-title <substring> Optional
Terminal window
aos tab send --id=ghostty:tab-group-8039faee0:tab-802a71200 --text="ls -la"
aos tab send --id=ghostty:tab-group-8039faee0:tab-802a71200 --key=enter
aos tab send --id=iterm:31:1 --key=ctrl+c

Type into a field of a browser tab’s page without taking focus

needs a display darwin · windows only

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos tab type (--id=<tab id> | --url=<substring> | --title=<substring>) [--app=<name>] (--element=<ref> | --into=<label>) --text=<text> [--enter] [--exact] [--nth=<n>] [--allow-newline] [--allow-focus] [--focus]
flag values meaning
--id <tab id> One of these is required
--url <substring> One of these is required
--title <substring> One of these is required
--app <name> Optional
--element <ref> One of these is required
--into <label> One of these is required
--text <text> Required
--enter Optional
--exact Optional
--nth <n> Optional
--allow-newline Optional
--allow-focus Optional
--focus Optional
Terminal window
aos tab type --id=chrome:1658108662:1658109078 --element=e7 --text="hello" --enter
aos tab type --url=web.whatsapp.com --into="Type a message" --text="hello" --enter
# exit 3 when no field matches, the page changed or focus moved; 4 when several fields match