Skip to content

CLI for Agents

The tl CLI is designed for programmatic use. Every command supports --json for structured output, making it easy for agents to parse results and chain operations.

Add --json to any command for machine-readable output:

Terminal window
tl status --json
{
"total_accounts": 3,
"total_transactions": 847,
"total_snapshots": 920,
"total_integrations": 1,
"integration_names": ["simplefin"],
"accounts": [
{ "id": "a1b2c3d4-...", "name": "Checking (1234)", "institution_name": "First National Bank" },
{ "id": "e5f6a7b8-...", "name": "Rewards Card (5678)", "institution_name": "Example Credit Union" }
],
"date_range": { "earliest": "2025-06-20", "latest": "2026-03-10" }
}

Query results use a columns + rows format:

Terminal window
tl query "SELECT posted_date, amount, description FROM transactions LIMIT 2" --json
{
"columns": ["posted_date", "amount", "description"],
"rows": [
["2025-10-02", -45.30, "WHOLE FOODS MARKET #10234"],
["2025-10-05", -12.75, "CORNER COFFEE SHOP"]
],
"row_count": 2
}
CommandDescription
tl status --jsonAccount balances, transaction counts, integrations
tl schema --jsonDatabase schema (tables, views, columns, types)
tl query "SQL" --jsonRead-only SQL query (database opened read-only)
tl skills list --jsonList user-created skills
tl skills read <path>Read a skill file
tl doctor --jsonDatabase health checks
CommandDescription
tl query "SQL" --allow-writesSQL with write access (INSERT, UPDATE, DELETE)
tl sync --jsonSync from connected bank integrations
tl tag <tag> --ids "id1,id2"Apply tags to transactions
tl import file.csv --account "Name"Import transactions from CSV
Terminal window
# List all tables and views with their columns
tl schema --json
# Describe a specific table or view
tl schema transactions --json

The tl schema command is purpose-built for agents — it returns structured JSON with table names, types, column names, data types, and nullability. See the Database Schema reference for documentation.

By default, tl query opens the database in read-only mode. This means agents can freely explore data without risk of accidental modification:

Terminal window
# Safe — database opened read-only
tl query "SELECT SUM(-amount) FROM transactions WHERE tags @> ['groceries']" --json
# Requires explicit opt-in
tl query "UPDATE sys_transactions SET tags = ['food'] WHERE description ILIKE '%grocery%'" --allow-writes

The MCP server enforces this same separation with distinct query (read-only) and query_write (write-enabled) tools.

Terminal window
tl query "SELECT * FROM transactions LIMIT 5" # Table (human-readable)
tl query "SELECT * FROM transactions LIMIT 5" --json # JSON (for agents)
tl query "SELECT * FROM transactions LIMIT 5" --format csv # CSV (for export)

Query errors are returned as plain text on stderr:

Terminal window
tl query "SELECT * FROM nonexistent_table" --json
Catalog Error: Table with name nonexistent_table does not exist!

Agents should check the exit code (non-zero on failure) and parse stderr for error details.