A powerful CLI for the Brex Platform API. Manage accounts, transactions, transfers, recipients, webhooks, and more from your terminal.
- 🏦 Full Brex API coverage — accounts, transactions, transfers, recipients, cards, statements, webhooks, and more
- 📊 Multiple output formats — human-readable tables or JSON for scripting
- 🔐 Secure token storage — credentials stored safely in
~/.brex/ - 💳 Cash & card accounts — unified interface for both account types
- 🤖 Scriptable — no interactive prompts, perfect for CI/CD and automation
npm install -g brex-cli- Node.js v18 or later
# 1. Get your API token from Brex Developer Portal
# https://developer.brex.com/
# 2. Authenticate
brex login --token <YOUR_API_TOKEN>
# 3. List your accounts
brex accounts list
# 4. View transactions
brex transactions <account-id>All commands support these global options:
| Option | Description |
|---|---|
--json |
Output as JSON instead of human-readable tables |
-h, --help |
Show help for the command |
-v, --version |
Show CLI version |
Brex CLI uses API tokens for authentication. Tokens are stored locally in ~/.brex/token.
- Log in to the Brex Developer Portal
- Create an API token with the appropriate scopes
- Copy the token
Store an API token for authentication.
Syntax:
brex login --token <TOKEN>
brex login --token-stdin
Flags:
| Flag | Required | Description |
|---|---|---|
--token <TOKEN> |
One of these | API token string |
--token-stdin |
One of these | Read token from stdin |
Examples:
# Direct token input
brex login --token "brex_prod_xxx..."
# From environment variable
brex login --token "$BREX_TOKEN"
# From stdin (CI/CD friendly)
echo "$BREX_TOKEN" | brex login --token-stdin
# From file
cat ~/.secrets/brex | brex login --token-stdinRemove stored authentication token.
brex logoutShow current authentication and configuration status.
brex statusExample Output:
Brex CLI Status
──────────────────
Authenticated: Yes
Token: brex_prod...xxxx
API Base URL: https://platform.brexapis.com
Default Account: abc123-def456-...
| File | Purpose |
|---|---|
~/.brex/token |
API token |
~/.brex/config.json |
Optional configuration (default account, API base URL) |
Manage Brex bank accounts (cash and card).
Aliases: account, acc
List all accounts.
Syntax:
brex accounts list [--type cash|card|all] [--cursor <cursor>] [--json]
Options:
| Option | Type | Default | Description |
|---|---|---|---|
--type |
string | all |
Account type: cash, card, or all |
--cursor |
string | none | Pagination cursor for next page |
Get detailed information about a specific account.
Syntax:
brex accounts get <account-id> [--type cash|card] [--json]
View account transactions.
Aliases: tx, txn
List transactions for an account.
Syntax:
brex transactions <account-id> [options] [--json]
brex transactions --type card [options] [--json]
Options:
| Option | Type | Default | Description |
|---|---|---|---|
--type |
string | cash |
Account type: cash or card |
--limit <N> |
integer | API default | Maximum number of transactions to return |
--cursor |
string | none | Pagination cursor |
--posted-at-start |
ISO date | none | Filter transactions posted on or after this date |
Note: Cash transactions require an
<account-id>. Card transactions use the primary card account automatically (--type card).
Examples:
# List recent cash transactions
brex transactions dpacc_xxx
# Card transactions with limit
brex transactions --type card --limit 50
# Filter by posted date
brex transactions dpacc_xxx --posted-at-start 2026-01-01
# Paginate results
brex transactions dpacc_xxx --cursor <cursor>Create and manage transfers. Supports vendor payments (ACH/wire) and book transfers between your own accounts.
Send funds to a vendor or move money between your own accounts.
Vendor payment:
brex transfer create --from <cash-account-id> --to <payment-instrument-id> --amount <cents> --description <text> --memo <text> [--currency <code>] [--approval manual]
Book transfer (between own accounts):
brex transfer create --from <cash-account-id> --to-account <cash-account-id> --amount <cents> --description <text> --memo <text>
Options:
| Option | Required | Type | Description |
|---|---|---|---|
--from |
Yes | string | Source cash account ID |
--to |
One of | string | Vendor's payment instrument ID (from /vendors) |
--to-account |
One of | string | Destination cash account ID (book transfer) |
--amount |
Yes | integer | Amount in cents (e.g., 12550 for $125.50) |
--description |
Yes | string | Internal description (not shown externally) |
--memo |
Yes | string | External memo (max 90 chars for ACH/wire, 40 for cheque) |
--currency |
No | string | Currency code (default: USD) |
--idempotency-key |
No | string | Dedup key (auto-generated if omitted) |
--approval |
No | string | Set to manual to require manual approval |
Note: Use
--tofor vendor payments and--to-accountfor moving money between your own Brex cash accounts. Cannot use both.
Examples:
# Pay a vendor $125.50 via ACH
brex transfer create --from dpacc_xxx --to pyi_xxx --amount 12550 --description "Invoice 001" --memo "Payment for services"
# Move $1.00 from Primary to Vault
brex transfer create --from dpacc_xxx --to-account dpacc_yyy --amount 100 --description "Savings" --memo "Move to vault"
# With manual approval required
brex transfer create --from dpacc_xxx --to pyi_xxx --amount 50000 --description "Large payment" --memo "Q1 invoice" --approval manualGet details about a specific transfer.
brex transfer get <transfer-id> [--json]List transfers.
Syntax:
brex transfer list [--limit <N>] [--cursor <cursor>] [--json]
Options:
| Option | Type | Description |
|---|---|---|
--limit |
integer | Maximum results |
--cursor |
string | Pagination cursor |
The list view shows direction (IN/OUT), counterparty name, amount, status, payment type, and date.
Manage payment vendors (counterparties) for outbound transfers. Uses the Brex /v1/vendors API.
Aliases: recipient, recip
List all vendors.
Syntax:
brex recipients [list] [--limit <N>] [--cursor <cursor>] [--name <name>] [--json]
Options:
| Option | Type | Description |
|---|---|---|
--limit |
integer | Maximum results |
--cursor |
string | Pagination cursor |
--name |
string | Filter by company name |
Get detailed vendor info including payment accounts and instruments.
brex recipients get <vendor-id> [--json]Create a new vendor. Optionally attach an ACH payment account.
Syntax:
brex recipients create --name <company-name> [--email <email>] [--phone <phone>] [--routing <number> --account <number> --account-type CHECKING|SAVING --account-class BUSINESS|PERSONAL] [--idempotency-key <key>]
Options:
| Option | Required | Type | Description |
|---|---|---|---|
--name |
Yes | string | Company name (must be unique) |
--email |
No | string | Vendor email |
--phone |
No | string | Vendor phone |
--routing |
No* | string | Bank routing number |
--account |
No* | string | Bank account number |
--account-type |
No* | string | CHECKING or SAVING |
--account-class |
No* | string | BUSINESS or PERSONAL |
--idempotency-key |
No | string | Dedup key (auto-generated if omitted) |
*If any ACH field is provided, all four (
--routing,--account,--account-type,--account-class) are required.
Delete a vendor.
brex recipients delete <vendor-id>View card information.
Aliases: card
List cards with optional filters.
Syntax:
brex cards [list] [--user-id <user-id>] [--cursor <cursor>] [--limit <N>] [--json]
Get details about a specific card.
brex cards get <card-id> [--json]List and view organization members.
Aliases: user
List all users in the organization.
Syntax:
brex users [list] [--cursor <cursor>] [--email <email>] [--json]
Get details about a specific user.
brex users get <user-id> [--json]Aliases: org
Get organization information (legal name, DBA, status, address).
brex organization [--json]View card account statements.
Aliases: statement
List statements for a card account.
Syntax:
brex statements [--scope primary|additional] [--account-id <id>] [--cursor <cursor>] [--json]
Options:
| Option | Type | Default | Description |
|---|---|---|---|
--scope |
string | primary |
primary or additional card account |
--account-id |
string | none | Required when scope is additional |
--cursor |
string | none | Pagination cursor |
Get a specific statement.
brex statements get <statement-id> [--scope primary|additional] [--account-id <id>] [--json]Manage webhook endpoints.
Aliases: webhook, wh
List all webhook endpoints.
brex webhooks [list] [--cursor <cursor>] [--limit <N>] [--json]Get details about a webhook.
brex webhooks get <webhook-id> [--json]Create a new webhook endpoint.
Syntax:
brex webhooks create --url <url> [--events <event1,event2>] [--status <status>] [--idempotency-key <key>] [--json]
Event Types: PAYMENT_COMPLETED, TRANSFER_COMPLETED, and others.
Update an existing webhook.
brex webhooks update <webhook-id> [--url <url>] [--status <status>] [--events <events>] [--json]Delete a webhook endpoint.
brex webhooks delete <webhook-id>View webhook event history.
Aliases: event
List webhook events.
Syntax:
brex events [list] [--event-type <type>] [--after-date <ISO>] [--before-date <ISO>] [--cursor <cursor>] [--limit <N>] [--json]
Get details about a specific event.
brex events get <event-id> [--json]brex transactions "$ACCOUNT_ID" --json | \
jq -r '.items[] | [.id, .type, .amount.amount, .description] | @csv'brex accounts get "$ACCOUNT_ID" --type cash --json | jq -r '.available_balance'brex transfer list --json | jq '.items[] | select(.amount.amount < 0)'- Base URL:
https://platform.brexapis.com - Authentication: Bearer token
- Documentation: developer.brex.com
| Domain | Reference |
|---|---|
| Authentication | developer.brex.com/openapi/authentication |
| Transactions | developer.brex.com/openapi/transactions |
| Team | developer.brex.com/openapi/team |
| Payments | developer.brex.com/openapi/payments |
| Webhooks | developer.brex.com/openapi/webhooks |
This is an unofficial CLI. Verify scopes, permissions, and request payload requirements in Brex docs before production use.
MIT License. See LICENSE for details.
