{
  "markdown": "# mytruv\n\nCommand-line interface for accessing your [MyTruv](https://mytruv.com) financial data.\n\nAuthenticate with your MyTruv account via browser-based OAuth and query balances, transactions, income, spending, and more — all from the terminal.\n\n## Install\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/truvhq/mytruv-cli/master/scripts/install.sh | sh\n```\n\nTo install to a custom location, pass `INSTALL_DIR` to the piped shell:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/truvhq/mytruv-cli/master/scripts/install.sh | INSTALL_DIR=/usr/local/bin sh\n```\n\nOr with [uv](https://docs.astral.sh/uv/):\n\n```bash\nuv tool install git+https://github.com/truvhq/mytruv-cli.git\n```\n\nInstalls to `~/.local/bin` by default. Linux binaries need glibc 2.35+ (Ubuntu 22.04, Debian 12, RHEL 9). The binary is a self-extracting bundle that unpacks to `~/.cache/nuitka-onefile/` on first run — set `NUITKA_ONEFILE_TEMPDIR` to override if `$HOME` is read-only.\n\nTo uninstall:\n\n```bash\nrm \"$(command -v mytruv)\"\n```\n\n## Quick Start\n\n```bash\nmytruv auth login          # authenticate via browser\nmytruv links               # list connected accounts\nmytruv balances            # check balances\nmytruv transactions        # pull recent transactions\nmytruv auth logout         # log out\n```\n\n## Commands\n\n### Authentication\n\n| Command | Description |\n|---|---|\n| `mytruv auth login` | Authenticate via browser-based OAuth |\n| `mytruv auth login --no-browser` | Print login URL (for headless/remote machines) |\n| `mytruv auth logout` | Log out and revoke tokens |\n| `mytruv auth status` | Show current authentication status |\n\n### Financial Data\n\n| Command | Description |\n|---|---|\n| `mytruv user` | Show your user profile |\n| `mytruv links` | List connected bank accounts and payroll providers |\n| `mytruv balances` | Aggregated balances by account type |\n| `mytruv liabilities` | Aggregated liabilities (credit cards, loans) |\n| `mytruv transactions` | Bank transactions (supports `--from`, `--to`, `--categories`, `--page`) |\n| `mytruv spending` | Spending analysis (supports `--group-by`, `--days`, `--time-period`, `--start-date`, `--end-date`) |\n| `mytruv income` | Income report from payroll and bank sources (supports `--days`) |\n| `mytruv recurring` | Recurring transactions (subscriptions, deposits) |\n| `mytruv balance-history` | Balance trends over time (supports `--date-range`, `--time-period`) |\n\n### Shell Completion\n\n| Command | Description |\n|---|---|\n| `mytruv completion bash` | Print bash completion script |\n| `mytruv completion zsh` | Print zsh completion script |\n| `mytruv completion fish` | Print fish completion script |\n\nAdd to your shell config:\n\n```bash\n# bash (~/.bashrc)\nsource <(mytruv completion bash)\n\n# zsh (~/.zshrc)\nsource <(mytruv completion zsh)\n\n# fish (~/.config/fish/config.fish)\nmytruv completion fish | source\n```\n\n### MCP Server\n\n| Command | Description |\n|---|---|\n| `mytruv mcp` | Start MCP stdio server for AI agent integration |\n\n### Global Options\n\n| Option | Description |\n|---|---|\n| `--version` | Show version |\n| `--help` | Show help |\n\n## Environment Variables\n\n| Variable | Description |\n|---|---|\n| `MYTRUV_CONFIG_DIR` | Override the config directory (default: `~/.config/mytruv`). |\n\n## Agent / Automation Usage\n\nmytruv is designed to be used by AI agents and scripts:\n\n- **stdout** carries data in the selected format: JSON by default when piped, or CSV with `--output csv`\n- **stderr** carries human-friendly messages (colors, tables, warnings) and structured error JSON on failure\n- **Exit code** signals success or failure; parse `stderr` for error details\n\n| Code | Meaning |\n|---|---|\n| `0` | Success |\n| `1` | Error (API error, network error, etc.) |\n| `2` | Authentication required |\n\nError format (emitted on **stderr**, never on stdout):\n```json\n{\"error\": \"auth_required\", \"message\": \"Not authenticated. Run 'mytruv auth login' first.\"}\n```\n\n### Examples\n\n```bash\n# Parse balances with jq\nmytruv balances | jq '.aggregated_balances[] | select(.type == \"CHECKING\")'\n\n# Get transaction count\nmytruv transactions | jq '.count'\n\n# Check if authenticated (exit code 0 = yes)\nmytruv auth status | jq -e '.authenticated' > /dev/null 2>&1 && echo \"logged in\"\n\n# Use in a script\nif ! mytruv auth status | jq -e '.authenticated' > /dev/null 2>&1; then\n    echo \"Please run: mytruv auth login\"\n    exit 1\nfi\n```\n\n### Interactive vs Piped\n\n```bash\nmytruv balances                      # TTY: table on stderr, stdout empty\nmytruv balances --json               # JSON on stdout, even in a TTY\nmytruv balances --output csv         # CSV on stdout\nmytruv balances | cat                # piped: JSON on stdout (auto-detected)\nmytruv balances > balances.json      # persist JSON to a file\n```\n\n## Gemini CLI Extension\n\nmytruv works as a [Gemini CLI](https://github.com/google-gemini/gemini-cli) extension, giving Gemini access to your financial data through the MCP protocol.\n\nInstall the `mytruv` CLI first (see [Install](#install)) so it's on your `$PATH`, then:\n\n```bash\ngemini extensions install https://github.com/truvhq/mytruv-cli\n```\n\n## How Authentication Works\n\n`mytruv auth login` opens your browser for secure OAuth login. Tokens refresh automatically — no need to re-login unless your session fully expires.\n\n## Requirements\n\n- Python 3.10+\n- A MyTruv account with at least one connected financial account\n\n## License\n\nMIT\n",
  "bytes": 5379,
  "sha": "2cf60c32ae2df1dfb6f2a070dde0474ae4b35b54035bc17b2312514e36420f50",
  "repo_slug": "truvhq/mytruv-cli",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_truvhq_mytruv_cli_b825a723/readme"
}