> ## Documentation Index
> Fetch the complete documentation index at: https://docs-preview.webcompute.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Browser lifecycle

> Create, inspect, stop, resume, and close managed Webcompute browsers.

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

## SDK lifecycle

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

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

## CLI lifecycle

```bash theme={null}
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.
