sightmap browser manages the Chrome for Testing session used by live commands. Sightmap records the session in .sightmap/.session. By default, Chrome exposes its DevTools endpoint on localhost:7892; browser start also runs the Sightmap HTTP server on port 7891 for the overlay extension.
This page covers session management. See Page interaction for
click, fill, screenshot, bounds, and tab management. See Capturing pages for annotated component trees. Page commands also accept --addr and --tab; see the shared conventions.browser install
Downloads the latest stable Chrome for Testing into ~/.sightmap/browsers/ and prints the path to the installed binary. Idempotent: if the current stable version is already installed, it prints the path and exits 0. Takes no flags.
browser start
start launches Chrome, starts the Sightmap HTTP server, and loads the overlay extension. The extension is embedded in the binary and extracted to ~/.sightmap/extension/ when needed. The server recompiles the corpus after YAML changes under .sightmap/. start runs in the foreground until you press Ctrl-C, which stops Chrome and the server.
The start daemon owns the session: it is the only way to launch Chrome for sightmap, and every live command attaches to it. It also runs the console/network collector that buffers browser activity for the console and network commands, so those need a running start session.
Run it from the site directory (the one containing .sightmap/), typically in a second terminal or as a background job. start creates .sightmap/ if it is absent and records the session at .sightmap/.session; if it cannot persist that file it fails loudly rather than running sessionless. Every other command finds the session through this file, keyed by --sightmap-dir — so with no session file a command falls back to the default CDP port and warns, since a session answering there may belong to a different corpus or agent. Pass --addr to target a specific session explicitly.
If Chrome is already running for this site, Pass that ID as
start opens a new tab in the existing session and prints that tab’s ID:--tab on every subsequent page command.browser stop
Stops the session’s Chrome process group. If needed, it finds remaining processes by profile directory. It removes the session file after Chrome stops. Takes no flags.
no active session and exits 0.
browser status
Reports session health by probing the CDP endpoint and lists each open content tab with its --tab value. If Chrome is gone, it prints ✗ unreachable, removes the stale session file, and tells you to run browser start again.
○ no session. If a Chrome process for the site’s profile is still alive without a session file, it reports ⚠ orphan and points you at browser stop to reap it.
browser navigate
Navigates the session to a URL and waits for the page to load. The URL is a positional argument. After a redirect — server-side or client-side (an SPA auth guard bouncing /login → /, or / → /workspace) — navigate prints the requested and final URLs, so you know where you actually landed.
browser eval
Evaluates a JavaScript expression in the page context. The script is a positional argument. The command pretty-prints JSON objects and arrays.
Only JSON-serializable values can be returned. A DOM element reference such as document.querySelector(...) cannot be returned by value; extract a property such as document.querySelector('h1')?.textContent.
browser inject
Injects a script into the page. Where eval runs once in the current document, inject --persist registers the script with the session daemon so it re-runs at the start of every new document, in every tab, for the life of the session — surviving navigations. It is backed by CDP Page.addScriptToEvaluateOnNewDocument, held on the daemon’s session-lifetime connection (a script added over a per-command connection would be dropped the moment that command exits). Handy for polyfills, overlays, and instrumentation or experimentation bundles that must outlive a multi-page flow.
Provide the source as an inline positional argument or with --file. --persist also runs the script once in the currently-loaded document (best-effort), since addScriptToEvaluateOnNewDocument only affects future documents.
--persist, --remove, and --list require a running browser start session, since the registry lives in its daemon.
browser mcp
Enumerate and call the WebMCP tools a page exposes. A page can declare callable actions to an in-browser agent through document.modelContext (getTools() / executeTool()); mcp list reads them and mcp call invokes one — so you can call a named action instead of driving the UI blind.
mcp list distinguishes three states: native WebMCP (a browser-provided document.modelContext), a polyfilled one (provided by a page script), and absent. When absent it fails loudly with the Chrome flags that enable native WebMCP. One tool runs at a single point in time; WebMCP has no cross-navigation tool responses, so if a tool triggers a client-side navigation, re-run mcp list on the new view. Any guidance the tool returns (e.g. a hint toward the next tool) is part of its result.
Native WebMCP is behind Chrome flags; start the session with them:
Tools return the standard WebMCP
CallToolResult envelope ({ content, isError }). mcp call unwraps it — rendering the text/structured content (and any guidance the tool includes) as itself rather than a stringified blob — and exits non-zero when the tool reports isError, so it is scriptable. --json prints the raw envelope verbatim.
--addr and --tab like the other page commands.
browser clear-storage
Clears all cookies, including httpOnly cookies, and clears storage for one origin. Origin storage includes localStorage, IndexedDB, service workers, and caches.
Typical flow
1
Install the browser once
sightmap browser install downloads Chrome for Testing to ~/.sightmap/browsers/.2
Start the session
From the site directory, run
sightmap browser start. Note the --addr and --tab values it prints.3
Check health
sightmap browser status confirms ● running and lists open tabs.4
Navigate and work
sightmap browser navigate 'https://...', then capture and interact (Capturing pages, Page interaction).5
Stop when done
Ctrl-C in the
start terminal, or sightmap browser stop from anywhere in the site directory.