> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Perplexity CLI

> Command-line interface for Perplexity web search

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    U[Input] --> A[Agent]
    A --> O[Output]

    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff

    class A agent
    class U,O tool
```

# Perplexity Search CLI

Use Perplexity real-time web search from the command line.

## Prerequisites

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Install the package
npm install @perplexity-ai/ai-sdk

# Set your API key
export PERPLEXITY_API_KEY=your-perplexity-api-key
```

## Commands

### List Tools

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts tools list --tag search
```

### Tool Information

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts tools info perplexity
```

### Health Check

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts tools doctor
```

### Test Tool

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Dry run
praisonai-ts tools test perplexity

# Live test
praisonai-ts tools test perplexity --live
```

## Search Examples

### Basic Search

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts agent run \
  --tools perplexity \
  --prompt "What are the latest AI developments?"
```

### Recent News

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts agent run \
  --tools "perplexity:recency=day" \
  --prompt "What happened in tech today?"
```

### Domain-Filtered Search

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts agent run \
  --tools "perplexity:searchDomainFilter=arxiv.org" \
  --prompt "Find recent papers on transformer architectures"
```

### Language-Specific Search

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts agent run \
  --tools "perplexity:language=en" \
  --prompt "Search for AI news in English"
```

## Tool Options

| Option               | Type      | Default | Description             |
| -------------------- | --------- | ------- | ----------------------- |
| `recency`            | string    | -       | day, week, month, year  |
| `language`           | string    | -       | ISO 639-1 language code |
| `searchDomainFilter` | string\[] | -       | Domains to search       |
| `numResults`         | number    | `10`    | Number of results       |

## Advanced Examples

### News Analysis

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts agent run \
  --instructions "You are a news analyst" \
  --tools "perplexity:recency=day,numResults=5" \
  --prompt "Analyze today's top tech stories"
```

### Academic Research

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts agent run \
  --instructions "You are a research assistant" \
  --tools "perplexity:searchDomainFilter=arxiv.org|nature.com" \
  --prompt "Find recent research on quantum computing"
```

## JSON Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts agent run \
  --tools perplexity \
  --prompt "AI news" \
  --json
```

## Combining Tools

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts agent run \
  --tools "perplexity,exa" \
  --prompt "Compare search results about GPT-5 from multiple sources"
```

## Environment Variables

| Variable             | Required | Description        |
| -------------------- | -------- | ------------------ |
| `PERPLEXITY_API_KEY` | Yes      | Perplexity API key |
| `OPENAI_API_KEY`     | Yes      | OpenAI API key     |

## Related Commands

* `praisonai-ts tools list` - List all tools
* `praisonai-ts tools doctor` - Check tool health
