@browserbasehq/browse-cli 0.1.4 → 0.2.0-alpha-a9424ff2eb7bbde3cca93ae8d3a0fbe240335504

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 (4) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -5
  3. package/dist/index.js +115709 -105199
  4. package/package.json +16 -16
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Browserbase, Inc.
3
+ Copyright (c) 2024 Browserbase Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -155,8 +155,37 @@ Captured requests are saved as directories:
155
155
  browse start # Explicitly start daemon
156
156
  browse stop [--force] # Stop daemon
157
157
  browse status # Check daemon status
158
+ browse env [target] # Show or switch environment: local | remote
158
159
  ```
159
160
 
161
+ ### Environment Switching (Local vs Remote)
162
+
163
+ Use environment switching when an agent should keep the same command flow, but the
164
+ browser runtime needs to change:
165
+
166
+ - `local` runs Chrome on your machine (best for local debugging/dev loops)
167
+ - `remote` runs a Browserbase session (best for anti-bot hardening and cloud runs)
168
+
169
+ ```bash
170
+ # Show active environment (if running) and desired environment for next start
171
+ browse env
172
+
173
+ # Switch current session to Browserbase (restarts daemon if needed)
174
+ browse env remote
175
+
176
+ # Switch back to local Chrome
177
+ browse env local
178
+ ```
179
+
180
+ Behavior details:
181
+
182
+ - Environment is scoped per `--session`
183
+ - `browse env <target>` persists an override and restarts the daemon
184
+ - `browse stop` clears the override so next start falls back to env-var-based auto detection
185
+ - Auto detection defaults to:
186
+ - `remote` when `BROWSERBASE_API_KEY` and `BROWSERBASE_PROJECT_ID` are set
187
+ - `local` otherwise
188
+
160
189
  ## Global Options
161
190
 
162
191
  | Option | Description |
@@ -172,6 +201,8 @@ browse status # Check daemon status
172
201
  | Variable | Description |
173
202
  |----------|-------------|
174
203
  | `BROWSE_SESSION` | Default session name (alternative to `--session`) |
204
+ | `BROWSERBASE_API_KEY` | Browserbase API key (required for `browse env remote`) |
205
+ | `BROWSERBASE_PROJECT_ID` | Browserbase project ID (required for `browse env remote`) |
175
206
 
176
207
  ## Element References
177
208
 
@@ -286,18 +317,18 @@ Windows support requires WSL or TCP socket implementation.
286
317
  ```bash
287
318
  # Clone and setup (in monorepo)
288
319
  cd packages/cli
289
- npm install # Install dependencies first!
290
- npm run build # Build the CLI
320
+ pnpm install # Install dependencies first!
321
+ pnpm run build # Build the CLI
291
322
 
292
323
  # Run without building (for development)
293
- npm run dev -- <command>
324
+ pnpm run dev -- <command>
294
325
 
295
326
  # Or with tsx directly
296
327
  npx tsx src/index.ts <command>
297
328
 
298
329
  # Run linting and formatting
299
- npm run lint
300
- npm run format
330
+ pnpm run lint
331
+ pnpm run format
301
332
  ```
302
333
 
303
334
  ## License