- TypeScript 80.6%
- Shell 12.7%
- JavaScript 6.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
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
|
||
| .forgejo/workflows | ||
| .githooks | ||
| .vscode | ||
| bin | ||
| scripts | ||
| src | ||
| types | ||
| .gitignore | ||
| .node-version | ||
| .oxfmtrc.json | ||
| .review-enrolled | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| fta.json | ||
| knip.json | ||
| LICENSE | ||
| oxlint.config.ts | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| release.config.mjs | ||
| tsconfig.base.json | ||
| tsconfig.build.json | ||
| tsconfig.check.json | ||
| tsconfig.json | ||
| tsconfig.scripts.json | ||
| tsconfig.test.json | ||
| vitest.config.ts | ||
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.