Skip to main content
Browser lifecycle matters when your app or host owns orchestration. Browser-agent CLI runs create and clean up browsers for you.

SDK lifecycle

const browser = await web.browser.create({
  recording: true,
  policy: { allowedDomains: ["sec.gov"] },
});

const status = await browser.status();
await browser.close();

CLI lifecycle

BROWSER_ID=$(web browser create --recording --json | jq -r '.id')
web browser status "$BROWSER_ID" --json
web browser close "$BROWSER_ID"

MCP lifecycle

Use manage_browsers for create, list, get, status, stop, resume, close, Debug UI URL, CDP URL, CAPTCHA status, and CAPTCHA resolution. Close browsers when your task is done. Long-running workflows should set explicit budgets and store browser IDs with job records.