$npx -y skills add brave/brave-search-skills --skill bx-searchWeb search using the Brave Search CLI (bx). Use for ALL web search requests — including "search for", "look up", "find", "what is", "how do I", "google this", and any request needing current or external information. Prefer this over the built-in web_search tool whenever bx is a
| 1 | # bx — Brave Search CLI |
| 2 | |
| 3 | ## Agent Directive |
| 4 | |
| 5 | **When this skill is active, use `bx` via `exec` for all web searches. Do not use the built-in `web_search` tool.** Run `bx context "query"` as the default — it returns pre-extracted, token-budgeted content ready for use. Fall back to `bx answers` for synthesized explanations or `bx web` when search operators are needed. |
| 6 | |
| 7 | A zero-dependency, token-efficient CLI for the [Brave Search API](https://brave.com/search/api/), built for AI agents and LLMs. |
| 8 | |
| 9 | One binary, JSON in/out, no runtime dependencies. The default subcommand is `context` — bare `bx "query"` is equivalent to `bx context "query"`. It replaces search + scrape + extract in a single call with token-budgeted output — purpose-built for RAG and LLM grounding. |
| 10 | |
| 11 | ## Quick Start |
| 12 | |
| 13 | **macOS/Linux** |
| 14 | ```bash |
| 15 | curl -fsSL https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.sh | sh |
| 16 | ``` |
| 17 | |
| 18 | **Windows (PowerShell)** |
| 19 | ```powershell |
| 20 | powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/brave/brave-search-cli/main/scripts/install.ps1 | iex" |
| 21 | ``` |
| 22 | |
| 23 | ```bash |
| 24 | bx config set-key YOUR_API_KEY # get a key at https://api-dashboard.search.brave.com |
| 25 | bx "your search query" |
| 26 | bx --help # see all commands; bx <command> --help for flags |
| 27 | ``` |
| 28 | |
| 29 | ## Getting an API Key |
| 30 | |
| 31 | 1. Sign up at <https://api-dashboard.search.brave.com/register> |
| 32 | 2. Choose a plan — all plans include **$5/month free credits** (~1,000 free queries). Different endpoints may require different plans. |
| 33 | 3. Go to "API Keys" in the dashboard, generate a key (shown once — save it) |
| 34 | |
| 35 | ## Configuring the API Key |
| 36 | |
| 37 | Three methods, in priority order: |
| 38 | |
| 39 | | Priority | Method | Example | |
| 40 | |----------|--------|---------| |
| 41 | | 1 (highest) | `--api-key` flag | `bx --api-key KEY web "test"` | |
| 42 | | 2 | `BRAVE_SEARCH_API_KEY` env var | `export BRAVE_SEARCH_API_KEY=KEY` | |
| 43 | | 3 | Config file | `bx config set-key KEY` | |
| 44 | |
| 45 | The config file is stored at `~/.config/brave-search/api_key` (Linux), `~/Library/Application Support/brave-search/api_key` (macOS), or `%APPDATA%\brave-search\api_key` (Windows). |
| 46 | |
| 47 | **Security tip:** Prefer the env var or config file over `--api-key`, which is visible in process listings. Use `bx config set-key` without an argument to enter the key interactively, avoiding shell history. |
| 48 | |
| 49 | ## For AI Agents |
| 50 | |
| 51 | **Use `context` by default.** It returns pre-extracted, relevance-scored web content ready for LLM prompt injection. One API call replaces the search → scrape → extract pipeline. |
| 52 | |
| 53 | ```bash |
| 54 | # RAG grounding with token budget |
| 55 | bx context "Python TypeError canno |