You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**vs Playwright CLI** — BAP is built for agent workflows, not human shell scripting.
92
-
-**vs Playwright MCP** — When shell access is available, BAP CLI solves the same job with fewer roundtrips.
95
+
-**vs Playwright MCP** — When shell access is available, BAP CLI solves the same job with fewer roundtrips. In MCP mode, `--slim` cuts tool definitions to ~600 tokens vs ~4,200 for Playwright MCP's 70+ tools.
93
96
-**vs Chrome DevTools / CDP** — CDP is the low-level transport; BAP is the agent layer on top.
description: "Browser automation CLI with composite actionsand semantic selectors. Use when the user needs to visit websites, fill forms, extract data, take screenshots, or automate multi-step browser workflows like login, checkout, or search."
3
+
description: "Browser automation CLI with composite actions, semantic selectors, and self-healing selectors. Use when the user needs to visit websites, fill forms, extract data, take screenshots, stream browser events, or automate multi-step browser workflows like login, checkout, or search."
4
4
license: Apache-2.0
5
5
---
6
6
7
7
# BAP Browser CLI
8
8
9
9
AI-first browser automation. Like playwright-cli but with composite actions,
10
-
semantic selectors, and structured extraction.
10
+
semantic selectors, self-healing selectors, and action caching built in.
11
11
12
-
## Command Resolution
13
-
14
-
Pick the command form based on the environment:
12
+
## Quick Start
15
13
16
14
```bash
17
-
# Inside the bap repo (preferred for local development and release testing)
18
-
pnpm exec bap open https://example.com
19
-
20
-
# If bap is installed globally
21
-
bap open https://example.com
22
-
23
-
# Only when explicitly testing the published npm package
24
-
npx @browseragentprotocol/cli open https://example.com
15
+
bap demo # Guided walkthrough for first-time users
Inside this repo, use `pnpm exec bap` instead of bare `bap`. Prefer `bap goto` for navigation; use `bap open` only for explicit browser lifecycle control.
28
22
29
-
- Inside the repo, prefer `pnpm exec bap` so you use the local workspace build.
30
-
- Avoid `npx @browseragentprotocol/cli` for local development. It pulls the published npm version, which can lag behind the branch being tested.
31
-
- If `bap` is not on `PATH`, do not assume it is globally installed.
32
-
- In the examples below, `bap` is shorthand for the command form you picked above.
23
+
## Smart Defaults
33
24
34
-
## Quick Start
25
+
**Session persistence** — Browser pages persist across CLI invocations. Disconnect parks context; reconnect restores it. Named sessions: `bap -s=checkout goto /cart`. Auto-expire after 5 minutes.
|`bap: command not found`| Inside this repo, use `pnpm exec bap`. Outside the repo, either install globally or use `npx @browseragentprotocol/cli`if you intentionally want the published package |
217
-
| Element not found | Run `bap observe` to get fresh refs — the DOM changed after navigation |
218
-
| Stable ref click does not work | Use the exact ref from `bap observe`, including the leading `@`|
219
-
| Stale element ref | Re-run `bap observe` or `bap snapshot` after navigation or major DOM changes |
220
-
| Browser launch fails | Try `--no-profile`for a fresh browser, or use a dedicated `--profile <dir>`if the default Chrome profile is busy |
221
-
| Chrome says it is controlled by automated test software | Expected forPlaywright-launched Chrome. Use `--no-profile` for clean automation, or attach to a user-started browserin future workflows if that UX matters |
222
-
| Server not responding | Run `bap close-all` to kill the daemon, then retry your command|
0 commit comments