@browserbasehq/cli 0.3.1 → 0.3.2
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.
- package/LICENSE +21 -0
- package/README.md +170 -9
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,20 +1,181 @@
|
|
|
1
1
|
# Browserbase CLI
|
|
2
2
|
|
|
3
|
-
Browserbase
|
|
3
|
+
The official CLI for [Browserbase](https://browserbase.com). Manage sessions, deploy serverless functions, browse the web, and interact with the full Browserbase platform from your terminal.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
npm install -g @browserbasehq/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Node.js 18+.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Set your API key
|
|
17
|
+
export BROWSERBASE_API_KEY=bb_live_...
|
|
18
|
+
|
|
19
|
+
# Fetch a webpage
|
|
20
|
+
bb fetch https://example.com
|
|
21
|
+
|
|
22
|
+
# Search the web
|
|
23
|
+
bb search "browserbase documentation"
|
|
24
|
+
|
|
25
|
+
# Browse interactively
|
|
26
|
+
bb browse https://example.com
|
|
27
|
+
|
|
28
|
+
# List your sessions
|
|
29
|
+
bb sessions list
|
|
11
30
|
```
|
|
12
31
|
|
|
13
|
-
##
|
|
32
|
+
## Commands
|
|
33
|
+
|
|
34
|
+
### `bb fetch <url>`
|
|
35
|
+
|
|
36
|
+
Retrieve webpage content without a full browser session.
|
|
14
37
|
|
|
15
38
|
```bash
|
|
16
|
-
|
|
39
|
+
bb fetch https://example.com
|
|
40
|
+
bb fetch https://example.com --output page.json
|
|
41
|
+
bb fetch https://example.com --proxies --allow-redirects
|
|
17
42
|
```
|
|
18
43
|
|
|
19
|
-
|
|
20
|
-
|
|
44
|
+
| Flag | Description |
|
|
45
|
+
|------|-------------|
|
|
46
|
+
| `--output <path>` | Write response to file |
|
|
47
|
+
| `--proxies` | Enable Browserbase proxy support |
|
|
48
|
+
| `--allow-redirects` | Follow HTTP redirects |
|
|
49
|
+
| `--allow-insecure-ssl` | Bypass TLS certificate verification |
|
|
50
|
+
|
|
51
|
+
### `bb search <query>`
|
|
52
|
+
|
|
53
|
+
Search the web using the Browserbase Search API.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
bb search "web automation tools"
|
|
57
|
+
bb search "browserbase" --num-results 5
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
| Flag | Description |
|
|
61
|
+
|------|-------------|
|
|
62
|
+
| `--num-results <n>` | Number of results (1-25, default 10) |
|
|
63
|
+
| `--output <path>` | Write results to file |
|
|
64
|
+
|
|
65
|
+
### `bb browse [args...]`
|
|
66
|
+
|
|
67
|
+
Launch a browser session. Forwards to the `@browserbasehq/browse-cli` package (auto-installs on first use).
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bb browse https://example.com
|
|
71
|
+
bb browse --yes # skip install prompt
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `bb sessions`
|
|
75
|
+
|
|
76
|
+
Manage remote browser sessions.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
bb sessions list # List all sessions
|
|
80
|
+
bb sessions list --q "status=RUNNING" # Filter by metadata
|
|
81
|
+
bb sessions get <session-id> # Get session details
|
|
82
|
+
bb sessions create --body '{"projectId":"..."}'
|
|
83
|
+
bb sessions update <id> --status REQUEST_RELEASE
|
|
84
|
+
bb sessions debug <id> # Get debugger connection URLs
|
|
85
|
+
bb sessions logs <id> # View session logs
|
|
86
|
+
bb sessions recording <id> # Get rrweb recording events
|
|
87
|
+
bb sessions downloads get <id> # Download session artifacts (ZIP)
|
|
88
|
+
bb sessions uploads create <id> <file> # Upload a file to a session
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### `bb functions`
|
|
92
|
+
|
|
93
|
+
Write and deploy serverless browser automation to the cloud.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Scaffold a new project
|
|
97
|
+
bb functions init my-function
|
|
98
|
+
|
|
99
|
+
# Run locally
|
|
100
|
+
bb functions dev handler.ts --port 3000
|
|
101
|
+
|
|
102
|
+
# Deploy to Browserbase
|
|
103
|
+
bb functions publish handler.ts
|
|
104
|
+
bb functions publish handler.ts --dry-run # preview without deploying
|
|
105
|
+
|
|
106
|
+
# Invoke a deployed function
|
|
107
|
+
bb functions invoke <function-id> --params '{"url":"https://example.com"}'
|
|
108
|
+
bb functions invoke --check-status <invocation-id>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
| Subcommand | Description |
|
|
112
|
+
|------------|-------------|
|
|
113
|
+
| `init [name]` | Scaffold a Functions project (`--package-manager npm\|pnpm`) |
|
|
114
|
+
| `dev <entry>` | Start local dev server (`--port`, `--host`, `--verbose`) |
|
|
115
|
+
| `publish <entry>` | Deploy function (`--dry-run`) |
|
|
116
|
+
| `invoke [id]` | Invoke a function (`--params`, `--no-wait`, `--check-status`) |
|
|
117
|
+
|
|
118
|
+
### `bb projects`
|
|
119
|
+
|
|
120
|
+
Manage Browserbase projects.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
bb projects list
|
|
124
|
+
bb projects get <project-id>
|
|
125
|
+
bb projects usage <project-id>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### `bb contexts`
|
|
129
|
+
|
|
130
|
+
Persist browser state (cookies, localStorage) across sessions.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
bb contexts create --body '{"projectId":"..."}'
|
|
134
|
+
bb contexts get <context-id>
|
|
135
|
+
bb contexts update <context-id> # Refresh upload URL
|
|
136
|
+
bb contexts delete <context-id>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### `bb extensions`
|
|
140
|
+
|
|
141
|
+
Manage Chrome extensions for remote sessions.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
bb extensions upload extension.zip
|
|
145
|
+
bb extensions get <extension-id>
|
|
146
|
+
bb extensions delete <extension-id>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### `bb skills`
|
|
150
|
+
|
|
151
|
+
Install Browserbase agent skills for Claude Code.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
bb skills # Interactive install
|
|
155
|
+
bb skills install # Non-interactive install
|
|
156
|
+
bb skills --yes # Auto-accept prompts
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
| Environment Variable | Description |
|
|
162
|
+
|---------------------|-------------|
|
|
163
|
+
| `BROWSERBASE_API_KEY` | Your Browserbase API key (required) |
|
|
164
|
+
| `BROWSERBASE_PROJECT_ID` | Default project ID for Functions |
|
|
165
|
+
| `BROWSERBASE_BASE_URL` | Custom API base URL |
|
|
166
|
+
|
|
167
|
+
All environment variables can be overridden per-command with `--api-key`, `--project-id`, or `--base-url` flags.
|
|
168
|
+
|
|
169
|
+
## Development
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
bun install
|
|
173
|
+
bun run cli -- --help # Run locally
|
|
174
|
+
bun run check # Type-check
|
|
175
|
+
bun run build # Build to dist/
|
|
176
|
+
bun run test # Build + run tests
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## License
|
|
180
|
+
|
|
181
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|