| name | mercury |
| description | Manage Mercury via CLI - accounts, transactions, transfers, recipients, invoices, customers, webhooks, org. Use when user mentions 'mercury', 'bank account', 'transactions', 'transfers', or 'invoices'. |
| category | banking |
mercury-cli
Setup
If mercury-cli is not found, install and build it:
bun --version || curl -fsSL https://bun.sh/install | bash
npx api2cli bundle mercury
npx api2cli link mercury
api2cli link adds ~/.local/bin to PATH automatically. The CLI is available in the next command.
Always use --json flag when calling commands programmatically.
Authentication
mercury-cli auth set "your-token"
mercury-cli auth test
Resources
accounts
| Command | Description |
|---|
mercury-cli accounts list --json | List all bank accounts |
mercury-cli accounts list --fields id,name --json | List accounts with specific columns |
mercury-cli accounts get <account-id> --json | Get account details by ID |
mercury-cli accounts cards <account-id> --json | List cards for an account |
mercury-cli accounts statements <account-id> --json | Get account statements |
transactions
| Command | Description |
|---|
mercury-cli transactions list <account-id> --json | List transactions for account |
mercury-cli transactions list <account-id> --limit 10 --json | List with pagination limit |
mercury-cli transactions list <account-id> --start 2024-01-01 --end 2024-12-31 --json | Filter by date range |
mercury-cli transactions list <account-id> --status pending --json | Filter by status |
mercury-cli transactions list <account-id> --search "Stripe" --json | Search transactions |
mercury-cli transactions all --json | List all transactions across accounts |
mercury-cli transactions all --limit 50 --json | List all with limit |
mercury-cli transactions get <transaction-id> --json | Get transaction details |
transfers
| Command | Description |
|---|
mercury-cli transfers create --recipient-id <id> --amount 10000 --json | Create a transfer |
mercury-cli transfers create --account-id <id> --recipient-id <id> --amount 5000 --json | Transfer from specific account |
mercury-cli transfers create --recipient-id <id> --amount 10000 --payment-method ach --json | Create transfer with method |
mercury-cli transfers create --recipient-id <id> --amount 10000 --note "Invoice payment" --json | Create transfer with note |
mercury-cli transfers create --recipient-id <id> --amount 10000 --idempotency-key <key> --json | Create with idempotency key |
recipients
| Command | Description |
|---|
mercury-cli recipients list --json | List all recipients |
mercury-cli recipients list --fields id,name --json | List with specific columns |
mercury-cli recipients get <recipient-id> --json | Get recipient details |
mercury-cli recipients create --name "Acme Corp" --email billing@acme.com --json | Create recipient |
mercury-cli recipients create --name "Acme Corp" --payment-method ach --routing-number 123456789 --account-number 987654321 --json | Create ACH recipient |
invoices
| Command | Description |
|---|
mercury-cli invoices list --json | List all invoices |
mercury-cli invoices list --fields id,amount --json | List with specific columns |
mercury-cli invoices get <invoice-id> --json | Get invoice details |
mercury-cli invoices create --customer-id <id> --amount 50000 --due-date 2025-01-31 --json | Create invoice |
mercury-cli invoices create --customer-id <id> --amount 10000 --description "Consulting" --json | Create with description |
customers
| Command | Description |
|---|
mercury-cli customers list --json | List all customers |
mercury-cli customers list --fields id,name --json | List with specific columns |
mercury-cli customers get <customer-id> --json | Get customer details |
webhooks
| Command | Description |
|---|
mercury-cli webhooks list --json | List all webhooks |
mercury-cli webhooks list --fields id,url --json | List with specific columns |
mercury-cli webhooks create --url https://example.com/webhook --json | Create webhook |
mercury-cli webhooks create --url https://example.com/webhook --events "transaction.created,transaction.updated" --json | Create with events |
mercury-cli webhooks create --url https://example.com/webhook --secret <secret> --json | Create with secret |
org
| Command | Description |
|---|
mercury-cli org info --json | Get organization info |
mercury-cli org categories --json | List expense categories |
mercury-cli org categories --fields id,name --json | List categories with columns |
Global Flags
All commands support: --json, --format <text|json|csv|yaml>, --verbose, --no-color, --no-header