CLI
The Treeline CLI (tl) provides terminal access to your financial data.
Installation
Section titled “Installation”macOS and Linux
Section titled “macOS and Linux”curl -fsSL https://treeline.money/install.sh | shWindows
Section titled “Windows”irm https://treeline.money/install.ps1 | iexRestart your terminal after installation. See the installation guide for more details.
Available Commands
Section titled “Available Commands”tl status- Show account status and summarytl sync- Sync accounts and transactions from integrationstl import- Import transactions from a CSV filetl query(ortl sql) - Execute SQL query against the databasetl tag- Apply tags to transactionstl backup- Manage backupstl compact- Compact the databasetl doctor- Run database health checkstl encrypt- Encrypt the databasetl decrypt- Decrypt the databasetl demo- Manage demo modetl setup- Set up integrations (SimpleFIN, Lunchflow)tl plugin- Manage pluginstl logs- View and manage application logstl help- Print help for any command
tl --help # Show all commandstl <command> -h # Help for a specific commandMost commands support --json for scripting.
Workflows
Section titled “Workflows”Automated Sync
Section titled “Automated Sync”Sync every morning at 8am:
crontab -e# Add:0 8 * * * ~/.treeline/bin/tl sync >> ~/.treeline/sync.log 2>&1With macOS notification:
#!/bin/bashresult=$(tl sync --json 2>&1)new_count=$(echo "$result" | jq -r '.results[0].transaction_stats.new // 0')if [ "$new_count" -gt 0 ]; then osascript -e "display notification \"$new_count new transactions\" with title \"Treeline\""fiCSV Import
Section titled “CSV Import”Import transactions from any bank’s CSV export:
# Auto-detect columns — works for most standard CSVstl import bank_export.csv --account "Chase Checking"
# Preview before importingtl import bank_export.csv --account "Chase Checking" --dry-run
# European bank with custom columns and number formattl import export.csv --account "Savings" \ --number-format eu \ --date-column "Buchungstag" \ --amount-column "Betrag" \ --skip-rows 3
# Credit card statement (charges shown as positive, need to flip)tl import amex.csv --account "Amex Gold" --flip-signs
# Separate debit/credit columns instead of a single amounttl import bank.csv --account "Checking" \ --debit-column "Debit" --credit-column "Credit"
# Import with balance column (creates balance snapshots automatically)tl import statement.csv --account "Checking" --balance-column "Balance"
# Save settings as a profile for repeated usetl import export.csv --account "Savings" \ --number-format eu --skip-rows 3 --save-profile deutsche-bank
# Reuse a saved profiletl import next_month.csv --account "Savings" --profile deutsche-bank
# Pipe from stdincat export.csv | tl import - --account "Checking"Column mappings are auto-detected from CSV headers. Explicit flags override auto-detection. Duplicate transactions are automatically skipped on re-import.
Flags reference: tl import --help
SQL Queries
Section titled “SQL Queries”tl sql is an alias for tl query — use whichever you prefer.
By default, queries run in read-only mode (the database is opened read-only). Use --allow-writes to enable write operations:
tl query "DELETE FROM transactions WHERE description = 'duplicate'" --allow-writesExport to CSV:
tl query --format csv "SELECT * FROM transactions WHERE transaction_date >= '2026-01-01'" > jan.csvMonthly summary:
tl sql "SELECT strftime('%Y-%m', transaction_date) as month, SUM(CASE WHEN amount < 0 THEN amount ELSE 0 END) as spent, SUM(CASE WHEN amount > 0 THEN amount ELSE 0 END) as income FROM transactions GROUP BY month ORDER BY month DESC LIMIT 6"Bulk Tagging
Section titled “Bulk Tagging”Tag all coffee purchases:
ids=$(tl query "SELECT transaction_id FROM transactions WHERE description ILIKE '%coffee%'" --format csv | tail -n +2 | tr '\n' ',')tl tag coffee --ids "$ids"Plugin Development
Section titled “Plugin Development”tl plugin new my-plugincd my-plugin && npm installnpm run buildtl plugin install .# Restart the app to load the pluginInstall from GitHub:
tl plugin install https://github.com/treeline-money/plugin-budget