@kareemaly/researcher
Version:
CLI tool for web research
98 lines (73 loc) • 1.68 kB
Markdown
# Researcher CLI
A command-line tool for web research that uses SearchAPI.io to search the web and process results.
## Features
- Search the web with different search types (web, news)
- Location-based search
- Process and store search results
- Convert web content to Markdown
- List and view saved searches
- Clean up old searches
## Installation
1. Clone the repository
2. Install dependencies:
```bash
npm install
```
3. Build the project:
```bash
npm run build
```
4. Link the CLI:
```bash
npm link
```
## Configuration
Create a `.env` file in the project root with your SearchAPI.io credentials:
```env
SEARCH_API_KEY=your_api_key
SEARCH_API_ENDPOINT=https://api.searchapi.io/api/v1/search
```
## Usage
### Search
```bash
# Basic web search
researcher search "your query"
# News search
researcher search "your query" --type news
# Location-based search
researcher search "restaurants" --location "New York, United States"
# Limit results
researcher search "your query" --limit 10
```
### View Results
```bash
# List all searches
researcher list
# Show search details
researcher show <search-id>
# Show search details with processed content
researcher show <search-id> --content
```
### Clean Up
```bash
# Remove searches older than 30 days
researcher clean
# Remove searches older than N days
researcher clean --older-than 7
# Remove all searches
researcher clean --all
```
### Options
- `-o, --output <dir>` - Set output directory (default: "research")
- `-v, --verbose` - Enable verbose logging
## Development
```bash
# Run in development mode
npm run dev
# Run type checking
npm run validate
# Run linting
npm run lint
# Run tests
npm run test
```