Skip to content

CLI

The Treeline CLI (tl) provides terminal access to your financial data.

Terminal window
curl -fsSL https://treeline.money/install.sh | sh
Terminal window
irm https://treeline.money/install.ps1 | iex

Restart your terminal after installation. See the installation guide for more details.

  • tl status - Show account status and summary
  • tl sync - Sync accounts and transactions from integrations
  • tl import - Import transactions from a CSV file
  • tl query (or tl sql) - Execute SQL query against the database
  • tl tag - Apply tags to transactions
  • tl backup - Manage backups
  • tl compact - Compact the database
  • tl doctor - Run database health checks
  • tl encrypt - Encrypt the database
  • tl decrypt - Decrypt the database
  • tl demo - Manage demo mode
  • tl setup - Set up integrations (SimpleFIN, Lunchflow)
  • tl plugin - Manage plugins
  • tl logs - View and manage application logs
  • tl help - Print help for any command
Terminal window
tl --help # Show all commands
tl <command> -h # Help for a specific command

Most commands support --json for scripting.

Sync every morning at 8am:

Terminal window
crontab -e
# Add:
0 8 * * * ~/.treeline/bin/tl sync >> ~/.treeline/sync.log 2>&1

With macOS notification:

#!/bin/bash
result=$(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\""
fi

Import transactions from any bank’s CSV export:

Terminal window
# Auto-detect columns — works for most standard CSVs
tl import bank_export.csv --account "Chase Checking"
# Preview before importing
tl import bank_export.csv --account "Chase Checking" --dry-run
# European bank with custom columns and number format
tl 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 amount
tl 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 use
tl import export.csv --account "Savings" \
--number-format eu --skip-rows 3 --save-profile deutsche-bank
# Reuse a saved profile
tl import next_month.csv --account "Savings" --profile deutsche-bank
# Pipe from stdin
cat 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

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:

Terminal window
tl query "DELETE FROM transactions WHERE description = 'duplicate'" --allow-writes

Export to CSV:

Terminal window
tl query --format csv "SELECT * FROM transactions WHERE transaction_date >= '2026-01-01'" > jan.csv

Monthly summary:

Terminal window
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"

Tag all coffee purchases:

Terminal window
ids=$(tl query "SELECT transaction_id FROM transactions WHERE description ILIKE '%coffee%'" --format csv | tail -n +2 | tr '\n' ',')
tl tag coffee --ids "$ids"
Terminal window
tl plugin new my-plugin
cd my-plugin && npm install
npm run build
tl plugin install .
# Restart the app to load the plugin

Install from GitHub:

Terminal window
tl plugin install https://github.com/treeline-money/plugin-budget