A command-line interface for Monarch Money, a personal finance platform that helps you track spending, manage budgets, and monitor your net worth across all your accounts in one place.
Disclaimer: This is an unofficial, community-maintained project and is not affiliated with, endorsed by, or connected to Monarch Money in any way.
- 🔐 Secure authentication with session persistence (keyring or file storage)
- 📊 Multiple output formats (plain, JSON, table, CSV, NDJSON) for flexible processing
- 🔧 Scriptable - structured JSON output auto-detected when piped
- 📅 Smart date presets (
--preset this-month,--preset ytd) - ✏️ Transaction updates with dry-run preview support
- 🔄 Account refresh to sync latest data from institutions
pip install monarch-cliuv tool install monarch-clipipx install monarch-climonarch --version# Interactive login (prompts for email/password) monarch auth login # Check authentication status monarch auth status# Human-readable format monarch accounts list # JSON format for scripting monarch accounts list --json# Recent transactions monarch transactions list # This month's transactions monarch transactions list --preset this-month # Search for specific transactions monarch transactions list --search "coffee" --limit 20# Current budget status monarch budgets list # As JSON for processing monarch budgets list --json| Option | Short | Description |
|---|---|---|
--version | -v | Show version and exit |
--verbose | -V | Show operational progress messages |
--debug | Show stack traces on errors | |
--json | Output in JSON format | |
--quiet | -q | Output only IDs, one per line |
--no-color | Disable colored output | |
--help | Show help and exit |
Authentication management commands.
monarch auth login # Interactive login monarch auth login -s keyring # Use system keyring storage monarch auth login -s file # Use file-based storage monarch auth status # Check authentication status monarch auth logout # Log out and clear credentials monarch auth ping # Test API connectivity monarch auth doctor # Diagnose authentication setup monarch auth setup # Show setup instructionsmonarch accounts list # List all linked accounts monarch accounts list --json # JSON format monarch accounts list --format table # Table format monarch accounts list --raw # Raw API response monarch accounts refresh # Refresh all account data monarch accounts refresh ACC123 # Refresh specific account# List with filters monarch transactions list monarch transactions list --limit 50 --offset 0 monarch transactions list --preset this-month monarch transactions list --start 2024-01-01 --end 2024-01-31 monarch transactions list --account ACC123 monarch transactions list --search "grocery" # Update a transaction monarch transactions update TXN123 --amount 25.50 monarch transactions update TXN123 --description "Coffee Shop" monarch transactions update TXN123 --category CAT456 monarch transactions update TXN123 --notes "Business expense" monarch transactions update TXN123 --date 2024-01-15 monarch transactions update TXN123 --dry-run --amount 30.00 # Preview # Batch update multiple transactions monarch transactions batch-update TXN1 TXN2 TXN3 --category CAT456Date Presets:
today,yesterdaythis-week,last-weekthis-month,last-monthlast-30-days,last-90-daysthis-year,last-year,ytdall
monarch budgets list # Budget status with spent/remaining monarch budgets list --json # JSON format monarch budgets list --format tablemonarch cashflow summary # Current period monarch cashflow summary --preset this-month # This month monarch cashflow summary --preset ytd # Year to date monarch cashflow summary -s 2024-01-01 -e 2024-12-31 # Date rangemonarch categories list # All transaction categories monarch categories list --json # JSON formatMonarch CLI supports multiple output formats for different use cases:
| Format | Description | Best For |
|---|---|---|
plain | Human-readable text | Terminal display |
json | Pretty-printed JSON | Scripts, parsing |
table | Rich table format | Terminal display |
csv | Comma-separated values | Spreadsheets |
compact | Minimal JSON | Compact storage |
ndjson | Newline-delimited JSON | Stream processing |
# Explicit format selection monarch accounts list --format json monarch accounts list --format table monarch accounts list --format csv # Shorthand for JSON monarch accounts list --json # Auto-detection: JSON when piped monarch accounts list | jq '.[0]'Monarch CLI uses a layered configuration system (similar to Git, kubectl, Docker):
Config File → Environment Variables → CLI Flags (lowest precedence) (highest precedence) Each layer overrides the previous, giving you flexible control over defaults and per-command behavior.
Create ~/.config/monarch-cli/config.toml to set persistent defaults:
# Output format: plain, json, table, csv, compact format = "plain" # Enable colored output (respects NO_COLOR env var) color = true # Show operational progress messages verbose = false # API request timeout in seconds timeout = 30 # Number of retry attempts for transient failures max_retries = 3Environment variables override config file values:
| Variable | Description | Default |
|---|---|---|
MONARCH_TOKEN | Session token for authentication | - |
MONARCH_CONFIG_DIR | Directory for config files | ~/.config/monarch-cli |
MONARCH_SESSION_PATH | Path to session file | <config_dir>/session.json |
MONARCH_FORMAT | Default output format (plain, json, table, csv, compact) | plain |
MONARCH_VERBOSE | Enable verbose output (1, true, yes) | false |
MONARCH_DEBUG | Enable debug mode with stack traces | false |
MONARCH_QUIET | Output only IDs, one per line | false |
MONARCH_TIMEOUT | API timeout in seconds | 30 |
MONARCH_MAX_RETRIES | Max API retry attempts | 3 |
MONARCH_NO_COLOR | Disable colored output | false |
NO_COLOR | Standard color disable (no-color.org) | - |
CLI flags override both config file and environment variables:
# Override format for this command monarch accounts list --json # Override timeout for slow connections monarch transactions list --timeout 60 # Disable color for this command monarch accounts list --no-color # Enable verbose output monarch accounts list --verboseSession credentials are resolved in this order:
MONARCH_TOKENenvironment variable- System keyring (if available)
- Session file (
~/.config/monarch-cli/session.json)
Monarch CLI is designed for scripting and automation. When output is piped (non-TTY), it automatically outputs JSON:
# Auto-JSON when piped ACCOUNTS=$(monarch accounts list | jq '.') # Explicit JSON mode monarch transactions list --json --preset this-month # Quiet mode for IDs only monarch accounts list --quiet # Output: # ACC123456 # ACC789012import subprocess import json def get_transactions(preset="this-month"): result = subprocess.run( ["monarch", "transactions", "list", "--preset", preset, "--json"], capture_output=True, text=True ) return json.loads(result.stdout) def categorize_transaction(transaction_id, category_id): subprocess.run([ "monarch", "transactions", "update", transaction_id, "--category", category_id ]) # Get this month's transactions for analysis transactions = get_transactions("this-month") print(f"Found {len(transactions)} transactions")These output fields are guaranteed stable across versions:
Accounts: id, name, balance, type, is_active, institution, last_synced
Transactions: id, date, amount, description, category, account_id, is_pending, notes
Enable tab completion for commands, options, and arguments:
monarch --install-completion bash source ~/.bashrcmonarch --install-completion zsh source ~/.zshrcmonarch --install-completion fish source ~/.config/fish/completions/monarch.fishmonarch <TAB> # Shows: accounts auth budgets cashflow categories transactionsRun the diagnostic command to identify problems:
monarch auth doctorThis checks:
- Session file existence and permissions
- Token validity
- API connectivity
- Keyring availability
"Not authenticated" error:
# Re-authenticate monarch auth login # Or check status first monarch auth statusConnection timeout:
# Increase timeout MONARCH_TIMEOUT=60 monarch accounts list # Or check connectivity monarch auth pingKeyring not available (headless systems):
# Use file storage instead monarch auth login -s fileFor detailed error information:
monarch --debug accounts listgit clone https://github.com/crcatala/monarch-cli.git cd monarch-cli # Install with dev dependencies make setup # Or manually: uv sync --all-extrasmake test # Run tests make test-cov # Tests with coverage make lint # Lint and type check make verify # All checks (pre-commit)Git hooks are managed with prek:
uv run prek install # Install hooksReleases are a two-step process:
-
Create GitHub Release (tags, changelog, artifacts):
make release-dry # Preview first make release # Create release
-
Publish to PyPI (separate step):
uv run twine upload dist/*
See docs/RELEASING.md for full instructions including TestPyPI setup and troubleshooting.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run
make verifyto ensure all checks pass - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE for details.
- monarchmoney - The community Python library for Monarch Money API
- Typer - CLI framework
- Rich - Terminal formatting