Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brex-cli

CLI for the Brex APIs at https://platform.brexapis.com.

This project was cloned from mercury-cli and then reworked to use Brex endpoints from:

Install

bun install
bun run build

Run locally:

bun ./sources/main.ts --help

Authentication

Store an API access token locally:

brex login --token <ACCESS_TOKEN>
# or
cat token.txt | brex login --token-stdin

Token/config location:

  • ~/.brex/token
  • ~/.brex/config.json

Check status:

brex status

Commands

Accounts

brex accounts list --type all
brex accounts list --type cash --cursor <cursor>
brex accounts get <account-id> --type cash

Transactions

brex transactions <account-id> --type cash --limit 50
brex transactions <account-id> --type card --cursor <cursor>
brex transactions get <account-id> <transaction-id> --type cash

Transfers (Payments API)

brex transfer --from <cash-account-id> --to <counterparty-id> --amount 125.50 --idempotency-key <key>
brex transfer get <transfer-id>
brex transfer list --status PROCESSING --limit 20

Recipients (Payment Counterparties)

brex recipients list --limit 50
brex recipients add --name "Vendor A" --account 123456789 --routing 021000021 --account-type CHECKING
brex recipients get <counterparty-id>
brex recipients delete <counterparty-id>

Cards / Users / Organization

brex cards list --user-id <user-id>
brex cards get <card-id>

brex users list --cursor <cursor>
brex users get <user-id>

brex organization

Statements

# Primary card account
brex statements --scope primary
brex statements get <statement-id> --scope primary

# Additional card account
brex statements --scope additional --account-id <card-account-id>
brex statements get <statement-id> --scope additional --account-id <card-account-id>

Webhooks & Events

brex webhooks list
brex webhooks create --url https://example.com/webhooks/brex --events PAYMENT_COMPLETED,TRANSFER_COMPLETED
brex webhooks get <webhook-id>
brex webhooks update <webhook-id> --status ACTIVE
brex webhooks delete <webhook-id>

brex events list --event-type PAYMENT_COMPLETED --limit 25
brex events get <event-id>

Notes

  • brex transactions send is intentionally not used for outbound payments. Use brex transfer.
  • brex categories is currently a placeholder because there is no direct categories endpoint wired in this CLI.

Disclaimer

This is an unofficial CLI. Verify scopes, permissions, and request payload requirements in Brex docs before production use.

About

CLI for Brex Banking API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages