Executes Perplexity AI queries via Python CLI. Use when conducting web research, asking questions with citations, deep research tasks, reasoning problems, or searching for up-to-date information.
Dictum: Specialized models optimize response quality.
Execute Perplexity AI queries via Python CLI. API key auto-injected via 1Password.
[IMPORTANT] Sonar family models (Feb 2026): sonar (lightweight search), sonar-pro (deeper retrieval, 2x more results), sonar-reasoning (real-time reasoning), sonar-reasoning-pro (DeepSeek-R1, visible reasoning), sonar-deep-research (long-form reports). Citation tokens no longer billed for sonar/sonar-pro.
| [CMD] | [ARGS] | [MODEL] |
|---|---|---|
| ask | <query> |
sonar |
| pro | <query> |
sonar-pro |
| research | <query> [strip] |
sonar-deep-research |
| reason | <query> [strip] |
sonar-reasoning-pro |
| search | <query> [max] [country] |
sonar |
# Quick question with citations (lightweight)
uv run .claude/skills/perplexity-tools/scripts/perplexity.py ask "What is Effect-TS?"
# Pro question with deeper retrieval
uv run .claude/skills/perplexity-tools/scripts/perplexity.py pro "Compare Vite 7 vs Turbopack bundling strategies"
# Deep research (10min timeout)
uv run .claude/skills/perplexity-tools/scripts/perplexity.py research "React 19 new features"
# Deep research, strip thinking tags
uv run .claude/skills/perplexity-tools/scripts/perplexity.py research "Vite 7 migration" strip
# Reasoning task
uv run .claude/skills/perplexity-tools/scripts/perplexity.py reason "Compare Effect vs RxJS"
# Web search with max results
uv run .claude/skills/perplexity-tools/scripts/perplexity.py search "Nx 22 features" 5
ask: <query>
query โ Question to ask (required)sonar (fast, lightweight search)pro: <query>
query โ Question requiring deeper retrieval (required)sonar-pro (enhanced search, 2x results)research: <query> [strip]
query โ Research topic (required)strip โ Pass strip to remove <think> tags from responsesonar-deep-research (long-form, source-dense reports)reason: <query> [strip]
query โ Reasoning problem (required)strip โ Pass strip to remove <think> tags from responsesonar-reasoning-pro (DeepSeek-R1, visible chain-of-thought)search: <query> [max] [country]
query โ Search query (required)max โ Max results (default: 10)country โ Country code to focus results (e.g., US, GB)Commands return: {"status": "success|error", ...}.
| [INDEX] | [CMD] | [RESPONSE] |
|---|---|---|
| [1] | ask |
{query, response, citations[]} |
| [2] | pro |
{query, response, citations[]} |
| [3] | research |
{query, response, citations[]} |
| [4] | reason |
{query, response} |
| [5] | search |
{query, results[]} |
| [VAR] | [REQUIRED] | [DESCRIPTION] |
|---|---|---|
PERPLEXITY_API_KEY |
Yes | Perplexity API key (1Password injected) |
[ERROR] <status>: <body> and exit 1research command uses 10-minute timeout; long-running queries may time outreason output includes <think> tags by default; pass strip to remove