https://github.com/thesurlydev/brave-cli
Brave search CLI
https://github.com/thesurlydev/brave-cli
Last synced: 4 months ago
JSON representation
Brave search CLI
- Host: GitHub
- URL: https://github.com/thesurlydev/brave-cli
- Owner: thesurlydev
- License: mit
- Created: 2025-03-16T19:51:51.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-08T02:54:01.000Z (about 1 year ago)
- Last Synced: 2025-10-06T13:50:37.692Z (8 months ago)
- Language: Rust
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# brave-cli
A command-line interface for the Brave Search API that retrieves search results and outputs them as JSON.
## Features
- Search the web using Brave Search API
- Output results in clean JSON format
- Handle gzip-compressed API responses
- Configurable number of results
## Installation
Make sure you have Rust and Cargo installed. Then build the project:
```bash
cargo build --release
```
The executable will be available at `target/release/brave-cli`.
## Usage
First, set your Brave Search API key as an environment variable:
```bash
export BRAVE_API_KEY=your_api_key_here
```
Then run a search:
```bash
brave-cli -q "your search query"
```
### Options
- `-q, --query `: Search query (required)
- `-c, --count `: Number of results to return (default: 10)
## Output Format
The output is a JSON object with a `results` array containing search results:
```json
{
"results": [
{
"title": "Result title",
"url": "https://example.com/result",
"description": "Description of the result"
},
...
]
}
```
## Getting a Brave Search API Key
To use this tool, you need a Brave Search API key. You can get one by:
1. Visiting the [Brave Search API](https://brave.com/search/api/) page
2. Creating an account or signing in
3. Following the instructions to obtain an API key
## License
This project is open source and available under the MIT License.