browserbase-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBrowserbase CLI
Browserbase CLI
Use the official CLI for Browserbase platform operations, Functions workflows, and Fetch API calls.
browse使用官方的 CLI来执行Browserbase平台操作、Functions工作流以及Fetch API调用。
browseSetup check
安装检查
Before using the CLI, verify it is installed:
bash
which browse || npm install -g browse
browse --helpFor authenticated commands, set the API key:
bash
export BROWSERBASE_API_KEY="your_api_key"使用CLI之前,请确认已安装:
bash
which browse || npm install -g browse
browse --help对于需要认证的命令,请设置API密钥:
bash
export BROWSERBASE_API_KEY="your_api_key"When to use this skill
何时使用此技能
Use this skill when the user wants to:
- run Browserbase commands through
browse - scaffold, develop, publish, or invoke Browserbase Functions
- inspect or manage Browserbase sessions, projects, contexts, or extensions
- fetch a page through Browserbase without opening a browser session
- search the web through Browserbase without opening a browser session
- browse or scaffold starter templates with
browse templates
当用户需要以下操作时使用此技能:
- 通过运行Browserbase命令
browse - 搭建、开发、发布或调用Browserbase Functions
- 查看或管理Browserbase会话、项目、上下文或扩展
- 无需打开浏览器会话即可通过Browserbase获取页面
- 无需打开浏览器会话即可通过Browserbase搜索网页
- 使用浏览或搭建起始模板
browse templates
When not to use this skill
何时不使用此技能
- For interactive browsing, page inspection, screenshots, clicking, typing, or login flows, prefer the skill.
browser - For simple HTTP content retrieval where the user does not care about using the CLI specifically, the dedicated skill is often a better fit.
fetch - Use the top-level driver commands (,
browse open,browse get, …) only when the user explicitly wants the CLI path or is already working in abrowse click-centric workflow.browse
- 对于交互式浏览、页面检查、截图、点击、输入或登录流程,优先使用技能。
browser - 对于不关心是否使用CLI的简单HTTP内容获取,专用的技能通常是更好的选择。
fetch - 仅当用户明确想要使用CLI路径或已经在以为中心的工作流中时,才使用顶级驱动命令(
browse、browse open、browse get等)。browse click
Command selection
命令选择
- for local dev, packaging, publishing, and invocation
browse functions - ,
browse cloud sessions,browse cloud projects,browse cloud contextsfor Browserbase platform resourcesbrowse cloud extensions - for Fetch API requests
browse cloud fetch <url> - for Search API requests
browse cloud search "<query>" - to browse and scaffold starter templates
browse templates - ,
browse open,browse get, etc. for direct local/remote browser drivingbrowse click - to install Browserbase agent skills for Claude Code
browse skills install
For local browser work, starts a clean isolated browser. Use only when you need to attach to an existing debuggable Chrome session.
browse open <url> --localbrowse open <url> --auto-connect- 用于本地开发、打包、发布和调用
browse functions - 、
browse cloud sessions、browse cloud projects、browse cloud contexts用于Browserbase平台资源管理browse cloud extensions - 用于发起Fetch API请求
browse cloud fetch <url> - 用于发起Search API请求
browse cloud search "<query>" - 用于浏览和搭建起始模板
browse templates - 、
browse open、browse get等用于直接驱动本地/远程浏览器browse click - 用于为Claude Code安装Browserbase agent技能
browse skills install
对于本地浏览器操作,会启动一个干净的隔离浏览器。仅当需要连接到现有的可调试Chrome会话时,才使用。
browse open <url> --localbrowse open <url> --auto-connectCommon workflows
常见工作流
Functions
Functions
bash
browse functions init my-function
cd my-function
browse functions dev index.ts
browse functions publish index.ts
browse functions invoke <function_id> --params '{"url":"https://example.com"}'Use to poll an existing invocation instead of creating a new one.
browse functions invoke --check-status <invocation_id>bash
browse functions init my-function
cd my-function
browse functions dev index.ts
browse functions publish index.ts
browse functions invoke <function_id> --params '{"url":"https://example.com"}'使用来轮询现有调用,而不是创建新的调用。
browse functions invoke --check-status <invocation_id>Platform APIs
平台APIs
bash
browse cloud projects list
browse cloud sessions create --proxies --verified --region us-east-1
browse cloud sessions create --solve-captchas --context-id ctx_abc --persist
browse cloud sessions get <session_id>
browse cloud sessions downloads get <session_id> --output session-artifacts.zip
browse cloud contexts create --body '{"region":"us-west-2"}'
browse cloud extensions upload ./my-extension.zipbash
browse cloud projects list
browse cloud sessions create --proxies --verified --region us-east-1
browse cloud sessions create --solve-captchas --context-id ctx_abc --persist
browse cloud sessions get <session_id>
browse cloud sessions downloads get <session_id> --output session-artifacts.zip
browse cloud contexts create --body '{"region":"us-west-2"}'
browse cloud extensions upload ./my-extension.zipFetch API
Fetch API
bash
browse cloud fetch https://example.com
browse cloud fetch https://example.com --allow-redirects --output page.htmlbash
browse cloud fetch https://example.com
browse cloud fetch https://example.com --allow-redirects --output page.htmlSearch API
Search API
bash
browse cloud search "browser automation"
browse cloud search "web scraping" --num-results 5
browse cloud search "AI agents" --output results.jsonbash
browse cloud search "browser automation"
browse cloud search "web scraping" --num-results 5
browse cloud search "AI agents" --output results.jsonTemplates
模板
bash
browse templates list
browse templates list --tag Python --source Browserbase
browse templates clone form-filling --language typescript
browse templates clone amazon-product-scraping --language python ./my-scraperbash
browse templates list
browse templates list --tag Python --source Browserbase
browse templates clone form-filling --language typescript
browse templates clone amazon-product-scraping --language python ./my-scraperBest practices
最佳实践
- Prefer and subgroup
browse --helpbefore guessing flags.--help - Use dash-case flags exactly as shown in CLI help.
- Use on
--output <file>andbrowse cloud fetchto save results to a file.browse cloud search - Use environment variables for auth unless the user explicitly wants one-off overrides.
- Pass structured request bodies with JSON strings in or
--body.--params - Remember that both and
browse functions ...usebrowse cloud ...for API base URL overrides.--base-url
- 在猜测参数之前,优先使用和子命令的
browse --help。--help - 严格按照CLI帮助中显示的短横线格式(dash-case)使用参数。
- 在和
browse cloud fetch中使用browse cloud search将结果保存到文件。--output <file> - 除非用户明确想要一次性覆盖,否则使用环境变量进行认证。
- 在或
--body中通过JSON字符串传递结构化请求体。--params - 记住和
browse functions ...都可以使用browse cloud ...来覆盖API基础URL。--base-url
Troubleshooting
故障排除
- Missing API key: set or pass
BROWSERBASE_API_KEY--api-key - Unknown flag: rerun the relevant command with and use the exact dash-case form
--help - Command not found: re-run and verify with
npm install -g browsewhich browse
For command-by-command reference and more examples, see REFERENCE.md.
- 缺少API密钥:设置或传递
BROWSERBASE_API_KEY参数--api-key - 未知参数:重新运行相关命令并添加,使用正确的短横线格式参数
--help - 命令未找到:重新运行并通过
npm install -g browse确认安装which browse
如需逐命令参考和更多示例,请查看REFERENCE.md。