@bastani/atomic 0.8.31-alpha.1 → 0.8.31-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/CHANGELOG.md +17 -5
  2. package/README.md +12 -10
  3. package/dist/builtin/cursor/CHANGELOG.md +1 -1
  4. package/dist/builtin/cursor/package.json +2 -2
  5. package/dist/builtin/intercom/CHANGELOG.md +1 -1
  6. package/dist/builtin/intercom/package.json +2 -2
  7. package/dist/builtin/mcp/CHANGELOG.md +1 -1
  8. package/dist/builtin/mcp/package.json +3 -3
  9. package/dist/builtin/subagents/CHANGELOG.md +10 -1
  10. package/dist/builtin/subagents/agents/codebase-online-researcher.md +8 -8
  11. package/dist/builtin/subagents/agents/debugger.md +6 -6
  12. package/dist/builtin/subagents/package.json +4 -4
  13. package/dist/builtin/subagents/skills/effective-liteparse/SKILL.md +118 -0
  14. package/dist/builtin/subagents/skills/effective-liteparse/scripts/search.py +128 -0
  15. package/dist/builtin/subagents/skills/playwright-cli/SKILL.md +404 -0
  16. package/dist/builtin/subagents/skills/playwright-cli/references/element-attributes.md +23 -0
  17. package/dist/builtin/subagents/skills/playwright-cli/references/playwright-tests.md +39 -0
  18. package/dist/builtin/subagents/skills/playwright-cli/references/request-mocking.md +87 -0
  19. package/dist/builtin/subagents/skills/playwright-cli/references/running-code.md +241 -0
  20. package/dist/builtin/subagents/skills/playwright-cli/references/session-management.md +225 -0
  21. package/dist/builtin/subagents/skills/playwright-cli/references/spec-driven-testing.md +305 -0
  22. package/dist/builtin/subagents/skills/playwright-cli/references/storage-state.md +275 -0
  23. package/dist/builtin/subagents/skills/playwright-cli/references/test-generation.md +134 -0
  24. package/dist/builtin/subagents/skills/playwright-cli/references/tracing.md +139 -0
  25. package/dist/builtin/subagents/skills/playwright-cli/references/video-recording.md +143 -0
  26. package/dist/builtin/web-access/CHANGELOG.md +1 -1
  27. package/dist/builtin/web-access/package.json +2 -2
  28. package/dist/builtin/workflows/CHANGELOG.md +7 -1
  29. package/dist/builtin/workflows/README.md +4 -4
  30. package/dist/builtin/workflows/builtin/open-claude-design.ts +59 -56
  31. package/dist/builtin/workflows/builtin/ralph.ts +56 -3
  32. package/dist/builtin/workflows/builtin/shared-prompts.ts +1 -1
  33. package/dist/builtin/workflows/package.json +2 -2
  34. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +1 -1
  35. package/dist/cli/args.d.ts.map +1 -1
  36. package/dist/cli/args.js +1 -1
  37. package/dist/cli/args.js.map +1 -1
  38. package/dist/core/agent-session.d.ts +1 -0
  39. package/dist/core/agent-session.d.ts.map +1 -1
  40. package/dist/core/agent-session.js +49 -21
  41. package/dist/core/agent-session.js.map +1 -1
  42. package/dist/core/context-window.d.ts +26 -1
  43. package/dist/core/context-window.d.ts.map +1 -1
  44. package/dist/core/context-window.js +30 -6
  45. package/dist/core/context-window.js.map +1 -1
  46. package/dist/core/copilot-model-catalog.d.ts +39 -21
  47. package/dist/core/copilot-model-catalog.d.ts.map +1 -1
  48. package/dist/core/copilot-model-catalog.js +44 -16
  49. package/dist/core/copilot-model-catalog.js.map +1 -1
  50. package/dist/core/model-registry.d.ts.map +1 -1
  51. package/dist/core/model-registry.js +6 -4
  52. package/dist/core/model-registry.js.map +1 -1
  53. package/dist/core/project-trust.d.ts.map +1 -1
  54. package/dist/core/project-trust.js +2 -1
  55. package/dist/core/project-trust.js.map +1 -1
  56. package/dist/core/sdk.d.ts.map +1 -1
  57. package/dist/core/sdk.js +18 -7
  58. package/dist/core/sdk.js.map +1 -1
  59. package/dist/core/settings-manager.d.ts +11 -2
  60. package/dist/core/settings-manager.d.ts.map +1 -1
  61. package/dist/core/settings-manager.js +62 -8
  62. package/dist/core/settings-manager.js.map +1 -1
  63. package/dist/core/system-prompt.d.ts.map +1 -1
  64. package/dist/core/system-prompt.js +1 -0
  65. package/dist/core/system-prompt.js.map +1 -1
  66. package/dist/core/tools/edit-diff.d.ts +1 -2
  67. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  68. package/dist/core/tools/edit-diff.js +1 -2
  69. package/dist/core/tools/edit-diff.js.map +1 -1
  70. package/dist/index.d.ts +2 -1
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +2 -1
  73. package/dist/index.js.map +1 -1
  74. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  75. package/dist/modes/interactive/components/config-selector.js +5 -7
  76. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  77. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  78. package/dist/modes/interactive/components/model-selector.js +2 -1
  79. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  80. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  81. package/dist/modes/interactive/components/scoped-models-selector.js +4 -1
  82. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  83. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  84. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  85. package/dist/modes/interactive/components/settings-selector.js +165 -15
  86. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  87. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  88. package/dist/modes/interactive/components/tree-selector.js +44 -4
  89. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  90. package/dist/modes/interactive/interactive-mode.d.ts +1 -1
  91. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  92. package/dist/modes/interactive/interactive-mode.js +24 -54
  93. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  94. package/dist/modes/interactive/model-search.d.ts +7 -0
  95. package/dist/modes/interactive/model-search.d.ts.map +1 -0
  96. package/dist/modes/interactive/model-search.js +6 -0
  97. package/dist/modes/interactive/model-search.js.map +1 -0
  98. package/dist/modes/interactive/theme/theme-controller.d.ts +30 -0
  99. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
  100. package/dist/modes/interactive/theme/theme-controller.js +108 -0
  101. package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
  102. package/dist/modes/interactive/theme/theme-schema.json +2 -1
  103. package/dist/modes/interactive/theme/theme.d.ts +5 -0
  104. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  105. package/dist/modes/interactive/theme/theme.js +70 -29
  106. package/dist/modes/interactive/theme/theme.js.map +1 -1
  107. package/dist/modes/rpc/rpc-client.d.ts +1 -1
  108. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  109. package/dist/modes/rpc/rpc-client.js +1 -1
  110. package/dist/modes/rpc/rpc-client.js.map +1 -1
  111. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  112. package/dist/modes/rpc/rpc-mode.js +1 -1
  113. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  114. package/dist/package-manager-cli.d.ts.map +1 -1
  115. package/dist/package-manager-cli.js +39 -9
  116. package/dist/package-manager-cli.js.map +1 -1
  117. package/docs/extensions.md +21 -0
  118. package/docs/models.md +3 -3
  119. package/docs/packages.md +13 -9
  120. package/docs/providers.md +3 -3
  121. package/docs/quickstart.md +14 -0
  122. package/docs/rpc.md +3 -3
  123. package/docs/sdk.md +15 -11
  124. package/docs/session-format.md +1 -1
  125. package/docs/settings.md +8 -3
  126. package/docs/themes.md +3 -1
  127. package/docs/tui.md +1 -1
  128. package/docs/usage.md +12 -9
  129. package/docs/workflows.md +9 -7
  130. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  131. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  132. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  133. package/examples/extensions/gondolin/package-lock.json +2 -2
  134. package/examples/extensions/gondolin/package.json +1 -1
  135. package/examples/extensions/preset.ts +10 -4
  136. package/examples/extensions/provider-payload.ts +5 -5
  137. package/examples/extensions/sandbox/index.ts +2 -2
  138. package/examples/extensions/sandbox/package-lock.json +3 -3
  139. package/examples/extensions/sandbox/package.json +2 -2
  140. package/examples/extensions/subagent/agents.ts +2 -2
  141. package/examples/extensions/subagent/index.ts +4 -2
  142. package/examples/extensions/with-deps/package-lock.json +2 -2
  143. package/examples/extensions/with-deps/package.json +1 -1
  144. package/package.json +5 -5
  145. package/dist/builtin/subagents/skills/browser/EXAMPLES.md +0 -151
  146. package/dist/builtin/subagents/skills/browser/LICENSE.txt +0 -21
  147. package/dist/builtin/subagents/skills/browser/REFERENCE.md +0 -451
  148. package/dist/builtin/subagents/skills/browser/SKILL.md +0 -170
