perplexity
Use Perplexity API for web-grounded AI search. Use when user needs up-to-date information with source citations, factual queries about current events, or research-style answers. Default when user mentions Perplexity or needs current information with references.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- perplexity
- description
- Use Perplexity API for web-grounded AI search. Use when user needs up-to-date information with source citations, factual queries about current events, or research-style answers. Default when user mentions Perplexity or needs current information with references.
03 SKILL.md 正文
Perplexity AI Search (Safe Edition)
Overview
This skill provides access to the Perplexity API for web-grounded AI search. It combines large language models with real-time web search, providing accurate, up-to-date answers with source citations.
This is a security-hardened version that fixes command injection vulnerabilities found in the original perplexity-bash skill.
When to Use Perplexity vs. Built-in Search
Use Perplexity when:
- You need current information (news, prices, events, recent developments)
- The user asks for source citations or references
- The user specifically mentions Perplexity or wants research-style answers
Use built-in web search when:
- Simple factual queries
- Quick information lookup
- Basic URL or content retrieval
Model Selection Guide
| Model | Use Case | Cost |
|---|---|---|
sonar |
Default search, most queries | Low |
sonar-pro |
Advanced search, deeper understanding | Medium |
sonar-reasoning |
Complex multi-step reasoning | Medium |
sonar-reasoning-pro |
Advanced reasoning with deep content | High |
Quick Start
Basic Search
# Simple query (uses sonar by default)
scripts/perplexity_search.sh "What is the capital of Germany?"
# With a different model
scripts/perplexity_search.sh -m sonar-pro "Latest AI developments"
# Markdown format with citations
scripts/perplexity_search.sh -f markdown "Tesla stock analysis"
Advanced Usage
# High context for comprehensive results
scripts/perplexity_search.sh -m sonar-reasoning -c high -f markdown \
"Compare AI models performance benchmarks"
# With custom system prompt
scripts/perplexity_search.sh -s "You are a technology analyst." \
"Analyze current tech trends"
Options
| Flag | Description | Default |
|---|---|---|
-m, --model |
Model to use | sonar |
-t, --max-tokens |
Maximum tokens (1-4096) | 4096 |
--temperature |
Sampling temperature (0.0-1.0) | 0.0 |
-c, --context |
Search context: low/medium/high | medium |
-s, --system |
System prompt | (none) |
-f, --format |
Output: text/markdown/json | text |
--list-models |
List available models |
Search Context Size
- low - Faster, fewer sources. Good for simple queries.
- medium (default) - Balanced for most use cases.
- high - Most comprehensive. Best for research.
Setup Requirements
API Key Configuration
Option 1: Config file (recommended)
Create config.json in the skill directory:
{
"apiKey": "pplx-your-key-here"
}
Option 2: Environment variable
export PERPLEXITY_API_KEY="your-key-here"
Priority: Config file > environment variable.
Dependencies
bash(4.0+)curlpython3(for JSON construction only - no user input is eval'd)
Security Notes
This version addresses the following vulnerabilities found in the original:
- No command injection - User input is passed to Python via environment variables, never interpolated into code strings
- Input validation - All parameters are validated (numeric ranges, allowed model names, allowed context values)
- API key protection - The Authorization header is passed to curl via a temporary config file (
curl -K, mode 600) and the request body via stdin (--data @-), so neither the API key nor the body appear in process listings (ps aux) - Query length limit - Queries are capped at 8000 characters to prevent denial-of-wallet attacks
- Strict model allowlist - Only known valid models are accepted
Cost Awareness
Perplexity API is not free. Be mindful of usage:
- Simple queries: ~$0.005-$0.015 per query
- Deep research: ~$0.015-$0.03+ per query
- Default to
sonarfor most queries to keep costs low.
Troubleshooting
- Error: No API key found - Set up API key as described above
- Error: curl not found - Install curl for your system
- Error: Invalid model - Use
--list-modelsto see available models
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.