Minimal Unix-style CLI for querying Perplexity Sonar API.
  • TypeScript 80.6%
  • Shell 12.7%
  • JavaScript 6.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Łukasz Jerciński 95df258415
All checks were successful
Release / Check tip (push) Successful in 2s
Release / reuse (push) Successful in 3s
Release / quality-checks-1 (push) Has been skipped
Release / qc-result (push) Successful in 2s
Release / quality-checks (push) Successful in 0s
Dedupe check / dedupe-check (push) Successful in 24s
Release / Release (push) Successful in 19s
chore: upgrade to Vitest 5.1 and align with j4k-align 18.3.1 (#19)
2026-11-05 17:41:35 +00:00
.forgejo/workflows chore: upgrade to Vitest 5.1 and align with j4k-align 18.3.1 (#19) 2026-11-05 17:41:35 +00:00
.githooks chore: upgrade to Vitest 5.1 and align with j4k-align 18.3.1 (#19) 2026-11-05 17:41:35 +00:00
.vscode fix: align repository config with j4k-align templates (#25) 2026-06-10 06:26:47 +02:00
bin feat: initial release of askpplx CLI 2025-12-04 10:14:30 +01:00
scripts chore: upgrade to Vitest 5.1 and align with j4k-align 18.3.1 (#19) 2026-11-05 17:41:35 +00:00
src fix: publish as @j4k-oss/askpplx from code.j4k.dev (#1) 2026-10-21 14:37:44 +00:00
types chore: re-render managed files with @j4k/align@1.82.1 (#33) 2026-07-11 16:54:24 +02:00
.gitignore chore: migrate to the @j4k scope on the Forge npm registry (#32) 2026-07-11 11:21:42 +02:00
.node-version fix: align with j4k-align 17.15.4 (#17) 2026-11-03 14:30:48 +00:00
.oxfmtrc.json chore: retire the legacy review workflow and resync managed files (#35) 2026-09-04 13:28:02 +02:00
.review-enrolled fix: publish as @j4k-oss/askpplx from code.j4k.dev (#1) 2026-10-21 14:37:44 +00:00
AGENTS.md chore: regenerate agent instructions (#10) 2026-10-25 11:32:42 +00:00
CLAUDE.md feat: initial release of askpplx CLI 2025-12-04 10:14:30 +01:00
fta.json feat: initial release of askpplx CLI 2025-12-04 10:14:30 +01:00
knip.json fix: publish as @j4k-oss/askpplx from code.j4k.dev (#1) 2026-10-21 14:37:44 +00:00
LICENSE feat: initial release of askpplx CLI 2025-12-04 10:14:30 +01:00
oxlint.config.ts fix: align with j4k-align 17.15.4 (#17) 2026-11-03 14:30:48 +00:00
package.json chore: upgrade to Vitest 5.1 and align with j4k-align 18.3.1 (#19) 2026-11-05 17:41:35 +00:00
pnpm-lock.yaml chore: upgrade to Vitest 5.1 and align with j4k-align 18.3.1 (#19) 2026-11-05 17:41:35 +00:00
pnpm-workspace.yaml fix: prioritize checking contexts in typed lint (#40) 2026-10-21 13:22:55 +02:00
README.md docs: drop the repeated registry statement in the install intro (#5) 2026-10-23 07:22:58 +00:00
release.config.mjs chore: align with j4k-align 13.1.0 (#8) 2026-10-24 12:39:36 +00:00
tsconfig.base.json chore: retire the legacy review workflow and resync managed files (#35) 2026-09-04 13:28:02 +02:00
tsconfig.build.json fix: preserve native typed lint checking contexts (#39) 2026-10-16 10:33:49 +02:00
tsconfig.check.json fix: prioritize checking contexts in typed lint (#40) 2026-10-21 13:22:55 +02:00
tsconfig.json fix: prioritize checking contexts in typed lint (#40) 2026-10-21 13:22:55 +02:00
tsconfig.scripts.json chore: align with @j4k/align 6.1.3 (#37) 2026-10-13 16:50:11 +02:00
tsconfig.test.json chore: align with @j4k/align 6.1.3 (#37) 2026-10-13 16:50:11 +02:00
vitest.config.ts feat: initial release of askpplx CLI 2025-12-04 10:14:30 +01:00

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

askpplx is published only as @j4k-oss/askpplx on the code.j4k.dev registry, which reads anonymously. The unscoped askpplx on npmjs.org is deprecated and gets no updates.

Without a registry mapping, npm looks on npmjs.org, finds nothing, and fails with a 404, so map the scope to code.j4k.dev. Do it once in ~/.npmrc:

@j4k-oss:registry=https://code.j4k.dev/api/packages/j4k-oss/npm/

The inline flag below is enough for a single npx run. Keep the ~/.npmrc line for global installs: npm update -g and npm outdated -g read the registry from your configuration, and without the line they look the scoped name up on npmjs.org.

If you installed the unscoped askpplx globally, run npm uninstall -g askpplx first. Both packages provide the askpplx command, so npm install -g would stop with EEXIST.

# global
npm install -g --@j4k-oss:registry=https://code.j4k.dev/api/packages/j4k-oss/npm/ @j4k-oss/askpplx

# one-off
npx -y --@j4k-oss:registry=https://code.j4k.dev/api/packages/j4k-oss/npm/ @j4k-oss/askpplx@latest --help

In a pnpm project, map the scope to its registry and exempt it from minimumReleaseAge 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

The examples below run the globally installed askpplx.

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
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

With askpplx installed globally, add this rule to your CLAUDE.md or AGENTS.md:

# Rule: Use `askpplx` for Current Facts

At the start of each session, run `askpplx --help` to check CLI availability, available options, and whether an API key is present.
When a task depends on current or uncertain external information, query `askpplx` instead of relying on memory.