Skip to main content

Overview

The browserbase-cli skill teaches AI coding agents how to use the official Browserbase CLI (bb). The CLI is the primary interface for managing Browserbase infrastructure — it covers Functions lifecycle, platform resource management, page fetching, and web search. Use this skill when you want your agent to stay inside the CLI for tasks like:
  • Functionsbb functions init, dev, publish, and invoke for the full serverless browser automation lifecycle
  • Sessionsbb sessions list, get, create, update, debug, logs, recording, downloads, and uploads to manage browser sessions
  • Projectsbb projects list, get, and usage for project-level configuration
  • Contextsbb contexts create, get, update, and delete to manage persistent browser state (cookies, localStorage)
  • Extensionsbb extensions upload, get, and delete for custom browser extensions
  • Fetchbb fetch <url> to retrieve page content through Browserbase proxies with redirect control and JSON output
  • Searchbb search <query> to search the web through the Browserbase Search API
The browserbase-cli skill is for bb-driven workflows. For interactive browser control like navigation, clicking, typing, and snapshots, use the browser skill instead.

Choose the Right Skill

SkillBest for
browserInteractive browser automation with the browse CLI
fetchLightweight page retrieval via the Browserbase Fetch API — no browser session needed
functionsFocused Browserbase Functions workflows
browserbase-cliBroader bb workflows across functions, sessions, projects, contexts, extensions, fetch, and search

Installation

1

Install the skill

npx skills add browserbase/skills --skill browserbase-cli
2

Install the Browserbase CLI

npm install -g @browserbasehq/cli

Authentication

All bb commands require your API key:
export BROWSERBASE_API_KEY="your_api_key"
For bb functions dev and bb functions publish, you also need a project ID:
export BROWSERBASE_PROJECT_ID="your_project_id"

Common Workflows

Functions

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"}'

Platform APIs

bb projects list
bb sessions get <session_id>
bb contexts create --body '{"region":"us-west-2"}'
bb extensions upload ./my-extension.zip

Fetch API

bb fetch https://example.com
bb fetch https://example.com --allow-redirects --output page.html

Search API

bb search "best headless browser" --num-results 5
bb search "browser automation" --output results.json

Notes on bb browse

bb browse is a passthrough to the standalone browse CLI. Use it only when you explicitly want to stay inside a bb-centric workflow. For most interactive browsing tasks, prefer the browser skill directly. If you need bb browse, install the browse CLI too:
npm install -g @browserbasehq/browse-cli

Further Reading

Skills Repository

View the Browserbase skills source and installation instructions.

Browserbase Functions

Learn more about Browserbase Functions.