npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pplx-cli

v1.0.1

Published

A powerful CLI tool for the Perplexity AI API - search the web and chat with AI from your terminal

Readme

pplx-cli

A powerful CLI tool for the Perplexity AI API - search the web and chat with AI from your terminal.

Features

  • 🔍 Web Search - Search the web with advanced filtering options
  • 💬 AI Chat - Chat with Perplexity's AI models with web-grounded responses
  • 🌊 Streaming - Real-time streaming responses
  • 📚 Citations - See sources for AI-generated responses
  • 🎯 Multiple Models - Support for Sonar, Sonar Pro, and Reasoning models
  • ⚙️ Easy Configuration - Simple API key management

Installation

# Using npm
npm install -g pplx-cli

# Using bun
bun install -g pplx-cli

# Using yarn
yarn global add pplx-cli

Quick Start

  1. Get your API key from Perplexity API Portal

  2. Configure the CLI:

pplx config set-key pplx-xxxxxxxxxxxxxxxx
  1. Start asking questions:
pplx ask "What are the latest developments in AI?"

Commands

pplx config

Manage your configuration.

# Save your API key
pplx config set-key <api-key>

# Show current configuration
pplx config show

# Clear configuration
pplx config clear

pplx ask

Ask a single question to Perplexity AI.

# Basic usage
pplx ask "What is the weather in Tokyo?"

# Use a specific model
pplx ask "Explain quantum computing" --model sonar-pro

# Stream the response in real-time
pplx ask "Latest tech news" --stream

# Filter by recency
pplx ask "Breaking news" --recency hour

# Filter by domain
pplx ask "Climate research" --domain nature.com --domain science.org

# Output as JSON
pplx ask "Hello world" --json

# Hide citations
pplx ask "Quick question" --no-citations

# Custom system prompt
pplx ask "Summarize this topic" --system "You are a concise summarizer"

Options:

  • -m, --model <model> - Model to use (sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro)
  • -s, --stream - Stream the response in real-time
  • -j, --json - Output raw JSON response
  • -c, --citations - Show source citations (default: true)
  • --no-citations - Hide source citations
  • -r, --recency <recency> - Filter by recency (hour, day, week, month, year)
  • -d, --domain <domains...> - Filter by domain(s)
  • --system <prompt> - Custom system prompt

pplx search

Search the web using Perplexity.

# Basic search
pplx search "climate change research"

# Academic search
pplx search "machine learning papers" --mode academic

# Limit results
pplx search "tech news" --limit 5

# Filter by recency
pplx search "breaking news" --recency day

# Filter by domain
pplx search "AI news" --domain techcrunch.com

# Output as JSON
pplx search "query" --json

Options:

  • -l, --limit <number> - Maximum number of results (default: 10)
  • -m, --mode <mode> - Search mode (web, academic, sec)
  • -r, --recency <recency> - Filter by recency (hour, day, week, month, year)
  • -d, --domain <domains...> - Filter by domain(s)
  • -j, --json - Output raw JSON response

pplx chat

Start an interactive chat session.

# Start chat
pplx chat

# Use a specific model
pplx chat --model sonar-pro

# With custom system prompt
pplx chat --system "You are a helpful coding assistant"

In-chat commands:

  • /clear - Clear conversation history
  • /exit or /quit - Exit the chat
  • /help - Show help

Options:

  • -m, --model <model> - Model to use
  • --system <prompt> - Custom system prompt
  • -r, --recency <recency> - Filter by recency
  • -d, --domain <domains...> - Filter by domain(s)

Available Models

| Model | Description | |-------|-------------| | sonar | Fast, cost-effective model (default) | | sonar-pro | Advanced model with better quality | | sonar-reasoning | Model with reasoning capabilities | | sonar-reasoning-pro | Advanced reasoning model |

Environment Variables

  • PERPLEXITY_API_KEY - Your Perplexity API key (alternative to config file)

The config file takes precedence over the environment variable.

Configuration File

The configuration is stored at ~/.config/pplx-cli/config.json.

License

MIT

Links