Install it, and give your agent the web.
Browser Layer is a terminal browser for AI agents: a page comes back as a short text map of its regions and controls, every action answers with what changed, and lists and tables come back as records. The agent reads text: no screenshots, no DOM dumps.
Install
It needs Node.js 22 or newer, on macOS, Linux or Windows, and drives a browser you already have: Google Chrome, then Microsoft Edge, then Chromium, whichever it finds first. To pick one, set BROWSER_LAYER_BROWSER to its executable.
npm install -g browser-layer browser-layer browser # which browser it will drive
On a machine with none, such as a server or a container, download Chromium once:
browser-layer install # macOS, Windows, or Linux with the system libraries present browser-layer install --with-deps # Linux: also installs the libraries Chromium needs (uses sudo)
Use it
browser-layer tab google.com/travel/flights # opens a live tab; answers with the page map browser-layer type 15 Mumbai # answers with what changed browser-layer click "Search" # a control by number or by name browser-layer steps 'type 15 Pune --enter; click "Search"' # several steps in one call browser-layer read 231 # one region in full browser-layer get 233 --sort c11 --limit 3 # a list or table as records (TSV) browser-layer net # the API calls the page made browser-layer stop
browser-layer help lists every command. A background daemon keeps the browser and its tabs alive between commands and exits after 30 idle minutes. Its state (profile, cookies, last page) lives in ~/.browser-layer, or BROWSER_LAYER_HOME. browser-layer show turns the agent’s browser into a visible window and hide makes it headless again; screenshot [ref] saves a picture when a person wants one.
Many pages, many agents
tab <url…> opens several pages at once and answers with each map. each '<read>' <url…> runs one read (find, read, get, eval…) on every page. open <url…> fetches plain pages in parallel. With --out, each page is written under a == address line, so one rg -n or sed -n works across all of them. XML sitemaps and feeds are read one record per line.
browser-layer open --out pages.txt https://example.com/a https://example.com/b browser-layer each --out pages.txt 'read' https://example.com/a https://example.com/b
Agents share one browser with --session <name> (or BROWSER_LAYER_SESSION). Each session has its own tabs and its own command queue, so agents do not wait on each other. stop in a named session closes only that session’s tabs, close --all closes every session’s in one call, and a session idle for 15 minutes loses its tabs when another session runs.
Long answers
An answer over 20,000 characters is saved whole to <home>/results/, and the reply gives its first 4,000 characters and how to take the rest with rg -n, sed -n, tail -c or jq. With --out <file> on open, read, find or get, the whole result goes to a file and the reply shows its first 1,500 characters. One big page or eval result never fills the agent’s context.
Signing in
browser-layer login <url> opens a normal browser window on the agent’s profile. You sign in yourself, close it, and the agent stays signed in. Passwords, 2FA and passkeys stay with you.
Your own Chrome
To use the browser you are already signed in with, run browser-layer attach. It opens Chrome’s chrome://inspect/#remote-debugging page, where you tick the box, and connects once; Chrome asks you to click Allow. Then run commands with --attach auto (or BROWSER_LAYER_ATTACH=auto; --attach <port> for a Chrome started with --remote-debugging-port). The agent works only in tabs of its own and never touches yours. It acts as you on every site you are signed in to, so use it only when you want that.
The fast path
open uses plain HTTP and starts no browser at all. It works when the content is in the HTML the server sends. Pages built by JavaScript, and forms, need a live tab.
Teach your agent
One command teaches Claude Code, Codex, Cursor and other agents the workflow:
npx skills add NAMANIND/browser-layer
browser-layer help and the skill are the same text, so an agent reads one manual.
The cloud
The cloud runs the same Browser Layer on a machine of its own, started when you ask and deleted when you stop, with saved logins per profile, a live view and a DevTools address for Playwright and Puppeteer. It is in early access, and we let teams in a few at a time. Ask for a spot at /early-access.