Skip to content

[STG-1741] feat(cli): add global flags for Browserbase session parameters#1935

Merged
shrey150 merged 2 commits intomainfrom
feat/browse-session-flags
Apr 2, 2026
Merged

[STG-1741] feat(cli): add global flags for Browserbase session parameters#1935
shrey150 merged 2 commits intomainfrom
feat/browse-session-flags

Conversation

@shrey150
Copy link
Copy Markdown
Contributor

@shrey150 shrey150 commented Mar 31, 2026

Summary

  • Add global CLI flags for commonly used Browserbase session parameters to the browse CLI
  • Users no longer need external tools or workarounds to configure advancedStealth, proxies, solveCaptchas, etc.
  • Flags are remote-mode only and trigger daemon restart when changed

New flags

Flag Description
--proxies Enable Browserbase proxy
--advanced-stealth Enable advanced stealth mode
--solve-captchas / --no-solve-captchas Toggle CAPTCHA solving
--region <region> Session region
--keep-alive Keep session alive after disconnection
--session-timeout <seconds> Session timeout
--block-ads Enable ad blocking

Examples

browse --proxies --advanced-stealth open https://example.com
browse --region us-east-1 --solve-captchas open https://example.com

Session flags are validated to only work in remote mode and will error with a helpful message if used in local mode.

Linear: https://linear.app/browserbase/issue/STG-1741/featcli-add-global-flags-for-browserbase-session-parameters

Test plan

  • browse --help shows new flags with "(remote only)" descriptions
  • browse --proxies open https://example.com (in remote mode) creates session with proxy enabled
  • browse --advanced-stealth --solve-captchas open https://example.com configures both settings
  • browse --proxies open https://example.com (in local mode) errors with helpful message
  • Changing flags restarts the daemon automatically
  • browse status shows active session params
  • Build succeeds

🤖 Generated with Claude Code


Summary by cubic

Add global flags to browse to configure Browserbase session settings in remote mode (proxies, stealth, CAPTCHA solving, region, keep-alive, timeouts) without JSON. Settings persist per session, trigger a daemon restart when changed, and appear as sessionParams in browse status JSON; also fixes lint errors. Addresses Linear STG-1741.

  • New Features
    • Flags: --proxies, --advanced-stealth, --solve-captchas/--no-solve-captchas, --block-ads, --region <region>, --keep-alive, --session-timeout <seconds>; remote-only with a clear error in local mode

Written for commit 064c0e4. Summary will update on new commits. Review in cubic

Add global CLI flags for commonly used Browserbase session
parameters: --proxies, --advanced-stealth, --solve-captchas,
--region, --keep-alive, --session-timeout, --block-ads.

These flags configure the Browserbase session when using remote
mode, eliminating the need to pass raw JSON. Session params are
persisted to a config file and trigger daemon restart when changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: 064c0e4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant User
    participant CLI as "Browse CLI"
    participant FS as "File System (Socket Dir)"
    participant Daemon as "CLI Daemon Process"
    participant BB as "Browserbase API"

    Note over User,BB: CLI Command Execution Flow (e.g., browse [--proxies] open URL)

    User->>CLI: Run command with session flags
    CLI->>FS: getDesiredMode(session)
    FS-->>CLI: Mode (local or browserbase)

    alt Flags provided in local mode
        CLI-->>User: Error: Session flags only supported in remote mode
    else Flags provided in remote mode
        CLI->>CLI: buildSessionParamsFromOpts()
        CLI->>FS: Read existing session-params
        FS-->>CLI: current parameters
        CLI->>FS: Write browse-{session}.session-params
        
        opt Params changed and Daemon is active
            CLI->>Daemon: stopDaemonAndCleanup()
            Daemon-->>CLI: Terminated
        end
    end

    CLI->>Daemon: ensureDaemon(session)
    
    Note over Daemon,BB: Daemon Initialization
    Daemon->>FS: Read browse-{session}.session-params
    FS-->>Daemon: JSON params (proxies, stealth, etc.)
    
    Daemon->>BB: Create session with browserbaseSessionCreateParams
    Note right of BB: Includes proxies, region, timeout and browserSettings (stealth, ads, captchas)
    BB-->>Daemon: Session ID / CDP URL

    Daemon-->>CLI: Daemon ready
    CLI->>Daemon: sendCommand(args)
    Daemon-->>CLI: Result
    CLI-->>User: Output result

    Note over User,FS: Status Check Flow
    User->>CLI: browse status
    CLI->>FS: isDaemonRunning()
    CLI->>FS: Read browse-{session}.session-params
    FS-->>CLI: session parameters
    CLI-->>User: Output JSON (includes sessionParams)
Loading

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shrey150 shrey150 merged commit 666baf1 into main Apr 2, 2026
32 checks passed
@miguelg719 miguelg719 mentioned this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants