Deploy programmable card code, simulate transactions locally, and manage Investec accounts from the terminal. Binary name: ipb.
Community-maintained project aligned with the Investec Programmable Banking community. Not officially endorsed or supported by Investec—use and contribute with care.
This README follows Divio’s documentation system: pick the section that matches what you need.
| I want to… | Go to |
|---|---|
| Learn by doing (first successful flow) | Tutorials |
| Solve a specific task | How-to guides |
| Look up a command, flag, or error code | Reference |
| Understand why the CLI works this way | Explanation |
| Contribute or release | CONTRIBUTING.md |
Full option lists for every command: GENERATED_README.md (or run ipb <command> --help / ipb docs).
Learning-oriented: follow in order. You will install the CLI, save credentials, list a card, scaffold a project, simulate locally, deploy, and fetch logs.
Time: about 10 minutes. You need: Node.js 24+ (or a standalone binary), Investec API credentials from the Developer Portal, and a programmable card.
npm install -g investec-ipb
ipb --versionOther install methods: How to install.
Get your client ID, client secret, and API key from the API quick start guide.
ipb config --client-id <client-id> --client-secret <client-secret> --api-key <api-key>Prefer credential files over putting secrets in environment variables. See Explanation: credentials and secrets.
ipb cardsNote a card key for later steps (-c).
ipb new my-card-app
cd my-card-appOptional templates: --template default or --template petro.
Amount is in cents:
ipb run -f main.js -e prod --amount 60000 --currency ZAR --mcc 0000 \
--merchant "Test Merchant" --city "Cape Town" --country ZAdeploy uploads (and can publish) code. You will be asked to confirm unless you pass --yes.
ipb deploy -f main.js -c <card-key>ipb logs -f executions.json -c <card-key>You now have a working loop: edit → ipb run → ipb deploy → ipb logs. Next: How-to guides for profiles, env files, accounts, and automation.
Goal-oriented recipes. For every flag, use ipb <command> --help.
npm (recommended if you already use Node.js 24+):
npm install -g investec-ipbOn Windows PowerShell (if scripts are blocked):
Set-ExecutionPolicy Unrestricted -Scope CurrentUserHomebrew (standalone binary, no Node.js):
brew tap devinpearson/ipb
brew install ipbDirect download: binaries on GitHub Releases.
macOS:
# Apple Silicon
curl -L https://github.com/devinpearson/ipb/releases/download/v0.9.3/ipb-macos-arm64 -o ipb
chmod +x ipb
sudo mv ipb /usr/local/bin/
# Intel
curl -L https://github.com/devinpearson/ipb/releases/download/v0.9.3/ipb-macos-x64 -o ipb
chmod +x ipb
sudo mv ipb /usr/local/bin/Linux (.deb):
wget https://github.com/devinpearson/ipb/releases/download/v0.9.3/ipb_0.9.3_amd64.deb
sudo dpkg -i ipb_0.9.3_amd64.deb
sudo apt-get install -fLinux binary:
curl -L https://github.com/devinpearson/ipb/releases/download/v0.9.3/ipb-linux-x64 -o ipb
# or: ipb-linux-arm64
chmod +x ipb
sudo mv ipb /usr/local/bin/Windows: download ipb-win-x64.exe, rename to ipb.exe, add to PATH.
More packaging options: DISTRIBUTION.md.
# Default credentials (~/.ipb/.credentials.json, mode 600)
ipb config --client-id <id> --client-secret <secret> --api-key <key>
# Optional card key / host — see ipb config --help
ipb config --card-key <card-key>
# Mauritius (MAU) credentials (separate from ZA PB/Card)
ipb config --mau-client-id <id> --mau-client-secret <secret> --mau-api-key <key>
# Named profiles
ipb config --profile production --client-id <id> --client-secret <secret> --api-key <key>
ipb config --profile staging --client-id <id> --client-secret <secret> --api-key <key>
ipb config profile set production
ipb config profile list
ipb config profile showUse a profile on any command:
ipb cards --profile staging
ipb deploy --profile production -f main.js -c <card-key>
ipb mau accounts --profile productionMAU uses the same OAuth shape as ZA APIs but separate credentials (mauClientId, mauClientSecret, mauApiKey, optional mauHost).
ipb mau accounts
ipb mau balances 5331
ipb mau transactions 5331 --from 2024-01-01 --to 2024-01-31
ipb mau documents 5331 --from 2025-01-01 --to 2025-01-31
ipb mau statement 5331 2025-01-31 --output statement.pdfEdit in your editor (EDITOR, default nano / notepad.exe):
ipb config edit
ipb config edit --profile productionCustom credentials file:
ipb cards --credentials-file /path/to/credentials.json# One-shot deploy (upload + publish path; confirms by default)
ipb deploy -f main.js -e prod -c <card-key>
ipb deploy -f main.js -c <card-key> --yes
# Split steps
ipb upload -f main.js -c <card-key>
ipb publish -f main.js --code-id <code-id> -c <card-key>
# Environment variables on the card
ipb env -f env.json -c <card-key>
ipb upload-env -f env.json -c <card-key>
# Download code from the card
ipb fetch -f backup.js -c <card-key>
ipb published -f published.js -c <card-key>Use .env.<name> locally and pass -e <name> when the command supports it (for example deploy / run).
Local emulator (no Investec account required):
ipb run -f main.js -e prod --amount 60000 --currency ZAR --mcc 0000 \
--merchant "Test Merchant" --city "Cape Town" --country ZAOnline simulator (uses API / card context and remote env):
ipb simulate -f main.js -c <card-key> --amount 60000 --currency ZAR --mcc 0000 \
--merchant "Test Merchant" --city "Cape Town" --country ZAReference data for MCC / country / currency values:
ipb countries
ipb currencies
ipb merchantsipb enable -c <card-key>
ipb disable -c <card-key> # confirms
ipb disable -c <card-key> --yesipb accounts
ipb balances <accountId>
ipb transactions <accountId>
ipb beneficiariesMoney movement requires confirmation (or --yes for automation):
ipb transfer <accountId> <beneficiaryAccountId> <amount> <reference>
ipb pay <accountId> <beneficiaryId> <amount> <reference>Amounts for transfer/pay are in rands (for example 100.50), not cents.
Bash:
mkdir -p ~/.bash_completion.d
ipb completion bash > ~/.bash_completion.d/ipb
echo "source ~/.bash_completion.d/ipb" >> ~/.bashrcZsh:
mkdir -p ~/.zsh/completions
ipb completion zsh > ~/.zsh/completions/_ipb
# In ~/.zshrc:
# fpath=(~/.zsh/completions $fpath)
# autoload -U compinit && compinit# Machine-readable output
ipb cards --json
ipb accounts --json | jq .
# Skip confirms only when intentional
ipb deploy -f main.js -c <card-key> --yes
# Quiet / debug
ipb accounts --no-spinner
ipb accounts --verbose
# or: DEBUG=1 ipb accountsWhen stdout is piped, the CLI favours structured output and turns spinners off. Destructive commands need --yes in non-interactive use.
Handle exit codes in scripts:
if ipb deploy -f main.js -c "$CARD" --yes; then
echo "ok"
else
echo "failed with exit $?"
fiSee Exit codes and Error codes.
Information-oriented lookup. Authoritative flags: ipb <command> --help or GENERATED_README.md.
| Command | Purpose |
|---|---|
cards (c) |
List programmable cards |
config (cfg) |
Save credentials; profile / edit subcommands |
new |
Scaffold a local project |
run (r) |
Local transaction simulation |
simulate |
Online simulator |
deploy (d) |
Deploy code to a card |
upload (up) / publish (pub) |
Upload or publish code |
fetch (f) / published |
Download saved or published code |
env / upload-env |
Card environment variables |
logs (log) |
Execution logs |
enable / disable |
Toggle code on a card |
accounts (acc) / balances (bal) / transactions (tx) |
Account data (ZA PB) |
mau |
Mauritius Open Banking (accounts, balances, transactions, documents, statement) |
beneficiaries / transfer / pay |
Beneficiaries and payments |
countries / currencies / merchants |
Reference data |
completion / docs / env-list |
Shell completion, docs dump, env catalogue |
These commands are disabled and return an error: ai, bank, register, login.
- Auth:
--client-id,--client-secret,--api-key,--host,--credentials-file,--profile - MAU auth:
--mau-client-id,--mau-client-secret,--mau-api-key,--mau-host - Output:
--json,--yaml,--output <file>,-v/--verbose - Spinner:
--no-spinner(preferred);-s/--spinneris deprecated - Destructive:
--yeswhere supported
List everything the CLI documents:
ipb env-list
ipb env-list --jsonCommon categories:
- API:
INVESTEC_HOST,INVESTEC_CLIENT_ID,INVESTEC_CLIENT_SECRET,INVESTEC_API_KEY,INVESTEC_CARD_KEY - MAU API:
INVESTEC_MAU_HOST,INVESTEC_MAU_CLIENT_ID,INVESTEC_MAU_CLIENT_SECRET,INVESTEC_MAU_API_KEY - Behaviour:
DEBUG,REJECT_UNAUTHORIZED,NO_COLOR,FORCE_COLOR,EDITOR,PAGER,TMPDIR,IPB_NO_UPDATE_CHECK
| Exit | Meaning |
|---|---|
0 |
Success |
1 |
General error |
2 |
Validation / bad input |
3 |
Authentication |
4 |
File |
5 |
API (includes rate limits) |
6 |
Network |
7 |
Permission |
Messages look like Error (E####): ….
| Code | Description |
|---|---|
E4002 |
Missing API token |
E4003 |
Missing card key |
E4004 |
Missing environment file |
E4005 |
Invalid credentials |
E4007 |
Template not found |
E4008 |
Invalid project name |
E4009 |
Project exists |
E4010 |
File not found |
E4012 |
Missing account ID |
E4014 |
Rate limit exceeded |
E4019 |
Unsupported operation |
E4020 |
Missing or invalid date range (MAU --from / --to) |
E5001 |
Deploy / API operation failed |
Quick fixes: missing card key → ipb cards then -c; bad auth → ipb config; missing .env.<env> → create the file or change -e.
Understanding-oriented background. Skip this until you care about the “why”.
Credential files under ~/.ipb/ use owner-only permissions (600) and atomic writes. Environment variables are convenient but can leak via process lists, CI logs, and shell history. The CLI may warn when secrets appear in the environment (especially with --verbose / DEBUG or in CI). Prefer ipb config and profiles for day-to-day use.
Resolution order (highest wins):
- Command-line options (
--api-key, …) --profileor the active profile- Environment variables
- Default credentials file (
~/.ipb/.credentials.json)
deploy, publish, disable, transfer, and pay change live card state or move money. Interactive runs ask for confirmation. Automation and pipes should pass --yes only when the action is intentional.
runuses the local emulator and local files/env—good for fast iteration offline.simulatehits Investec’s online simulator with your card/API context—closer to production behaviour, needs credentials.
Copyable skill for AI agents that operate ipb: skills/ipb/. Prefer --json and confirm money or deploy steps before running them.
Issues and pull requests are welcome. For running locally, tests, docs, version bumps, and releases, see CONTRIBUTING.md.
git clone https://github.com/devinpearson/ipb.git
cd ipb
npm install
npm run build
node bin/index.js --helpMIT — see LICENSE.md.
Open a GitHub issue for questions and bugs.






