A CLI for querying your bank accounts, balances, and transactions via the TrueLayer Open Banking API.
- Create a TrueLayer account and register an application at console.truelayer.com
- Build the CLI:
go build -o txn .- Authenticate with your bank:
./txn authThis opens a browser flow to link your bank account via TrueLayer. Credentials are stored in ~/.config/txn/config.json.
./txn accounts # List linked bank accounts
./txn balance # Show current balance
./txn transactions # Show recent transactions
./txn export # Export all transactions to JSON
./txn analyse # Analyse spending from exported data
./txn sync # Pull latest transactionsCopy profile.example.json to ~/.config/txn/profile.json and fill in your details to enable personalised analysis:
- income — gross annual and net monthly take-home
- debts — creditors, balances, rates, monthly payments
- fixed_costs — rent, bills, insurance (matched by transaction description)
- debt_patterns — how debt repayments appear in your transactions
- subscriptions — known recurring subscriptions
- rent_contribution — if someone contributes to your rent
- transfers — patterns for transfers to categorise (people, self, business)
- events — future cost changes or scheduled lump-sum payments
- strategy — debt repayment method and priority order
Match types for patterns: exact, exact_ci (case-insensitive), contains_ci.
Without a profile, basic transaction viewing and export still work. The analysis commands will show less detail.
All personal data is stored in ~/.config/txn/ and never committed to the repo:
| File | Purpose |
|---|---|
config.json |
TrueLayer API credentials |
profile.json |
Your financial profile |
transactions.json |
Exported transaction data |
notes.json |
Dashboard notes |