Skip to content

CLI

Sample CLI output card

Terminal window
# Zero-install — npx (umbrella package, single tarball)
npx thai-qr-payment 0812345678 --amount 50 -o qr.svg
npx tqp 0812345678 --amount 50 -o qr.svg
# Global install
pnpm add -g thai-qr-payment
thai-qr-payment 0812345678 --amount 50 --merchant "Acme Coffee" -o qr.svg
tqp 0812345678 --format payload

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

Terminal window
# Wrong — npx looks for a `@thai-qr-payment/cli` binary, finds none
npx @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 --package
npx --package=@thai-qr-payment/cli thai-qr-payment 0812345678 --amount 50
npx --package=@thai-qr-payment/cli tqp 0812345678 --amount 50

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

Terminal window
thai-qr-payment 0812345678 --amount 50 --merchant "Acme Coffee" -o qr.svg

Full SVG card with Thai QR Payment + PromptPay headers, merchant name, and amount label.

Terminal window
thai-qr-payment 0812345678 --amount 50 --format matrix --size 512 -o qr.svg

Just the QR matrix as a square SVG. Caller-controlled size.

Terminal window
thai-qr-payment 0812345678 --amount 50 --format payload
# 00020101021229370016A00000067701011101130066812345678530376454065000.005802TH63041234

Raw EMVCo wire string. Useful for piping into another tool.

FlagShortNotes
--recipient <id>-rphone, nationalId, eWallet
--amount <thb>-aomit for static QR
--satangtreat --amount as integer satang
--type <kind>mobile / nationalId / eWallet — overrides auto-detect
--ecc <level>L / M / Q / H (default M)
--format <kind>-fcard (default) / matrix / payload
--theme <kind>color (default) / silhouette
--merchant <name>-mrendered above the QR (card mode)
--size <px>matrix mode output size
--output <path>-owrite to file (default stdout)
--help-hshow help
--version-vshow CLI version
Terminal window
# Dynamic 50 THB card written to file
thai-qr-payment 0812345678 --amount 50 --merchant "Acme" -o qr.svg
# Bare 512 px QR matrix with high error correction
thai-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 satang
thai-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 recipient
thai-qr-payment 1234567890123 --type nationalId --amount 100 -o qr.svg
# e-Wallet recipient
thai-qr-payment 123456789012345 --type eWallet --amount 200 -o qr.svg