Skip to content

regismesquita/search-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Search CLI

A command-line interface for searching using Serper and Tavily APIs.

Features

  • Search using Google (via Serper API)
  • Search and extract content using Tavily API
  • JSON output support
  • Configurable search depth (for Tavily)

Installation

Using Go Install

go install github.com/regismesquita/search-cli/cmd/search@latest

Using mise (formerly rtx)

mise use go:github.com/regismesquita/search-cli/cmd/search@latest

From Source

# 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)

Configuration

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

Usage

Basic Search (using Serper)

# Default search using Serper
search "your query"
# or explicitly
search -s "your query"

Using Tavily

# Basic search
search -t "your query"

# Advanced search
search -t -depth advanced "your query"

# Extract content from URLs
search -t -e "https://example.com"

JSON Output

search -json "your query"
search -t -json "your query"
search -t -e -json "https://example.com"

Options

  • -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)

Development

# Run tests
make test

# Run tests with coverage
make test-coverage

# Run linter
make lint

# Clean build artifacts
make clean

Project Structure

.
├── cmd/
│   └── search/        # Main application
│       └── main.go
├── internal/
│   ├── adapters/      # API providers
│   │   ├── serper.go
│   │   ├── tavily.go
│   │   └── types.go
│   └── formatter/     # Output formatting
│       └── formatter.go
├── go.mod
└── Makefile

License

MIT

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -am 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

Tool for searching the web on the CLI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published