perplexity-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePerplexity CLI Skill
Perplexity CLI 技能
Overview
概述
Perplexity CLI is a command-line interface for Perplexity AI that allows AI-powered searches directly from the terminal with support for multiple models, streaming output, and file attachments.
Perplexity CLI是Perplexity AI的命令行界面,允许直接在终端中进行AI驱动的搜索,支持多模型、流式输出和文件附件。
Prerequisites
前提条件
bash
undefinedbash
undefinedVerify installation
验证安装
perplexity --help
undefinedperplexity --help
undefinedQuick Reference
快速参考
| Command | Description |
|---|---|
| Search with default settings |
| Mode | Flag | Description |
|---|---|---|
| pro | | Deep search with reasoning (default) |
| deep-research | | Comprehensive research |
| 命令 | 描述 |
|---|---|
| 使用默认设置进行搜索 |
| 模式 | 参数 | 描述 |
|---|---|---|
| pro | | 带推理的深度搜索(默认) |
| deep-research | | 全面研究 |
Common Operations
常见操作
Basic Query
基础查询
bash
perplexity "What is quantum computing?"bash
perplexity "What is quantum computing?"Query with Specific Mode
使用特定模式查询
bash
perplexity "Explain neural networks" --mode probash
perplexity "Explain neural networks" --mode proRead Query from File, Save Response
从文件读取查询,保存响应
bash
perplexity -f question.md -o answer.md bash
perplexity -f question.md -o answer.md Query with Sources
带来源的查询
bash
perplexity "Climate research" --sources web,scholar bash
perplexity "Climate research" --sources web,scholar All Flags
所有参数
| Flag | Short | Description |
|---|---|---|
| Search mode | |
| | Sources: web,scholar,social |
| | Response language (e.g., en-US, pt-BR) |
| | Read query from file |
| | Save response to file |
| 参数 | 简写 | 描述 |
|---|---|---|
| 搜索模式 | |
| | 来源:web、scholar、social |
| | 响应语言(例如:en-US、pt-BR) |
| | 从文件读取查询 |
| | 将响应保存到文件 |
Best Practices
最佳实践
- Use for comprehensive research tasks
--mode deep-research - Use and
-fflags for batch processing-o
- 对于全面研究任务,使用
--mode deep-research - 使用和
-f参数进行批量处理-o
Piping and Scripting
管道与脚本使用
bash
undefinedbash
undefinedPipe query from stdin
从标准输入传递查询
echo "What is Go?" | perplexity
echo "What is Go?" | perplexity
Use in scripts
在脚本中使用
RESPONSE=$(perplexity "Quick answer" --mode pro 2>/dev/null)
RESPONSE=$(perplexity "Quick answer" --mode pro 2>/dev/null)
Batch processing
批量处理
cat questions.txt | while read q; do
perplexity "$q" -o "answers/$(echo $q | md5sum | cut -c1-8).md"
done
undefinedcat questions.txt | while read q; do
perplexity "$q" -o "answers/$(echo $q | md5sum | cut -c1-8).md"
done
undefined