Watenga CLI @watenga/cli

Receive your test webhooks on your machine, trigger test events, watch your API requests, and call the API from a terminal.

Install

bash
npm install -g @watenga/cli      # Node 20 or later
watenga login --profile dev      # paste a test secret key (sk_test_...)

Before the first release

Until the package is on npm, run it from a checkout of the Watenga repository: node packages/watenga-cli/bin/watenga.js --help. In scripts and CI, pass --api-key or set WATENGA_API_KEY instead of storing a profile.

Webhooks on your machine

watenga listen opens a listen session for your test app: its real test events (and the ones you trigger) are delivered to the session, and the CLI forwards each to your URL, signed with the session's secret exactly as Watenga signs deliveries. Use the printed secret in your handler while you develop, so your verification code is the same in development and production. Your handler's answer is reported back and shows in the developer console's delivery log. Test keys only.

bash
watenga listen --forward-to http://localhost:3000/webhooks
# Ready. Forwarding test events to http://localhost:3000/webhooks
# Your webhook signing secret for this session is whsec_... (expires ...).
# 2026-10-29T10:00:02Z  --> payment.capture.completed [evt_...]  <-- [200]

Only some events: --events payment.capture.completed,payment.refund.completed. The session closes when you stop the CLI (Ctrl-C) and expires after 24 hours without polling.

Trigger test events

Sends the event's sample object (with your overrides) to every endpoint of your test app that takes the event, listen sessions included.

bash
watenga trigger payment.capture.completed
watenga trigger payment.capture.completed --object '{"amount":"5.00"}'
watenga trigger invoicing.invoice.paid

Tail your API logs

bash
watenga logs tail                # every request made with your keys
watenga logs tail --errors-only  # 4xx and 5xx only

Every command

CommandWhat it does
login [--api-key K]Store a key (sk_test_, sk_live_ or rk_) in ~/.watenga/config.json
whoamiThe key in use: secret or restricted, test or live, scopes (GET /v1/account/api-key)
listen --forward-to URL [--events a,b]Forward test events to your URL, signed
trigger EVENT [--object JSON]Send a test event
logs tail [--errors-only]Print API requests as they happen
balanceAvailable, pending and reserve balances
transactions list | get IDPayments and refunds
refund TXN --reason R [--amount N]Refund within your key's limits
checkout create --amount N --currency C --reference R --return-url UStart a payment
payment-links | invoices | subscriptions | customersList and read them

Every call sends Watenga-Version: 2026-10-29 and, for writes, an Idempotency-Key; network errors, 429 and 5xx are retried; errors show the code, the field at fault and the request id. Payouts are dashboard-only. See also Webhooks.