A command-line interface for searching using Serper and Tavily APIs.
- Search using Google (via Serper API)
- Search and extract content using Tavily API
- JSON output support
- Configurable search depth (for Tavily)
go install github.com/regismesquita/search-cli/cmd/search@latest
mise use go:github.com/regismesquita/search-cli/cmd/search@latest
# Clone the repository
git clone https://github.com/regismesquita/search-cli
cd search-cli
# Build and install
make build
make install # Installs to ~/go/bin
# or
make local-install # Installs to /usr/local/bin (requires sudo)
Set your API keys as environment variables:
# For Serper
export SERPER_API_KEY=your_key_here
# For Tavily
export TAVILY_API_KEY=your_key_here
# Default search using Serper
search "your query"
# or explicitly
search -s "your query"
# Basic search
search -t "your query"
# Advanced search
search -t -depth advanced "your query"
# Extract content from URLs
search -t -e "https://example.com"
search -json "your query"
search -t -json "your query"
search -t -e -json "https://example.com"
-s
: Use Serper (default)-t
: Use Tavily-e
: Extract content (Tavily only)-json
: Output in JSON format-depth
: Search depth for Tavily (basic or advanced)
# Run tests
make test
# Run tests with coverage
make test-coverage
# Run linter
make lint
# Clean build artifacts
make clean
.
├── cmd/
│ └── search/ # Main application
│ └── main.go
├── internal/
│ ├── adapters/ # API providers
│ │ ├── serper.go
│ │ ├── tavily.go
│ │ └── types.go
│ └── formatter/ # Output formatting
│ └── formatter.go
├── go.mod
└── Makefile
MIT
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -am 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request