← 返回命令列表

Linux command

perplexity 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Ask a question

perplexity "What is quantum computing?"

Ask with a specific model

perplexity -m [sonar-pro] "[question]"

Display citations

perplexity -c "[question]"

Show token usage

perplexity -u "[question]"

Search across notes and chats

perplexity rag "[query]"

Set up API key

perplexity setup

说明

perplexity is a command-line interface for Perplexity AI, enabling terminal-based access to their AI-powered search and question-answering capabilities. It leverages Perplexity's Sonar models which combine large language models with real-time web search. The CLI supports multiple models ranging from sonar (fastest) to sonar-reasoning-pro (most capable with deep reasoning). Answers can include citations showing the sources used to generate responses. Advanced features include RAG (Retrieval Augmented Generation) for searching across local notes and chat history using semantic vector search or keyword matching. The knowledge base uses BGE embeddings for lightning-fast semantic search. Chat history and notes are stored locally, enabling export to markdown, JSON, or Excel formats. The tool works offline for local operations while requiring internet connectivity for AI queries.

参数

-m, --model _model_
Select language model: sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro.
-c, --citations
Display source citations with the answer.
-u, --usage
Show token consumption metrics.
-v, --verbose
Enable debug mode with detailed output.
-g, --glow
Apply Glow-compatible markdown formatting.
-a, --api-key _key_
Provide API key directly instead of environment variable.

FAQ

What is the perplexity command used for?

perplexity is a command-line interface for Perplexity AI, enabling terminal-based access to their AI-powered search and question-answering capabilities. It leverages Perplexity's Sonar models which combine large language models with real-time web search. The CLI supports multiple models ranging from sonar (fastest) to sonar-reasoning-pro (most capable with deep reasoning). Answers can include citations showing the sources used to generate responses. Advanced features include RAG (Retrieval Augmented Generation) for searching across local notes and chat history using semantic vector search or keyword matching. The knowledge base uses BGE embeddings for lightning-fast semantic search. Chat history and notes are stored locally, enabling export to markdown, JSON, or Excel formats. The tool works offline for local operations while requiring internet connectivity for AI queries.

How do I run a basic perplexity example?

Run `perplexity "What is quantum computing?"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -m, --model _model_ do in perplexity?

Select language model: sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro.