Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions skills/browser/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ browse stop

**Key pattern**: Use `--context-id <id> --persist` on the first session to save auth state. On subsequent sessions, use `--context-id <id>` (with or without `--persist`) to resume where you left off. Omit `--persist` if you don't want changes from that session saved back.

## Example 6: Attach to an Existing Browserbase Session

**User request**: "Connect to this running Browserbase session and check its state"

Use `--connect` to attach the CLI to a Browserbase session that was created outside the CLI (via the API, dashboard, or another tool). The CLI connects without creating a new session, and `browse stop` disconnects without killing it.

```bash
# Attach to the existing session
browse --connect bb_sess_abc123 open https://app.example.com/dashboard
browse snapshot # inspect the page
browse get text ".status" # extract data
browse stop # disconnect — session stays alive on Browserbase
```

**Key pattern**: `--connect` is for sessions you don't own — the CLI is a guest. `browse stop` only disconnects, it does not terminate the remote session. Cannot be combined with `--context-id`.

## Tips

- **Snapshot first**: Always run `browse snapshot` before interacting — it gives you the accessibility tree with element refs
Expand Down
12 changes: 12 additions & 0 deletions skills/browser/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,18 @@ Load a Browserbase context to persist browser state (cookies, localStorage, sess

Save browser state changes back to the Browserbase context when the session ends. Must be used with `--context-id`.

#### `--connect <session-id>`

Attach to an existing Browserbase session by ID instead of creating a new one. **Remote mode only** — errors in local mode. The session stays alive after `browse stop` (uses `keepAlive: true`), so you can reconnect later or hand it off to another tool.

```bash
browse --connect bb_sess_abc123 open https://example.com
```

- Mutually exclusive with `--context-id` (the session already exists and has its own state).
- If the daemon is running with a different session ID, it automatically restarts.
- `browse stop` disconnects the CLI but does **not** terminate the Browserbase session.

### Environment Variables

| Variable | Required | Description |
Expand Down
1 change: 1 addition & 0 deletions skills/browser/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ All commands work identically in both modes. The daemon auto-starts on first com
browse open <url> # Go to URL (aliases: goto)
browse open <url> --context-id <id> # Load Browserbase context (remote only)
browse open <url> --context-id <id> --persist # Load context + save changes back
browse --connect <session-id> open <url> # Attach to existing Browserbase session (remote only)
browse reload # Reload current page
browse back # Go back in history
browse forward # Go forward in history
Expand Down