CLI
# Zero-install — npx (umbrella package, single tarball)npx thai-qr-payment 0812345678 --amount 50 -o qr.svgnpx tqp 0812345678 --amount 50 -o qr.svg
# Global installpnpm add -g thai-qr-paymentthai-qr-payment 0812345678 --amount 50 --merchant "Acme Coffee" -o qr.svgtqp 0812345678 --format payloadnpx + scoped CLI package
Section titled “npx + scoped CLI package”@thai-qr-payment/cli exposes the same two binaries (thai-qr-payment and tqp), but the binary names don’t match the package name. npx can’t auto-resolve @thai-qr-payment/cli to a binary called thai-qr-payment, so npx @thai-qr-payment/cli 0812345678 fails with command not found. Pass the binary name explicitly via --package:
# Wrong — npx looks for a `@thai-qr-payment/cli` binary, finds nonenpx @thai-qr-payment/cli 0812345678 --amount 50# → sh: thai-qr-payment: command not found
# Right — use the umbrella (recommended, single tarball)npx thai-qr-payment 0812345678 --amount 50
# Right — scoped CLI with --packagenpx --package=@thai-qr-payment/cli thai-qr-payment 0812345678 --amount 50npx --package=@thai-qr-payment/cli tqp 0812345678 --amount 50The umbrella is preferred (one tarball, all deps inlined). Reach for the scoped CLI only if you’re pinning specific package versions in an automation script.
Card (default)
Section titled “Card (default)”thai-qr-payment 0812345678 --amount 50 --merchant "Acme Coffee" -o qr.svgFull SVG card with Thai QR Payment + PromptPay headers, merchant name, and amount label.
Matrix
Section titled “Matrix”thai-qr-payment 0812345678 --amount 50 --format matrix --size 512 -o qr.svgJust the QR matrix as a square SVG. Caller-controlled size.
Payload
Section titled “Payload”thai-qr-payment 0812345678 --amount 50 --format payload# 00020101021229370016A00000067701011101130066812345678530376454065000.005802TH63041234Raw EMVCo wire string. Useful for piping into another tool.
| Flag | Short | Notes |
|---|---|---|
--recipient <id> | -r | phone, nationalId, eWallet |
--amount <thb> | -a | omit for static QR |
--satang | — | treat --amount as integer satang |
--type <kind> | — | mobile / nationalId / eWallet — overrides auto-detect |
--ecc <level> | — | L / M / Q / H (default M) |
--format <kind> | -f | card (default) / matrix / payload |
--theme <kind> | — | color (default) / silhouette |
--merchant <name> | -m | rendered above the QR (card mode) |
--size <px> | — | matrix mode output size |
--output <path> | -o | write to file (default stdout) |
--help | -h | show help |
--version | -v | show CLI version |
Examples
Section titled “Examples”# Dynamic 50 THB card written to filethai-qr-payment 0812345678 --amount 50 --merchant "Acme" -o qr.svg
# Bare 512 px QR matrix with high error correctionthai-qr-payment 0812345678 --amount 50 --format matrix --size 512 --ecc H -o qr.svg
# Print just the payload (for piping)thai-qr-payment 0812345678 --amount 50 --format payload | tee payload.txt
# Pay 50.50 from satangthai-qr-payment 0812345678 --amount 5050 --satang -o qr.svg
# Silhouette theme (monochrome brand artwork)thai-qr-payment 0812345678 --amount 50 --theme silhouette -o qr.svg
# National ID recipientthai-qr-payment 1234567890123 --type nationalId --amount 100 -o qr.svg
# e-Wallet recipientthai-qr-payment 123456789012345 --type eWallet --amount 200 -o qr.svg