> _**CLI skill · `browser` namespace** · ~7,910 tokens · hoody-sdk v1.0.0-beta.17_ # `browser` — Per-container Chromium or Firefox instances, one per slot ## Purpose - Long-lived browser instances per container, one per `browser-X` hostname slot (the proxy maps slot X to `browser_port` 30000+X and `display` 500+X). - Chromium runs the stealth engine by default (`stealth` defaults to `true`; metadata reports `engine: patchright`). `stealth=false` selects the standard engine (`engine: playwright`). Firefox always runs the standard engine. - Surfaces: nav, screenshot, JS eval, PDF, HTML/text, cookies, console+network logs, history, CDP, accessibility snapshot with element refs, element actions, waits, runtime viewport. ## When to use - JS-heavy pages, screenshots, PDFs. - Authenticated sessions across navs. - Anti-fingerprint via `stealth=true`. - Console/network capture. - Dedicated recorded "project browser" the user can watch live and you can inspect anytime (workflow 6). - Clicking, typing and waiting on page elements without writing JS (workflow 7). - External CDP on Chromium through the URL that `hoody browser devtools urls get` returns (on by default; `useRemoteDebuggingPort=false` turns it off; Firefox never exposes it). ## When NOT to use - Plain HTTP, persistence, server scripts, stream UI, shell → `curl`/`sqlite`/`exec`/`display`/`terminal`. ## Prerequisites - Headful (default `showBrowser=true`) needs X display: `?display=` or `DISPLAY`. Extensions also require `showBrowser=true`. - `hoody browser pdf export` works only on a headless Chromium instance: start it with `showBrowser=false`. Firefox and headful instances return `501 NOT_SUPPORTED`. The CLI flag is `--no-show-browser`. ## Capability URL → See `SKILL-CLI.md § Proxy URLs`. ## Common workflows ### 1. Start + navigate 1. `hoody browser start` on the slot's hostname + overrides (proxy, stealth, fingerprintId, viewport, locale, timezoneId, userAgent, geolocation). 2. `hoody browser navigate` — `tabId`, `onlyIfNotExists=true`. Flags: `--tab-id`, `--only-if-not-exists`. 3. `hoody browser get`. ### 2. Extract content After browse: `hoody browser html get`/`hoody browser text get`/`hoody browser screenshots capture`/`hoody browser pdf export` — params in Reference. `hoody browser pdf export` needs a headless Chromium instance (see Prerequisites). ### 3. Authenticated scraping 1. `hoody browser start` matching `userAgent`/`viewport`/`locale`. 2. `hoody browser cookies batch set` with a `cookies` list of `{name, value, url}` entries; each cookie needs `name`, `value` and either an absolute http(s) `url` or both `domain` and `path` (never `url` together with `domain` or `path`). Pass one `--cookies name=…,value=…,url=…` flag per cookie. 3. `hoody browser navigate` to protected URL. 4. `hoody browser html get`/`hoody browser text get`. 5. `hoody browser cookies clear`. ### 4. JS eval + logs 1. `hoody browser start` with `stealth=false` for full console capture (stop a slot that already runs with `stealth=true` first) → `hoody browser navigate`. 2. `hoody browser evaluate` (`{script}` JSON body). On the default stealth engine the script cannot see page JS globals (see Quirks). 3. `hoody browser logs console list` (`since`,`type`,`clear=true`). 4. `hoody browser logs network list`. ### 5. History `hoody browser history list` (filters: `since`/`domain`/`browser_id`) and `hoody browser history clear` (`before` + `browser_id` AND). In history, `browser_id` is the slot number X the navigation ran on. ### 6. Dedicated project browser — suggest it to the user When the work is a website project or business research, **offer** the user a dedicated recorded browser. This is a suggestion to the user only — set it up when they ask, don't spin it up unprompted. 1. Pick a slot number X (e.g. 2) and start headful on that slot: `hoody browser start` addressed to the `browser-X` hostname (`--browser-id X`) with `showBrowser=true`. The proxy derives `browser_port` 30000+X and `display` 500+X from the hostname and overrides any values you send. Add any per-project identity: own egress proxy (`proxyServer`/`proxyUsername`/`proxyPassword`/`proxyBypass`), `stealth`, `userAgent`, `viewport`, `locale`, `geolocation`, extensions. 2. Give the user the direct live-view URL — the standard kit URL with the `browser-` slug and `?view=display`: `https://{P}-{C}-browser-X.{N}.containers.hoody.com/?view=display`. That page embeds display 500+X live (the bare root URL shows an instance status page with a View Display link instead), so an instance started on display 500+X gets its own stable viewing URL — changing the X in the URL is how you address each browser's live window. `hoody browser devtools urls get` adds a live DevTools inspector as a second link; that link gives full control of the browser, so hand it only to someone you would give the browser to. 3. Everything browsed there — by the user clicking around in the live view or by the agent via the API — lands in persistent per-slot history (`hoody browser history list` with `browser_id=X`): live debugging and business research accumulate into one durable project trail. The instance itself is reaped once it has been idle past the deployment's max age (see Quirks) — history survives; re-run `hoody browser start` with the same options to revive the window. 4. Then offer log capture as a follow-up: console/network buffers hold only the last 500 entries and die with the instance, so a recurring `cron` job (or agent loop) draining `hoody browser logs console list`/`hoody browser logs network list` with `clear=true` into `sqlite`/`files`/agent memory preserves the captured entries for later sessions. For full console capture start the slot with `stealth=false`: the default stealth engine omits the page's console calls and errors. ### 7. Drive a page: snapshot, act, wait These three operations never start an instance (404 `NOT_FOUND` on an empty slot), so run `hoody browser start` and `hoody browser navigate` first. 1. `hoody browser get` and keep `instanceGeneration`. Passing it back on the calls below turns "the instance was replaced" into a 409 `INSTANCE_CHANGED` instead of acting on a fresh browser. 2. `hoody browser snapshot get` returns the tab's accessibility tree as YAML with `[ref=eN]` markers, plus a `snapshotId`. Entered form values read as `