feat(cli): add search filtering options and migrate search to SDK
Summary
Adds support for new Browserbase Search API parameters and migrates the search command to use the SDK.
SDK Migration
Migrates browse cloud search from raw HTTP to client.search.web().
New Search Flags
--include-domains/--exclude-domains— domain filtering with path prefixes and wildcards--start-published-date/--end-published-date— date range filtering (YYYY-MM-DD or RFC 3339)--category— content category filter (news, tweet, company, research_paper, pdf, github, movie, song, personal_site, linkedin_profile)--user-location— two-letter country code for location relevance--moderation— safety filter (safe/off)--objective— natural language objective (up to 4096 code points)--max-age-hours— recency filter--excerpts— return relevant passages (shown in both JSON and table output)
Provider Auto-Routing
When --provider is omitted, the API auto-routes to a provider that supports your params. Validation checks that apply to Parallel are only enforced when --provider parallel is explicit. For deep/deep-lite modes, the CLI automatically infers --provider exa.
Validation Improvements
- Domain lists: validates non-empty, trims whitespace, lowercases hostname (preserves path case), deduplicates, rejects schemes/ports/query strings
- Dates: strict YYYY-MM-DD or RFC 3339 format, validates actual date values, rejects start > end
- Query/objective: code point counting (not UTF-16), rejects empty/whitespace
- Mode/provider: validates valid combinations per provider
- Control character stripping in table output for security
Stack
- #3495 — SDK bump
- #3497 — Migrate contexts and extensions commands ← base
- This PR — Add search filtering options and migrate search to SDK
Files Changed
packages/cli/src/commands/cloud/search.ts— SDK migration + new flagspackages/cli/skills/browse/SKILL.md— updated docs with new paramspackages/cli/tests/cli-cloud-contract.test.ts— comprehensive tests.changeset/search-api-params.md— changeset


Summary by cubic
Adds the new Browserbase Search API parameters to browse cloud search with client-side validation before requests are sent, and migrates search, context, and extension cloud commands from raw HTTP calls to the Browserbase SDK. Exa now supports deep-lite and deep modes, responses include provider and mode fields, and --excerpts returns relevant passages in JSON and table output.
New Features
- New flags:
--include-domains/--exclude-domains(hostname, path prefix, or wildcard; hostname lowercased, path case preserved),--start-published-date/--end-published-date(strict ISO 8601),--category,--user-location,--moderation,--objective(max 4096 code points),--max-age-hours, and--excerpts. - Deep/deep-lite modes infer the exa provider; other modes require an explicit
--provider. - Bumps
@browserbasehq/sdkto ^2.28.0;search,contexts delete/update, andextensions deletenow use SDK client methods. - Successful SDK calls now record
requestHadHttpResponsetelemetry like the raw HTTP calls they replaced.
Validation
- Rejects invalid domain formats (scheme, port, query, fragment), empty domain lists, unsupported parallel country codes, parallel include/exclude conflicts, >200 domains, and parallel with exa-only flags like
--end-published-date. --moderationis rejected only with an explicit--provider parallel;--no-moderationremains allowed.