@j4k-oss/askpplx (1.4.14)
Installation
@j4k-oss:registry=npm config set @j4k-oss:registry=npm install @j4k-oss/askpplx@1.4.14"@j4k-oss/askpplx": "1.4.14"About this package
askpplx
Source: https://code.j4k.dev/j4k-oss/askpplx. github.com/Jercik/askpplx is a read-only mirror; open issues and pull requests on the Forge.
askpplx is a minimal Unix-style CLI for querying Perplexity Sonar.
Perplexity AI is an AI-powered search engine and answer engine that delivers concise, accurate responses to user queries by combining real-time web searches with advanced language models.
- Command name:
askpplx - Output: plain text or JSON to stdout
- No MCPs, no agents, no plugins, no TUI
- Just a thin, script-friendly wrapper around the Perplexity API
Installation
Each release is published under two names with the same files:
askpplxon npmjs.org, fornpxandnpm exec. All examples below use it.@j4k-oss/askpplxon thecode.j4k.devregistry, for pnpm projects that exempt the@j4k-ossscope fromminimumReleaseAge. The registry reads anonymously.
To use the code.j4k.dev copy, map the scope to its registry and exempt it in pnpm-workspace.yaml, then add the package:
registries:
"@j4k-oss": https://code.j4k.dev/api/packages/j4k-oss/npm/
minimumReleaseAgeExclude:
- "@j4k-oss/*"
pnpm add -D @j4k-oss/askpplx
Both packages install the same askpplx command and read the same stored API key.
Setup
Provide your Perplexity API key via environment variable or persistent storage:
# Option 1: Environment variable
export PERPLEXITY_API_KEY="pplx-..."
# Option 2: Store persistently
npx -y askpplx config --set-api-key "pplx-..."
Examples
# simple question
askpplx "Explain Raft vs Paxos in simple terms"
# web-enabled search with local context
askpplx "What are breaking changes in React 19 that affect this code? $(cat src/app.tsx)"
# read prompt from stdin (filter style)
cat article.txt | askpplx -S "Summarize this article"
# extract plain text from JSON response
askpplx "Node.js LTS version" --json | jq -r '.text'
# list cited source URLs
askpplx "Latest TypeScript release notes" --json | jq -r '.sources[].url' | sort -u
Agent Rule
Add this rule to your CLAUDE.md or AGENTS.md:
# Rule: Use `askpplx` for Current Facts
At the start of each session, run `npx -y askpplx --help` to verify the CLI is available and configured properly and check available options.
When a task depends on current or uncertain external information, query `askpplx` instead of relying on memory.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @ai-sdk/perplexity | ^3.0.42 |
| @commander-js/extra-typings | ^15.0.0 |
| ai | ^6.0.198 |
| commander | ^15.0.0 |
| conf | ^15.1.0 |
| zod | ^4.4.3 |
Development dependencies
| ID | Version |
|---|---|
| @j4k-oss/fta-check | ^1.5.10 |
| @j4k/oxlint-config | 2.14.2 |
| @j4k/semantic-release-forgejo | ^1.2.4 |
| @total-typescript/ts-reset | ^0.6.1 |
| @types/node | ^24.0.0 |
| @vitest/coverage-v8 | ^4.1.8 |
| conventional-changelog-conventionalcommits | ^9.3.1 |
| fta-cli | ^3.0.0 |
| knip | ^6.16.1 |
| oxfmt | ^0.57.0 |
| oxlint | 1.87.0 |
| oxlint-tsgolint | 7.0.2004 |
| semantic-release | ^25.0.3 |
| typescript | ^7.0.2 |
| vitest | ^4.1.8 |