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

# MyTruv CLI

> Query your MyTruv financial data from the terminal.

## What is MyTruv CLI?

MyTruv CLI is a command-line tool for accessing your MyTruv financial data from the terminal. Check balances, pull transactions, review income, and analyze spending without leaving the shell. It authenticates via browser-based OAuth - no API keys or tokens to manage.

The project is open source at [github.com/truvhq/mytruv-cli](https://github.com/truvhq/mytruv-cli).

<Info>
  The CLI is **read-only**. It cannot modify your accounts, create transactions, or change any settings - the same guarantee as [MyTruv MCP](/mytruv-mcp/overview).
</Info>

***

## Prerequisites

* **Python 3.10+**
* A MyTruv account with at least one connected financial account

***

## Install

<Tabs>
  <Tab title="curl (recommended)">
    ```bash theme={null}
    curl -fsSL https://raw.githubusercontent.com/truvhq/mytruv-cli/master/scripts/install.sh | sh
    ```

    Installs to `~/.local/bin` by default. To install somewhere else, pass `INSTALL_DIR` to the piped shell:

    ```bash theme={null}
    curl -fsSL https://raw.githubusercontent.com/truvhq/mytruv-cli/master/scripts/install.sh | INSTALL_DIR=/usr/local/bin sh
    ```

    Linux binaries need glibc 2.35+ (Ubuntu 22.04, Debian 12, RHEL 9).
  </Tab>

  <Tab title="uv">
    ```bash theme={null}
    uv tool install git+https://github.com/truvhq/mytruv-cli.git
    ```

    Requires [uv](https://docs.astral.sh/uv/).
  </Tab>
</Tabs>

After installation, the `mytruv` command is on your `$PATH`. Startup is under 0.2 seconds on a warm cache.

To uninstall:

```bash theme={null}
rm "$(command -v mytruv)"
```

***

## Quick Start

```bash theme={null}
# 1. Log in (opens browser)
mytruv auth login

# 2. View your connected accounts
mytruv links

# 3. Check balances
mytruv balances

# 4. Pull recent transactions
mytruv transactions

# 5. Log out
mytruv auth logout
```

***

## Commands

### Authentication

| Command                          | Description                                                  |
| -------------------------------- | ------------------------------------------------------------ |
| `mytruv auth login`              | Authenticate via browser-based OAuth                         |
| `mytruv auth login --no-browser` | Print login URL (for headless/remote machines)               |
| `mytruv auth logout`             | Log out and revoke tokens                                    |
| `mytruv auth status`             | Show current authentication status (`{authenticated, user}`) |

### Financial Data

| Command                  | Description                                                                                                                                                                                   |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mytruv user`            | Your user profile, including `lifecycle` flags (subscription, onboarding, trial)                                                                                                              |
| `mytruv links`           | Paginated list of connected providers (`{count, next, previous, results}`)                                                                                                                    |
| `mytruv balances`        | Aggregated balances by account type (`{total_accounts, accounts, aggregated_balances}`)                                                                                                       |
| `mytruv liabilities`     | Aggregated liabilities for credit cards and loans (`{accounts, liabilities}`)                                                                                                                 |
| `mytruv transactions`    | Bank transactions, last 7 days by default (`--from`, `--to`, `--type`, `--account`, `--category`, `--min-amount`, `--max-amount`, `--merchant`, `--sort`, `--order`, `--page`, `--page-size`) |
| `mytruv spending`        | Spending breakdown by category/merchant/time-period (`--group-by`, `--time-period`, `--days`, `--start-date`, `--end-date`)                                                                   |
| `mytruv income`          | Income from payroll and bank sources, each tagged with `data_source` (`--days`, default 90)                                                                                                   |
| `mytruv recurring`       | Recurring transactions (subscriptions, deposits)                                                                                                                                              |
| `mytruv balance-history` | Balance trends over time (`--date-range` `1m\|3m\|6m\|1y\|all`, `--time-period` `day\|week\|month`)                                                                                           |
| `mytruv insights`        | AI-generated financial insights, rendered as title, summary, detail, and follow-up suggestions                                                                                                |

### Output formats

Every data command accepts:

| Flag                       | Behavior                                                |
| -------------------------- | ------------------------------------------------------- |
| `-o, --output [json\|csv]` | Force a format. Default: table on TTY, JSON when piped. |
| `--json`                   | Shorthand for `--output json`.                          |
| `--no-color`               | Disable ANSI colors (useful in CI).                     |

CSV output formats currency as strings (e.g. `"$1,234.56"`). For raw numbers, use JSON. `--output csv` on `transactions` streams directly from the server and supports up to 10,000 rows per export.

### MCP Server

| Command      | Description                                              |
| ------------ | -------------------------------------------------------- |
| `mytruv mcp` | Start an MCP stdio server for local AI agent integration |

See [Agent & Automation](/mytruv-cli/agent-automation) for the Gemini CLI extension setup.

### Shell Completion

| Command                  | Description                  |
| ------------------------ | ---------------------------- |
| `mytruv completion bash` | Print bash completion script |
| `mytruv completion zsh`  | Print zsh completion script  |
| `mytruv completion fish` | Print fish completion script |

Add to your shell config:

```bash theme={null}
# bash (~/.bashrc)
source <(mytruv completion bash)

# zsh (~/.zshrc)
source <(mytruv completion zsh)

# fish (~/.config/fish/config.fish)
mytruv completion fish | source
```

***

## Next steps

<CardGroup cols={2}>
  <Card title="Agent & Automation" icon="robot" href="/mytruv-cli/agent-automation">
    JSON output, exit codes, MCP stdio mode, Gemini extension
  </Card>

  <Card title="MyTruv MCP" icon="plug" href="/mytruv-mcp/overview">
    Hosted MCP server for remote AI assistants
  </Card>

  <Card title="GitHub Repo" icon="github" href="https://github.com/truvhq/mytruv-cli">
    Source, issues, and release notes
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    REST API for programmatic access
  </Card>
</CardGroup>
