Skip to content

Commit e1cd472

Browse files
shrey150claude
andcommitted
docs(browser): document browse env local auto-discovery
Update SKILL.md and REFERENCE.md to reflect new browse env local behavior: auto-discovers existing Chrome with remote debugging, --isolated flag, and explicit CDP target (port or URL). Sister PR to browserbase/stagehand#1886. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1f532a1 commit e1cd472

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

skills/browser/REFERENCE.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,23 @@ Check whether the daemon is running, its connection details, and current environ
272272
browse status
273273
```
274274
275-
#### `env [local|remote]`
275+
#### `env [local|remote] [cdpTarget] [--isolated]`
276276
277277
Show or switch the browser environment. Without arguments, prints the current environment. With an argument, stops the running daemon and restarts in the specified environment. The switch is sticky — subsequent commands stay in the chosen environment until you switch again or run `browse stop`.
278278
279+
`browse env local` auto-discovers an already-running Chrome with remote debugging enabled (scans `DevToolsActivePort` files and probes common ports like 9222). Falls back to launching an isolated browser if no debuggable Chrome is found.
280+
279281
```bash
280282
browse env # print current environment
281-
browse env local # switch to local Chrome
283+
browse env local # auto-discover local Chrome, fallback to isolated
284+
browse env local --isolated # force clean isolated browser (skip discovery)
285+
browse env local 9222 # attach to CDP target on port 9222
286+
browse env local ws://host:port/path # attach to explicit CDP WebSocket URL
282287
browse env remote # switch to Browserbase (requires API keys)
283288
```
284289
290+
`browse status` reports `localStrategy`, `localSource`, `resolvedCdpUrl`, and `fallbackReason` when in local mode.
291+
285292
#### `newpage [url]`
286293
287294
Create a new tab, optionally navigating to a URL.

skills/browser/SKILL.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ which browse || npm install -g @browserbasehq/browse-cli
3333
The CLI automatically selects between local and remote browser environments based on available configuration:
3434

3535
### Local mode (default)
36-
- Uses local Chrome — no API keys needed
36+
- Auto-discovers an already-running Chrome with remote debugging enabled and attaches to it
37+
- Falls back to launching an isolated Chrome if no debuggable browser is found
38+
- No API keys needed
3739
- Best for: development, simple pages, trusted sites with no bot protection
3840

3941
### Remote mode (Browserbase)
@@ -92,9 +94,11 @@ browse wait <type> [arg] # Wait for: load, selector, timeout
9294
### Session management
9395
```bash
9496
browse stop # Stop the browser daemon
95-
browse status # Check daemon status (includes env)
97+
browse status # Check daemon status (includes env and local strategy)
9698
browse env # Show current environment (local or remote)
97-
browse env local # Switch to local Chrome
99+
browse env local # Auto-discover local Chrome, fallback to isolated
100+
browse env local --isolated # Force clean isolated browser (skip auto-discovery)
101+
browse env local <port|url> # Attach to specific CDP target
98102
browse env remote # Switch to Browserbase (requires API keys)
99103
browse pages # List all open tabs
100104
browse tab_switch <index> # Switch to tab by index
@@ -154,10 +158,14 @@ Don't switch for simple sites (docs, wikis, public APIs, localhost).
154158
155159
```bash
156160
browse env remote # switch to Browserbase
157-
browse env local # switch back to local Chrome
161+
browse env local # switch back to local (auto-discovers existing Chrome)
162+
browse env local --isolated # force a clean isolated browser
163+
browse env local 9222 # attach to Chrome on specific port
158164
```
159165
160166
The switch is sticky until you run `browse stop` or switch again.
161167
168+
`browse env local` auto-discovers a running Chrome with remote debugging enabled (via `DevToolsActivePort` files and common port probing). If no debuggable Chrome is found, it falls back to launching an isolated browser. Use `--isolated` to skip auto-discovery and always get a clean browser.
169+
162170
For detailed examples, see [EXAMPLES.md](EXAMPLES.md).
163171
For API reference, see [REFERENCE.md](REFERENCE.md).

0 commit comments

Comments
 (0)