web
Web Command¶
The web
command performs intelligent web research using Perplexity AI, providing curated, up-to-date information from across the internet without requiring you to leave the terminal.
Syntax¶
Arguments¶
Argument | Description | Required | Example |
---|---|---|---|
QUERY |
The search query to research | Yes | "How to implement JWT authentication in Express" |
Options¶
Option | Description | Default | Example |
---|---|---|---|
--model |
The Perplexity model to use | sonar |
--model sonar-reasoning |
--format |
Output format (plain, markdown, json, rich) | rich |
--format markdown |
--help |
Show command help | - | --help |
Available Models¶
Model | Description | Best For |
---|---|---|
sonar |
Standard search model | General queries, basic information |
sonar-pro |
Enhanced search model | More comprehensive results |
sonar-reasoning |
Model with reasoning capabilities | Technical queries requiring analysis |
sonar-reasoning-pro |
Advanced reasoning model | Complex technical questions, in-depth analysis |
Configuration¶
Before using the web
command, you need to set up your Perplexity API key:
You can obtain an API key from Perplexity API documentation.
Examples¶
Basic Usage¶
Simple web search:
Using Different Models¶
Use a specific model for more technical queries:
For complex topics requiring in-depth analysis:
Different Output Formats¶
Output in markdown format for documentation:
Output in JSON format for programmatic use:
Use Cases¶
Technical Research¶
-
Researching programming concepts:
-
Finding best practices:
-
Comparing technologies:
Problem Solving¶
-
Debugging errors:
-
Finding solutions to common issues:
Learning¶
-
Understanding new technologies:
-
Following development trends:
Documentation and Examples¶
-
Finding code examples:
-
Looking up API documentation:
Advanced Techniques¶
Focused Queries¶
For more precise results, craft specific queries:
# Less effective
cursor-utils web "React"
# More effective
cursor-utils web "React custom hooks for form validation best practices"
Combining with Other Tools¶
Pipe results to other commands for further processing:
# Extract code examples from the results
cursor-utils web --format plain "Python pandas dataframe filtering examples" | grep -A 20 "```python" | grep -B 20 "```"
Save results to a file for later reference:
cursor-utils web --format markdown "GraphQL schema design best practices" > graphql-best-practices.md
Iterative Research¶
Build on previous research with follow-up queries:
# Start with a general topic
cursor-utils web "What is WebRTC?"
# Follow up with more specific questions
cursor-utils web "WebRTC NAT traversal techniques"
cursor-utils web "Implementing WebRTC signaling server in Node.js"
Best Practices¶
-
Be Specific: Frame your query with specific details for better results
-
Choose the Right Model: Select the appropriate model for your query type
- Use
sonar
for general information -
Use
sonar-reasoning
orsonar-reasoning-pro
for technical topics requiring analysis -
Consider Output Format: Choose the format that best suits your needs
- Use
markdown
for documentation - Use
rich
for interactive terminal viewing -
Use
json
for programmatic processing -
Check Information Freshness: Web information can become outdated
-
Verify Technical Solutions: Always validate solutions in your specific context
Troubleshooting¶
API Key Issues¶
If you receive authentication errors:
Verify your API key is correctly set:
If it's missing or incorrect, set it:
Model Availability¶
If you receive an error about model availability:
Try using a different model:
Rate Limiting¶
If you encounter rate limiting:
Wait a few minutes and try again, or check your API usage limits.
No Results Found¶
If your query returns limited or no results:
Try reformulating your query to be more specific or using different keywords.