Browser
ht browser controls the built-in browser panes. Designed for agents, CI scripts, and visual regression workflows.
Top-level
Section titled “Top-level”ht browser open <url> # open in current pane (creates one if needed)ht browser open-split <url> # open as a new splitht browser list # list browser surfacesEvery other command targets a specific browser surface:
ht browser <id> <command> [args]# example:ht browser browser:2 navigate https://example.orght browser browser:2 click "button[type='submit']"Inside a browser pane, HT_SURFACE is auto-set so you can omit the id:
ht browser navigate https://example.org # uses HT_SURFACENavigation
Section titled “Navigation”| Command | Purpose |
|---|---|
navigate <url> | Go to URL. |
goto <url> | Alias for navigate. |
back | History back. |
forward | History forward. |
reload | Reload the page. |
url / get-url | Print the current URL. |
identify | Surface id, title, URL. |
navigate / goto accept http:// and https:// (including localhost / LAN dev servers), about: (e.g. about:blank), data:, and chrome-extension:// URLs. file:// URLs are intentionally rejected for security — they would let a browser pane read arbitrary local files over the socket.
Waiting
Section titled “Waiting”ht browser browser:1 wait --selector "#dashboard" --timeout-ms 15000ht browser browser:1 wait --text "Welcome" --timeout-ms 15000ht browser browser:1 wait --load-state completePick at most one of --selector, --text, --load-state. --timeout-ms defaults to 30000.
Interacting
Section titled “Interacting”| Command | Args | Purpose |
|---|---|---|
click <selector> | Click. | |
dblclick <selector> | Double click. | |
hover <selector> | Hover. | |
focus <selector> | Focus. | |
check <selector> / uncheck <selector> | Toggle a checkbox. | |
scroll-into-view <selector> | Scroll element into viewport. | |
type <selector> <text> | Type text into focused field. | |
fill <selector> <text> | Set value. | |
press <key> | Send a key (e.g. Enter, Escape, Control+a). | |
keydown <key> / keyup <key> | Lower-level key events. | |
select <selector> <value> | Select an <option>. | |
scroll <x> <y> | Scroll the page. | |
highlight <selector> | Visual highlight (debug). |
Inspecting
Section titled “Inspecting”ht browser browser:1 snapshot # accessibility treeht browser browser:1 get titleht browser browser:1 get urlht browser browser:1 get text "#welcome" # textContent of selectorht browser browser:1 get value "#email"ht browser browser:1 is visible "#dashboard"ht browser browser:1 is enabled "button[type='submit']"ht browser browser:1 is checked "#agree"Injecting
Section titled “Injecting”ht browser browser:1 addscript "console.log('hello')"ht browser browser:1 addstyle "body { background: red }"ht browser browser:1 eval "document.title"ht browser browser:1 eval "await fetch('/api/health').then(r => r.json())"eval returns the JSON-serialized result. Async expressions are awaited automatically.
addscript, addstyle, and eval reject payloads larger than 256 KiB — this only affects pathologically large scripts or stylesheets.
Console / errors
Section titled “Console / errors”ht browser browser:1 console # tail console logsht browser browser:1 console --clear # clear the bufferht browser browser:1 errors # tail JS errorsht browser browser:1 errors --clearHistory
Section titled “History”ht browser browser:1 history # list visited URLs (deduped)ht browser browser:1 history --search "github"ht browser browser:1 history --clearFind in page
Section titled “Find in page”ht browser browser:1 find-in-page "search query"The cancel half is RPC-only (browser.stop_find) — the cancel button lives in the browser-pane UI, not as a ht verb. See RPC-only methods.
ht browser helpht browser --help # aliasht browser -h # aliasPrints the same browser-section block as the global ht --help, scoped to browser subcommands. The default error path (Unknown browser subcommand: …) tells users to run this; it points at a real command.
DevTools
Section titled “DevTools”ht browser browser:1 devtools # toggle WebKit inspectorht browser browser:1 closeRead more
Section titled “Read more”Cookie commands
Section titled “Cookie commands”These are top-level hyphenated commands (not ht browser <sub>):
ht browser-cookie-list [domain]ht browser-cookie-get <url>ht browser-cookie-set <name> <value> --domain <d> [--path /] [--secure true]ht browser-cookie-delete <domain> <name>ht browser-cookie-clear [domain]ht browser-cookie-import <file> [--format json|netscape]ht browser-cookie-export [--format json|netscape]ht browser-cookie-capture [--surface S]A cookie jar is credentials — treat an export like a password file. Storage is
partitioned per browserPartitionMode.
See the browser.cookie_* API.
Legacy hyphenated aliases
Section titled “Legacy hyphenated aliases”Every ht browser <sub> verb also exists as a flat command, kept so older
scripts keep working. They map to the same RPC:
ht browser-open [url] ht browser-navigate <url> ht browser-urlht browser-split [url] ht browser-back ht browser-forwardht browser-reload ht browser-close ht browser-eval <js>ht browser-snapshot ht browser-find <query> ht browser-devtoolsht browser-history ht browser-clear-historyPrefer the ht browser … form in new scripts — it is the one that gets new
subcommands.