@@ -1,151 +0,0 @@
1
- # Browser Automation Examples
2
-
3
- Common browser automation workflows using the `browse` CLI. Each example demonstrates a distinct pattern using real commands.
4
-
5
- For localhost and other local dev flows, start with `browse open <url> --local` for a clean isolated browser. Use `browse open <url> --auto-connect` only when the agent should attach to an existing debuggable Chrome session for cookies or login state.
6
-
7
- ## Example 1: Extract Data from a Page
8
-
9
- **User request**: "Get the product details from example.com/product/123"
10
-
11
- ```bash
12
- browse open https://example.com/product/123
13
- browse snapshot # read page structure + element refs
14
- browse get text "body" # extract all visible text content
15
- browse stop
16
- ```
17
-
18
- Parse the text output to extract structured data (name, price, description, etc.).
19
-
20
- For a specific section, use a CSS selector:
21
-
22
- ```bash
23
- browse get text ".product-details" # text from a specific container
24
- ```
25
-
26
- **Note**: `browse get text` requires a CSS selector — use `"body"` for all page text.
27
-
28
- ## Example 2: Fill and Submit a Form
29
-
30
- **User request**: "Fill out the contact form on example.com with my information"
31
-
32
- ```bash
33
- browse open https://example.com/contact
34
- browse snapshot # find form fields and their refs
35
- browse click @0-3 # click the Name input (ref from snapshot)
36
- browse type "John Doe"
37
- browse press Tab # move to next field
38
- browse type "john@example.com"
39
- browse fill "#message" "I would like to inquire about your services"
40
- browse snapshot # verify fields are filled
41
- browse click @0-8 # click Submit button (ref from snapshot)
42
- browse snapshot # confirm submission result
43
- browse stop
44
- ```
45
-
46
- **Key pattern**: Use `browse snapshot` before interacting to discover element refs, then `browse click <ref>` and `browse type` to interact.
47
-
48
- ## Example 3: Multi-Step Navigation
49
-
50
- **User request**: "Get headlines from the first 3 pages of results on example.com/news"
51
-
52
- ```bash
53
- browse open https://example.com/news
54
- browse snapshot # read page 1 content
55
- browse get text ".headline" # extract headlines
56
-
57
- browse snapshot # find "Next" button ref
58
- browse click @0-12 # click Next (ref from snapshot)
59
- browse wait load # wait for page 2 to load
60
- browse get text ".headline" # extract page 2 headlines
61
-
62
- browse snapshot # find Next again (ref may change)
63
- browse click @0-15 # click Next
64
- browse wait load
65
- browse get text ".headline" # extract page 3 headlines
66
-
67
- browse stop
68
- ```
69
-
70
- **Key pattern**: Re-run `browse snapshot` after each navigation because element refs change when the page updates.
71
-
72
- ## Example 4: Escalate to Remote Mode
73
-
74
- **User request**: "Scrape pricing from competitor.com" (a site with Cloudflare protection)
75
-
76
- ```bash
77
- # Attempt 1: local mode
78
- browse open https://competitor.com/pricing --local
79
- browse snapshot
80
- # Output shows: "Checking your browser..." (Cloudflare interstitial)
81
- # or: page content is empty / access denied
82
- browse stop
83
- ```
84
-
85
- The agent detects bot protection and tells the user:
86
-
87
- > This site has Cloudflare bot detection. Browserbase remote mode can use Browserbase Identity with a Verified browser and residential proxies. Want me to set it up?
88
-
89
- If the user agrees:
90
-
91
- ```bash
92
- # Set Browserbase credentials
93
- export BROWSERBASE_API_KEY="bb_live_..."
94
-
95
- # Retry in remote mode
96
- browse open https://competitor.com/pricing --remote
97
- browse snapshot # full page content now accessible
98
- browse get text ".pricing-table"
99
- browse stop
100
- ```
101
-
102
- ## Example 5: Persist Login with Context ID
103
-
104
- **User request**: "Log into my dashboard and save the session so I don't have to log in again next time"
105
-
106
- This uses Browserbase contexts to persist cookies and storage across sessions. Requires remote mode.
107
-
108
- ```bash
109
- # Session 1: Log in and persist state
110
- SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --persist --keep-alive)"
111
- SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
112
- CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"
113
-
114
- browse open https://app.example.com/login --cdp "$CONNECT_URL"
115
- browse snapshot # find login form fields
116
- browse click @0-3 # click email input
117
- browse type "user@example.com"
118
- browse press Tab
119
- browse type "my-password"
120
- browse click @0-7 # click Sign In button
121
- browse wait load
122
- browse snapshot # confirm logged-in dashboard
123
- browse stop
124
- browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE # state is saved back to ctx_abc123
125
- ```
126
-
127
- In a later session, reuse the same context — already authenticated:
128
-
129
- ```bash
130
- # Session 2: Resume with saved state (already logged in)
131
- SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --keep-alive)"
132
- SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
133
- CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"
134
-
135
- browse open https://app.example.com/dashboard --cdp "$CONNECT_URL"
136
- browse snapshot # dashboard loads — no login needed
137
- browse get text ".welcome-message"
138
- browse stop
139
- browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE
140
- ```
141
-
142
- **Key pattern**: Use `browse cloud sessions create --context-id <id> --persist` for the first Browserbase session to save auth state, then attach with `browse open ... --cdp "$CONNECT_URL"`. On subsequent sessions, create with the same `--context-id` and omit `--persist` if you don't want changes saved back.
143
-
144
- ## Tips
145
-
146
- - **Snapshot first**: Always run `browse snapshot` before interacting — it gives you the accessibility tree with element refs
147
- - **Use refs to click**: `browse click @0-5` is more reliable than trying to describe elements
148
- - **Re-snapshot after actions**: Element refs change when the page updates
149
- - **`get text` for data extraction**: Use `browse get text [selector]` to pull text content from specific elements
150
- - **`stop` when done**: Always `browse stop` to clean up the browser session
151
- - **Prefer snapshot over screenshot**: Snapshot is fast and structured; screenshot is slow and uses vision tokens. Only screenshot when you need visual context (layout, images, debugging)
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Browserbase, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,451 +0,0 @@
1
- # Browser Automation CLI Reference
2
-
3
- Technical reference for the `browse` CLI tool.
4
-
5
- ## Table of Contents
6
-
7
- - [Architecture](#architecture)
8
- - [Command Reference](#command-reference)
9
- - [Navigation](#navigation)
10
- - [Page State](#page-state)
11
- - [Interaction](#interaction)
12
- - [Session Management](#session-management)
13
- - [JavaScript Evaluation](#javascript-evaluation)
14
- - [Viewport](#viewport)
15
- - [Network Capture](#network-capture)
16
- - [Configuration](#configuration)
17
- - [Global Flags](#global-flags)
18
- - [Environment Variables](#environment-variables)
19
- - [Error Messages](#error-messages)
20
-
21
- ## Architecture
22
-
23
- The browse CLI is a **daemon-based** command-line tool:
24
-
25
- - **Daemon process**: A background process manages the browser instance. Auto-starts on the first command (e.g., `browse open`), persists across commands, and stops with `browse stop`.
26
- - **Local mode**: `browse open <url> --local` launches a clean isolated local browser. It is the default when `BROWSERBASE_API_KEY` is unset. Use `browse open <url> --auto-connect` to attach to an existing debuggable Chrome, or `browse open <url> --cdp <port|url>` to attach to a specific CDP target.
27
- - **Remote mode** (Browserbase): Connects to a Browserbase cloud browser session when `BROWSERBASE_API_KEY` is set.
28
- - **Accessibility-first**: Use `browse snapshot` to get the page's accessibility tree with element refs, then interact using those refs.
29
-
30
- ## Command Reference
31
-
32
- ### Navigation
33
-
34
- #### `open <url>`
35
-
36
- Navigate to a URL. Auto-starts the daemon if not running.
37
-
38
- ```bash
39
- browse open https://example.com
40
- browse open https://example.com --wait networkidle # wait for all network requests to finish (useful for SPAs)
41
- browse open https://example.com --wait domcontentloaded
42
- ```
43
-
44
- The `--wait` flag controls when navigation is considered complete. Values: `load` (default), `domcontentloaded`, `networkidle`. Use `networkidle` for JavaScript-heavy pages that fetch data after initial load.
45
-
46
- ##### Context persistence (remote mode only)
47
-
48
- Create a Browserbase session with `browse cloud sessions create --context-id <id>`, then attach to its CDP endpoint with `browse open <url> --cdp <connectUrl>`. Add `--persist` to the cloud session if state changes should save back to the context.
49
-
50
- ```bash
51
- SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --persist --keep-alive)"
52
- SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
53
- CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"
54
-
55
- browse open https://example.com --cdp "$CONNECT_URL"
56
- # ...interact with the page...
57
- browse stop
58
- browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE
59
- ```
60
-
61
- - `--context-id <id>` — Browserbase context ID to load when creating the cloud session.
62
- - `--persist` — Save cookies/storage changes back to the context when the Browserbase session is released. Requires `--context-id`.
63
- - `--keep-alive` — Keep the Browserbase session alive while the local browse daemon attaches and detaches.
64
- - After `browse open ... --cdp "$CONNECT_URL"`, follow-up commands in that session do not repeat `--cdp`; the daemon remembers the attached target.
65
-
66
- #### `reload`
67
-
68
- Reload the current page.
69
-
70
- ```bash
71
- browse reload
72
- ```
73
-
74
- #### `back` / `forward`
75
-
76
- Navigate browser history.
77
-
78
- ```bash
79
- browse back
80
- browse forward
81
- ```
82
-
83
- ---
84
-
85
- ### Page State
86
-
87
- #### `snapshot`
88
-
89
- Get the accessibility tree with interactive element refs. This is the primary way to understand page structure.
90
-
91
- ```bash
92
- browse snapshot
93
- browse snapshot --compact # tree only, no ref maps
94
- ```
95
-
96
- Returns a text representation of the page with refs like `@0-5` that can be passed to `click`. Use `--compact` for shorter output when you only need the tree.
97
-
98
- #### `screenshot [path]`
99
-
100
- Take a visual screenshot. Slower than snapshot and uses vision tokens.
101
-
102
- ```bash
103
- browse screenshot # print base64 JSON
104
- browse screenshot --path ./capture.png # custom path
105
- browse screenshot --full-page # capture entire scrollable page
106
- ```
107
-
108
- #### `get <property> [selector]`
109
-
110
- Get page properties. Available properties: `url`, `title`, `text`, `html`, `value`, `box`, `visible`, `checked`.
111
-
112
- ```bash
113
- browse get url # current URL
114
- browse get title # page title
115
- browse get text "body" # all visible text (selector required)
116
- browse get text ".product-info" # text within a CSS selector
117
- browse get html "#main" # inner HTML of an element
118
- browse get value "#email-input" # value of a form field
119
- browse get box "#header" # bounding box (centroid coordinates)
120
- browse get visible ".modal" # check if element is visible
121
- browse get checked "#agree" # check if checkbox/radio is checked
122
- ```
123
-
124
- **Note**: `get text` requires a CSS selector argument — use `"body"` for full page text.
125
-
126
- #### `refs`
127
-
128
- Show the cached ref map from the last `browse snapshot`. Useful for looking up element refs without re-running a full snapshot.
129
-
130
- ```bash
131
- browse refs
132
- ```
133
-
134
- ---
135
-
136
- ### Interaction
137
-
138
- #### `click <ref>`
139
-
140
- Click an element by its ref from `browse snapshot` output.
141
-
142
- ```bash
143
- browse click @0-5 # click element with ref 0-5
144
- ```
145
-
146
- #### `click_xy <x> <y>`
147
-
148
- Click at exact viewport coordinates.
149
-
150
- ```bash
151
- browse click_xy 500 300
152
- ```
153
-
154
- #### `hover <x> <y>`
155
-
156
- Hover at viewport coordinates.
157
-
158
- ```bash
159
- browse hover 500 300
160
- ```
161
-
162
- #### `type <text>`
163
-
164
- Type text into the currently focused element.
165
-
166
- ```bash
167
- browse type "Hello, world!"
168
- browse type "slow typing" --delay 100 # 100ms between keystrokes
169
- browse type "human-like" --mistakes # simulate human typing with typos
170
- ```
171
-
172
- #### `fill <selector> <value>`
173
-
174
- Fill an input element matching a CSS selector. Add `--press-enter` when Enter is needed.
175
-
176
- ```bash
177
- browse fill "#search" "browser automation"
178
- browse fill "input[name=email]" "user@example.com"
179
- browse fill "#search" "query" --press-enter # fill and press Enter
180
- ```
181
-
182
- #### `select <selector> <values...>`
183
-
184
- Select option(s) from a dropdown.
185
-
186
- ```bash
187
- browse select "#country" "United States"
188
- browse select "#tags" "javascript" "typescript" # multi-select
189
- ```
190
-
191
- #### `press <key>`
192
-
193
- Press a keyboard key or key combination.
194
-
195
- ```bash
196
- browse press Enter
197
- browse press Tab
198
- browse press Escape
199
- browse press Cmd+A # select all (Mac)
200
- browse press Ctrl+C # copy (Linux/Windows)
201
- ```
202
-
203
- #### `mouse scroll <x> <y> <deltaX> <deltaY>`
204
-
205
- Scroll at a given position by a given amount.
206
-
207
- ```bash
208
- browse mouse scroll 500 300 0 -300 # scroll up at (500, 300)
209
- browse mouse scroll 500 300 0 500 # scroll down
210
- ```
211
-
212
- #### `mouse drag <fromX> <fromY> <toX> <toY>`
213
-
214
- Drag from one viewport coordinate to another.
215
-
216
- ```bash
217
- browse mouse drag 80 80 310 100 # drag with default 10 steps
218
- browse mouse drag 80 80 310 100 --steps 20 # more intermediate steps
219
- browse mouse drag 80 80 310 100 --delay 50 # 50ms between steps
220
- browse mouse drag 80 80 310 100 --button right # use right mouse button
221
- browse mouse drag 80 80 310 100 --return-xpath # return source/target XPaths
222
- ```
223
-
224
- #### `highlight <selector>`
225
-
226
- Highlight an element on the page for visual debugging.
227
-
228
- ```bash
229
- browse highlight "#submit-btn" # highlight for 2 seconds (default)
230
- browse highlight ".nav" -d 5000 # highlight for 5 seconds
231
- ```
232
-
233
- #### `is <check> <selector>`
234
-
235
- Check element state. Available checks: `visible`, `checked`.
236
-
237
- ```bash
238
- browse is visible ".modal" # returns { visible: true/false }
239
- browse is checked "#agree" # returns { checked: true/false }
240
- ```
241
-
242
- #### `wait <type> [arg]`
243
-
244
- Wait for a condition.
245
-
246
- ```bash
247
- browse wait load # wait for page load
248
- browse wait "selector" ".results" # wait for element to appear
249
- browse wait timeout 3000 # wait 3 seconds
250
- ```
251
-
252
- ---
253
-
254
- ### Session Management
255
-
256
- #### `start`
257
-
258
- Start the browser daemon manually. Usually not needed — the daemon auto-starts on first command.
259
-
260
- ```bash
261
- browse start
262
- ```
263
-
264
- #### `stop`
265
-
266
- Stop the browser daemon and close the browser.
267
-
268
- ```bash
269
- browse stop
270
- browse stop --force # force kill if daemon is unresponsive
271
- ```
272
-
273
- #### `status`
274
-
275
- Check whether the daemon is running, its connection details, and current environment.
276
-
277
- ```bash
278
- browse status
279
- ```
280
-
281
- #### Starting sessions with a mode flag
282
-
283
- Choose the browser target on the command that starts the session:
284
-
285
- ```bash
286
- browse open https://example.com --local
287
- browse open https://example.com --local --headed
288
- browse open https://example.com --auto-connect
289
- browse open https://example.com --cdp 9222
290
- browse open https://example.com --cdp ws://localhost:9222/devtools/browser/...
291
- browse open https://example.com --remote
292
- ```
293
-
294
- - `browse status` shows the resolved mode and active target once the daemon is running.
295
- - `browse stop` closes the current daemon session; the next `browse open` chooses mode from its flags or environment.
296
-
297
- #### `tab new [url]`
298
-
299
- Create a new tab, optionally navigating to a URL.
300
-
301
- ```bash
302
- browse tab new # open blank tab
303
- browse tab new https://example.com # open tab with URL
304
- ```
305
-
306
- #### `tab list`
307
-
308
- List all open tabs.
309
-
310
- ```bash
311
- browse tab list
312
- ```
313
-
314
- #### `tab switch <index-or-target-id>`
315
-
316
- Switch to a tab by its index or target ID (from `browse tab list`).
317
-
318
- ```bash
319
- browse tab switch 1
320
- ```
321
-
322
- #### `tab close [index-or-target-id]`
323
-
324
- Close a tab. Closes current tab if no index given. The CLI refuses to close the last remaining tab.
325
-
326
- ```bash
327
- browse tab close # close current tab
328
- browse tab close 2 # close tab at index 2
329
- ```
330
-
331
- ---
332
-
333
- ### JavaScript Evaluation
334
-
335
- #### `eval <expression>`
336
-
337
- Evaluate JavaScript in the page context.
338
-
339
- ```bash
340
- browse eval "document.title"
341
- browse eval "document.querySelectorAll('a').length"
342
- ```
343
-
344
- ---
345
-
346
- ### Viewport
347
-
348
- #### `viewport <width> <height>`
349
-
350
- Set the browser viewport size.
351
-
352
- ```bash
353
- browse viewport 1920 1080
354
- ```
355
-
356
- ---
357
-
358
- ### Network Capture
359
-
360
- Capture network requests to the filesystem for inspection.
361
-
362
- #### `network on`
363
-
364
- Enable network request capture. Creates a temp directory where requests and responses are saved as JSON files.
365
-
366
- ```bash
367
- browse network on
368
- ```
369
-
370
- #### `network off`
371
-
372
- Disable network capture.
373
-
374
- ```bash
375
- browse network off
376
- ```
377
-
378
- #### `network path`
379
-
380
- Show the capture directory path.
381
-
382
- ```bash
383
- browse network path
384
- ```
385
-
386
- #### `network clear`
387
-
388
- Clear all captured requests.
389
-
390
- ```bash
391
- browse network clear
392
- ```
393
-
394
- ---
395
-
396
- ## Configuration
397
-
398
- ### Common Flags
399
-
400
- #### `--session <name>`
401
-
402
- Run commands against a named session, enabling multiple concurrent browsers.
403
-
404
- ```bash
405
- browse open https://a.com --session work
406
- browse open https://b.com --session personal
407
- ```
408
-
409
- Context flags such as `--context-id` and `--persist` live on `browse cloud sessions create`; attach to the resulting `connectUrl` with `browse open ... --cdp <connectUrl>`.
410
-
411
- ### Environment Variables
412
-
413
- | Variable | Required | Description |
414
- |----------|----------|-------------|
415
- | `BROWSE_SESSION` | No | Default session name (alternative to `--session`) |
416
- | `BROWSERBASE_API_KEY` | For remote mode | API key from https://browserbase.com/settings; makes Browserbase the default desired mode when no override is set |
417
- | `BROWSERBASE_PROJECT_ID` | No | Passed through to Browserbase when set |
418
-
419
- Without an override, setting `BROWSERBASE_API_KEY` makes Browserbase the default desired mode. Otherwise the default desired mode is local. Use `--local`, `--remote`, `--auto-connect`, or `--cdp <port|url>` on `browse open` when you need an explicit target.
420
-
421
- ### Setting credentials
422
-
423
- ```bash
424
- export BROWSERBASE_API_KEY="bb_live_..."
425
- ```
426
-
427
- Get these values from https://browserbase.com/settings.
428
-
429
- ---
430
-
431
- ## Error Messages
432
-
433
- **"No active page"**
434
- - The daemon is running but has no page open.
435
- - Fix: Run `browse open <url>`. If the issue persists, run `browse stop` and retry. For zombie daemons: `pkill -f "browse.*daemon"`.
436
-
437
- **"Chrome not found"** / **"Could not find local Chrome installation"**
438
- - Chrome/Chromium is not installed or not in a standard location.
439
- - Fix: Install Chrome, use `browse open <url> --auto-connect` if you already have a debuggable Chrome running, or switch to remote with `browse open <url> --remote` (no local browser needed).
440
-
441
- **"Daemon not running"**
442
- - No daemon process is active. Most commands auto-start the daemon, but `snapshot`, `click`, etc. require an active session.
443
- - Fix: Run `browse open <url>` to start a session.
444
-
445
- **Element ref not found (e.g., "@0-5")**
446
- - The ref from a previous snapshot is no longer valid (page changed).
447
- - Fix: Run `browse snapshot` again to get fresh refs.
448
-
449
- **Timeout errors**
450
- - The page took too long to load or an element didn't appear.
451
- - Fix: Try `browse wait load` before interacting, or increase wait time.