---
slug: "pi-skill-tavily"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/A-Legg/pi-skill-tavily@main/README.md"
repo: "https://github.com/A-Legg/pi-skill-tavily"
source_file: "README.md"
branch: "main"
---
# pi-skill-tavily

Tavily web search, extract, crawl, and research skills for the [pi coding agent](https://github.com/badlogic/pi-coding-agent).

Powered by [Tavily](https://tavily.com) — an LLM-optimized search API.

## Installation

```bash
npm install pi-skill-tavily
```

Or add to your project's `package.json`:
```json
{
  "devDependencies": {
    "pi-skill-tavily": "^1.0.0"
  }
}
```

## Setup

Get an API key at [https://tavily.com](https://tavily.com) and configure it:

**Option 1: Environment variable**
```bash
export TAVILY_API_KEY="tvly-your-api-key-here"
```

**Option 2: Pi settings** (`~/.pi/settings.json`)
```json
{
  "env": {
    "TAVILY_API_KEY": "tvly-your-api-key-here"
  }
}
```

## Available Skills

| Skill | Command | Description |
|-------|---------|-------------|
| **Search** | `/skill:tavily-search` | Web search with relevance scores, domain filtering, time ranges |
| **Extract** | `/skill:tavily-extract` | Extract clean markdown/text from specific URLs |
| **Crawl** | `/skill:tavily-crawl` | Crawl websites, save pages as local markdown files |
| **Research** | `/skill:tavily-research` | Comprehensive multi-source research with citations |
| **Best Practices** | `/skill:tavily-best-practices` | Reference docs for building Tavily integrations |

## Usage Examples

### Search
```bash
# The agent will automatically use the skill, or invoke directly:
/skill:tavily-search AI news this week

# Script usage:
./skills/tavily-search/scripts/search.sh '{"query": "AI news", "time_range": "week"}'
```

### Extract
```bash
/skill:tavily-extract https://docs.python.org/3/tutorial/classes.html

# Script usage:
./skills/tavily-extract/scripts/extract.sh '{"urls": ["https://example.com"]}'
```

### Crawl
```bash
/skill:tavily-crawl download docs from https://docs.example.com

# Script usage:
./skills/tavily-crawl/scripts/crawl.sh '{"url": "https://docs.example.com", "max_depth": 2}' ./docs
```

### Research
```bash
/skill:tavily-research Compare React vs Vue for enterprise apps in 2025

# Script usage:
./skills/tavily-research/scripts/research.sh '{"input": "React vs Vue comparison", "model": "pro"}' report.md
```

## Requirements

- `curl` (pre-installed on macOS/Linux)
- `jq` — install with `brew install jq` (macOS) or `apt-get install jq` (Linux)
- A [Tavily API key](https://tavily.com)

## License

MIT
