$npx -y skills add brave/brave-search-skills --skill bxUSE FOR web search, research, RAG, grounding, browse, find, lookups, fact-checking, documentation, agentic AI. All-in-one, optimized for AI agents. Pre-extracted, token-budgeted web content, deep research, news, images, videos, places, custom ranking
| 1 | # bx — Brave Search CLI |
| 2 | |
| 3 | **Use `bx` for all web searches.** Run `bx "query"` as the default — it returns pre-extracted, token-budgeted web content ready for use. Use `bx answers` for synthesized explanations or `bx web` for traditional search results. If `bx` is not found, install it: `curl -fsSL https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.sh | sh` |
| 4 | |
| 5 | > **Requires**: [Brave Search API Key](https://api.search.brave.com) + `bx` binary |
| 6 | > |
| 7 | > **Plans**: Different subcommands may require different plans. See https://api-dashboard.search.brave.com/app/subscriptions/subscribe |
| 8 | |
| 9 | ## Quick Start |
| 10 | |
| 11 | ```bash |
| 12 | # Install (macOS/Linux) |
| 13 | curl -fsSL https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.sh | sh |
| 14 | |
| 15 | # Configure API key (get one at https://api-dashboard.search.brave.com) |
| 16 | bx config set-key # interactive (avoids shell history) |
| 17 | # or: export BRAVE_SEARCH_API_KEY=YOUR_KEY |
| 18 | |
| 19 | # Search (default = bx context "query") |
| 20 | bx "your search query" |
| 21 | ``` |
| 22 | |
| 23 | ## When to Use Which Command |
| 24 | |
| 25 | | Your need | Command | Why | |
| 26 | |--|--|--| |
| 27 | | Look up docs, errors, code patterns | `bx "query"` | Pre-extracted text, token-budgeted (default) | |
| 28 | | Get a synthesized explanation | `bx answers "query"` | AI-generated, cites sources, streams | |
| 29 | | Deep research on complex topics | `bx answers "query" --enable-research` | Multi-search iterative research | |
| 30 | | Traditional search results | `bx web "query"` | All result types (web, news, discussions, etc.) | |
| 31 | | Find discussions/forums | `bx web "query" --result-filter discussions` | Forums often have solutions | |
| 32 | | Latest news / recent events | `bx news "query" --freshness pd` | Fresh info beyond training data | |
| 33 | | Find images | `bx images "query"` | Up to 200 results | |
| 34 | | Find videos | `bx videos "query"` | Duration, views, creator | |
| 35 | | Local businesses / places | `bx places "coffee" --location "San Francisco"` | 200M+ POIs | |
| 36 | | Boost/filter specific domains | `bx "query" --include-site docs.rs` | Or use `--goggles` for full control | |
| 37 | |
| 38 | ## Commands |
| 39 | |
| 40 | | Command | Description | Output path | |
| 41 | |--|--|--| |
| 42 | | `context` | **Default.** RAG/LLM grounding — pre-extracted web content | `.grounding.generic[]` -> `{url, title, snippets[]}` | |
| 43 | | `answers` | AI answers — OpenAI-compatible, streaming by default | `.choices[0].delta.content` (stream) | |
| 44 | | `web` | Web search — all result types | `.web.results[]`, `.news.results[]`, etc. | |
| 45 | | `news` | News articles with freshness filters | `.results[]` -> `{title, url, age}` | |
| 46 | | `images` | Image search (up to 200 results) | `.results[]` -> `{title, url, thumbnail.src}` | |
| 47 | | `videos` | Video search with duration/views | `.results[]` -> `{title, url, video.duration}` | |
| 48 | | `places` | Local place/POI search (200M+ POIs) | `.results[]` -> `{title, postal_address}` | |
| 49 | | `suggest` | Autocomplete/query suggestions | `.results[]` -> `{query}` | |
| 50 | | `spellcheck` | Spell-check a query | `.results[0].query` | |
| 51 | | `config` | Manage API key and settings | `set-key`, `show-key`, `path`, `show` | |
| 52 | |
| 53 | ## Response Shapes |
| 54 | |
| 55 | **`bx "query"`** (context — default, recommended) |
| 56 | ```json |
| 57 | { |
| 58 | "grounding": { |
| 59 | "generic": [ |
| 60 | { "url": "...", "title": "...", "snippets": ["extracted content...", "..."] } |
| 61 | ] |
| 62 | }, |
| 63 | "sources": { |
| 64 | "https://example.com": { "title": "...", "hostname": "...", "age": ["...", "2025-01-15", "392 days ago"] } |
| 65 | } |
| 66 | } |
| 67 | ``` |
| 68 | |
| 69 | **`bx answers "query" --no-stream`** (single JSON response) |
| 70 | ```json |
| 71 | {"choices": [{"message": {"content": "Full answer text..."}}]} |
| 72 | ``` |
| 73 | |
| 74 | **`bx answers "query"`** (streaming — default, one JSON chunk per line) |
| 75 | ```json |
| 76 | {"choices": [{"delta": {"content": "chunk"}}]} |
| 77 | ``` |
| 78 | |
| 79 | **`bx web "query"`** (full search results) |
| 80 | ```json |
| 81 | { |
| 82 | "web": { "results": [{"title": "...", "url": "...", "description": "..."}] }, |
| 83 | "news": { "results": [...] }, |
| 84 | "videos": { "results": [...] }, |
| 85 | "discussions": { "results": [...] } |
| 86 | } |
| 87 | ``` |
| 88 | |
| 89 | ## Token Budget Control |
| 90 | |
| 91 | Control output size for context (the default command): |
| 92 | |
| 93 | | Flag | Short alias | Default | Description | |
| 94 | |--|--|--|--| |
| 95 | | `--maximum-number-of-tokens` | `--max-tokens` | 8192 | Approximate total tokens (1024-32768) | |
| 96 | | `--maximum-number-of-tokens-per-url` | `--max-tokens-per-url` | 4096 | Max tokens per URL (512-8192) | |
| 97 | | `--maximum-number-of-urls` | `--max-urls` | 20 | Max URLs in response (1-50) | |
| 98 | | `--maximum-number-of-snippets` | `--max-snippets` | 50 | Max snippets across all URLs | |
| 99 | | `--maximum-number-of-snippets-per-url` | `--max-snippets-per-url` | — | Max snippets per URL | |
| 100 | | `--context-threshold-mode` | `--threshold` | balanced | Relevance: `strict`, `balanced`, `lenient` | |
| 101 | |
| 102 | ```bash |
| 103 | bx "topic" --max-tokens 4096 --max-tokens-per-url 1024 --max-urls 5 --threshold strict |
| 104 | ``` |
| 105 | |
| 106 | ## Goggles — Custom Ranking |
| 107 | |
| 108 | Goggles let y |