Skip to content

Command Line Interface

Ratomir Jovanovic edited this page Oct 26, 2026 · 2 revisions

Command Line Interface

The CLI runs the same engine as the website, offline. It is published on npm as pandapaylens (since 0.14.0) and needs Node.js 22 or later:

npx pandapaylens --help
npm install --global pandapaylens   # or install it once

From a clone of the repository, run pnpm install && pnpm build:packages and use node packages/cli/dist/bin.js in place of pandapaylens.

Library

The same package is a library with TypeScript types and no runtime dependencies:

import { analyze, toMarkdownReport } from "pandapaylens";

const r = analyze(text); // or analyze(text, { provider: "adyen" })
if (r.ok) console.log(toMarkdownReport(r.result));
else console.error(r.error.message);

analyze uses every adapter and the default rules. analyzeText, ADAPTERS, MANIFESTS, defaultRules, toJsonReport and the result types are exported as well.

Commands

Command Output
pandapaylens analyze <file|-> full analysis: errors, timeline and findings
pandapaylens decode <file|-> decoded errors only
pandapaylens timeline <file|-> event timeline only
pandapaylens examples [id] list the built-in examples, or print one
pandapaylens providers providers, capabilities and formats
pandapaylens version CLI, core, rule catalog and adapter versions

Use - to read standard input.

Options

Option Meaning
-p, --provider <id> skip auto-detection (ids are listed by pandapaylens providers)
-f, --format <text|json|markdown> output format, default text
--fail-on <severity> exit 1 if a finding is at or above critical|high|medium|low|info
--include-identifiers do not mask identifiers
--no-color plain output
--supported with providers: only providers that can be analyzed

Exit codes

Code Meaning
0 ok
1 a finding at or above --fail-on
2 invalid input
3 unsupported provider or format
4 internal error

Examples

# Decode one error response
pandapaylens decode stripe-error.json

# Markdown report for a support ticket (identifiers masked)
pandapaylens analyze webhooks.jsonl --format markdown > report.md

# Fail a CI job when a high or critical finding appears in recorded webhooks
pandapaylens analyze recorded-webhooks.jsonl --fail-on high

# Try a built-in example
pandapaylens examples ccbill-renewal-failure | pandapaylens analyze -

Clone this wiki locally