Use the Browserbase CLI (`bb`) for Browserbase Functions and platform API workflows. Use when the user asks to run `bb`, deploy or invoke functions, manage sessions, projects, contexts, or extensions, fetch a page through the Browserbase Fetch API, search the web through the Browserbase Search API, or scaffold starter templates. Prefer the Browser skill for interactive browsing; use `bb browse` only when the user explicitly wants the Browserbase CLI path.
Use the official bb CLI for Browserbase platform operations, Functions workflows, and Fetch API calls.
Before using the CLI, verify it is installed:
which bb || npm install -g @browserbasehq/cli
bb --help
For authenticated commands, set the API key:
export BROWSERBASE_API_KEY="your_api_key"
If using bb functions dev or bb functions publish, also set:
export BROWSERBASE_PROJECT_ID="your_project_id"
Use this skill when the user wants to:
bbbb templatesbrowser skill.fetch skill is often a better fit.bb browse ... only when the user explicitly wants the CLI wrapper or is already working in a bb-centric workflow.bb functions for local dev, packaging, publishing, and invocationbb sessions, bb projects, bb contexts, bb extensions for Browserbase platform resourcesbb fetch <url> for Fetch API requestsbb search "<query>" for Search API requestsbb templates to browse and scaffold starter templatesbb browse ... to forward to the standalone browse binary (requires @browserbasehq/browse-cli)bb skills install to install Browserbase agent skills for Claude CodeFor bb browse, the standalone browse CLI behavior is the source of truth: bb browse env local uses a clean isolated local browser by default, and bb browse env local --auto-connect opts into reusing an existing local Chrome session.
bb functions init my-function
cd my-function
bb functions dev index.ts
bb functions publish index.ts
bb functions invoke <function_id> --params '{"url":"https://example.com"}'
Use bb functions invoke --check-status <invocation_id> to poll an existing invocation instead of creating a new one.
bb projects list
bb sessions create --proxies --advanced-stealth --region us-east-1
bb sessions create --solve-captchas --context-id ctx_abc --persist
bb sessions get <session_id>
bb sessions downloads get <session_id> --output session-artifacts.zip
bb contexts create --body '{"region":"us-west-2"}'
bb extensions upload ./my-extension.zip
bb fetch https://example.com
bb fetch https://example.com --allow-redirects --output page.html
bb search "browser automation"
bb search "web scraping" --num-results 5
bb search "AI agents" --output results.json
bb templates list
bb templates list --language python
bb templates clone form-filling --language typescript
bb templates clone amazon-product-scraping --language python ./my-scraper
bb --help and subgroup --help before guessing flags.--output <file> on bb fetch and bb search to save results to a file.--body or --params.bb functions ... uses --api-url, while platform API commands use --base-url.bb browse fails because browse is missing, either install @browserbasehq/browse-cli or switch to the browser skill.BROWSERBASE_API_KEY or pass --api-keybb functions dev or bb functions publish: set BROWSERBASE_PROJECT_ID or pass --project-id--help and use the exact dash-case formbb browse install error: run npm install -g @browserbasehq/browse-cliFor command-by-command reference and more examples, see REFERENCE.md.