> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redbark.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Read your bank and brokerage data from the terminal with the Redbark CLI

The Redbark CLI brings your accounts, balances, transactions, and brokerage data into the terminal — as clean tables for reading, or raw JSON for piping into scripts. It is a thin client over the [REST API](/api-reference/overview) and is [open source on GitHub](https://github.com/redbark-co/cli).

<Info>
  CLI access uses your API key, so it requires an active **Developer** or **Professional** plan — the same access as the REST API. Brokerage commands (`holdings`, `trades`) additionally require a **Professional** plan.
</Info>

## Install

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install -g @redbark/cli
    ```
  </Tab>

  <Tab title="bun">
    ```bash theme={null}
    bun install -g @redbark/cli
    ```
  </Tab>
</Tabs>

Runs on Node.js 18+ or Bun. Verify the install with `redbark --version`.

## Authentication

Create an API key at [app.redbark.com/settings](https://app.redbark.com/settings), then:

```bash theme={null}
redbark login
```

The key is verified against the API before being saved to `~/.config/redbark/config.json` with owner-only permissions (`0600`). It is only ever sent to `api.redbark.com` over HTTPS.

For scripts and CI, skip `login` and pass the key in the environment instead — it takes precedence over the saved config:

```bash theme={null}
REDBARK_API_KEY=rbk_live_… redbark accounts --json
```

Check your auth state at any time with `redbark whoami`, and remove the saved key with `redbark logout`.

## Commands

| Command                               | Description                                                           |
| ------------------------------------- | --------------------------------------------------------------------- |
| `redbark login`                       | Verify and save an API key                                            |
| `redbark logout`                      | Remove the saved key                                                  |
| `redbark whoami`                      | Auth status, key source, connection count, rate-limit headroom        |
| `redbark connections`                 | List bank and brokerage connections with status and freshness         |
| `redbark accounts`                    | List accounts (`--limit`, `--offset`)                                 |
| `redbark balances [accountIds…]`      | Live balances — every account when no ids are given                   |
| `redbark transactions --account <id>` | Transactions for an account (`--from`, `--to`, `--limit`, `--offset`) |
| `redbark categories`                  | The transaction category taxonomy                                     |
| `redbark holdings --connection <id>`  | Brokerage holdings — **Professional** plan                            |
| `redbark trades --connection <id>`    | Brokerage trades (`--from`, `--to`) — **Professional** plan           |

<Tip>
  `redbark transactions` only needs `--account` — the CLI resolves the owning connection for you. Pass `--connection` as well to skip the lookup.
</Tip>

## Examples

```bash theme={null}
# Balances across every connected account
redbark balances

# June's transactions for one account
redbark transactions --account acc_123 --from 2026-06-01 --to 2026-06-30

# Everything is scriptable with --json
redbark accounts --json | jq -r '.data[].name'

# Sum a month of spending
redbark transactions --account acc_123 --from 2026-06-01 --json \
  | jq '[.data[] | select(.direction == "debit") | .amount | tonumber] | add'
```

Tables are plain aligned text with no borders, so `grep` and `awk` work on them directly. Add `--json` to any command for the raw API response.

## Rate limits

The CLI is subject to the same [per-key rate limits](/api-reference/overview) as direct API calls. `redbark whoami` shows your remaining headroom, and the CLI honours `Retry-After` messaging when a limit is hit.

## Troubleshooting

| Problem                          | Fix                                                                                                 |
| -------------------------------- | --------------------------------------------------------------------------------------------------- |
| `not logged in`                  | Run `redbark login`, or set `REDBARK_API_KEY`                                                       |
| `Invalid or revoked API key`     | Create a fresh key at [app.redbark.com/settings](https://app.redbark.com/settings) and log in again |
| `403` on `holdings` / `trades`   | Brokerage data requires a **Professional** plan                                                     |
| `rate limited by the API`        | Wait for the shown retry interval; batch fewer accounts per call                                    |
| Balances show `—` for an account | The bank didn't return a balance on that live fetch — retry shortly                                 |

## Source

The CLI is Apache-2.0 licensed at [github.com/redbark-co/cli](https://github.com/redbark-co/cli). Bug reports and PRs are welcome; security issues go to [security@redbark.com](mailto:security@redbark.com) per the repo's SECURITY.md.
