Advanced usage
The CLI in CI, in scripts, and when something is going wrong.
Everything here is the CLI doing work you would otherwise do by hand: proving a deploy is healthy, producing a report, or telling you which of seven possible things is broken.
In a pipeline
There is no browser in CI, so the key comes from the environment. Every command reads
WAJUB_API_KEY, and when it is set it wins over any profile, --profile included.
#!/usr/bin/env bash
set -euo pipefail
export WAJUB_API_KEY="$WAJUB_SANDBOX_KEY" # from your CI secret store
# Fail the job if the key, the network or the account is wrong
wajub doctor --json > doctor.json
# Fail the job if the webhook endpoint disappeared
wajub webhooks list --json \
| jq -e '.items[] | select(.url == "https://example.com/webhooks/wajub")' > /dev/null--json on every command makes the output parseable, and jq -e turns "no match" into a non zero
exit status, which is what makes the step actually fail.
A live key in CI is a live key in your logs
Use a sandbox key for anything that runs on every push. Reserve a live key for a deliberate, protected job, and never echo it, not even masked.
Exit codes and runs without a terminal
A step fails on the exit status, so here is what the CLI returns.
| Status | When |
|---|---|
0 | The command did what it was asked |
1 | Anything that failed: an API error, a wajub doctor check, a confirmation that could not be asked, and a wajub trigger whose scenario did not end as promised. trigger waits up to 30 seconds for the sandbox to settle the payment or refund before it gives up |
127 | The command does not exist, as a shell's "command not found". The CLI suggests the closest one and never runs it for you |
A pipeline has no terminal, so the CLI cannot ask anything there. A command that would ask for
confirmation (a deletion, a payment, transfer or refund with a live key, wajub logout) fails with
status 1 unless you pass --yes. wajub skills install needs --scope. A hidden prompt for a
key (wajub config set, wajub login --manual) fails too: set WAJUB_API_KEY instead.
Reports from the terminal
The list commands plus jq replace a lot of small scripts.
# Yesterday's failures, with the reason
wajub payments list --status failed -f date_from=2026-01-14 -f date_to=2026-01-14 -f per_page=100 --json \
| jq -r '.items[] | [.created_at, .id, .amount, .currency, .failure_reason] | @tsv'
# Payouts still not settled
wajub transfers list --status processing --json \
| jq -r '.items[] | [.id, .amount, .currency, .created_at] | @tsv'--since and --until are not read by the API, so the dates go through -f date_from and
-f date_to, which only payments, refunds and disputes accept. They are whole calendar days: for a
shorter window, filter the timestamps in jq after listing the day.
Environment variables
Every variable below applies to every command, and a flag on the command line still wins over it, except for the key.
| Variable | Effect |
|---|---|
WAJUB_API_KEY | The key to use. Wins over every profile, --profile included |
WAJUB_PROFILE | The profile to use when no --profile is given |
WAJUB_MAX_RETRIES | How many times a failed request is retried. 2 by default, 0 turns retries off |
WAJUB_TIMEOUT_MS | How long a request may take, in milliseconds, before it fails with Network Error |
WAJUB_NO_SKILLS | 1 stops the CLI installing Agent Skills on its own |
WAJUB_NO_LOGO | 1 hides the Wajub logo above wajub, wajub help, wajub version and wajub doctor. It never shows in a pipe or with --json anyway |
Shell completion
wajub completion installTAB then completes commands, flags and their values: the statuses --status accepts on each list
command, event types and payment.* wildcards for wajub listen --events (one after the other,
comma-separated), wajub trigger events, your profiles for --profile and wajub config use, and
API paths for wajub get, post and delete. It works in bash (3.2 and later, the one macOS
ships included), zsh, fish and PowerShell.
The command detects your shell, or takes --shell bash|zsh|fish|powershell. It adds one block,
between # >>> wajub completion >>> markers, to ~/.zshrc, ~/.bashrc (~/.bash_profile on
macOS) or $PROFILE; for fish it writes ~/.config/fish/completions/wajub.fish. Open a new
terminal, and that is all: the scripts are regenerated by the first command after each upgrade, so
completion always matches the version installed.
wajub completion # which shells have it, and where
wajub completion zsh # the lines to add yourself, if you keep your dotfiles by hand
wajub completion uninstall # removes the block, the fish file and the scriptsBefore 1.7, wajub autocomplete set completion up differently. Those setups keep working after the
upgrade, now with the new completion; wajub completion install replaces their line in your startup
file.
Starting from a working example
$ wajub samples --list
Available samples:
webhooks Minimal webhook receiver with signature verification (Node.js, no dependencies)
$ wajub samples webhooks my-receiverThe webhook sample is deliberately dependency free, so you can read the whole verification in one file rather than through a framework.
Jumping to the Dashboard
wajub open # the dashboard home
wajub open payments
wajub open keysThe pages it knows are balance, customers, dashboard, disputes, keys, payments,
refunds, settings, transfers and webhooks.
When something is wrong
Three commands, in increasing order of how much they tell you.
$ wajub version
@wajub/cli/1.7.3 darwin-arm64 node-v22.11.0
$ wajub status
● Wajub API is reachable, https://api.wajub.com (HTTP 200)
$ wajub doctor
Wajub CLI diagnostics
…seven checks, in orderstatus answers "is it them or me" and needs no credentials. doctor answers "which of my seven
things is broken" and ends with a request id to hand to support.
| Symptom | Likely check |
|---|---|
401 on every command | Credentials, and the source field beside it |
| Commands hit the wrong account | source=env, a WAJUB_API_KEY left exported |
| A command does not exist | wajub help, and remember topics use a space |
Nothing arrives in wajub listen | Credentials, and whether the profile is sandbox or live |
| A stack trace on startup | Node version, 22 is the minimum |
An unknown command fails clearly rather than doing something surprising.
$ wajub payment
› Error: "payment" is not a wajub command. Run `wajub help` for the list.Telling us what is missing
wajub feedbackIt opens the feedback form in your browser. Pair it with the request id from wajub doctor and the
first two messages of a support thread are already answered.