AtlatestRepositorytally
1
# tally3
Personal finance management CLI and MCP server. Pulls transactions from Wise,4
categorizes them, writes to hledger journal files, and generates financial5
summaries.7
## Features9
- Pull transactions from Wise API across all currency balances10
- Map Wise transactions to hledger journal format with proper double-entry bookkeeping11
- Deduplicate imports — safe to run repeatedly without double-counting12
- Run hledger reports (balance, register, income statement)13
- List uncategorized transactions for review14
- Dual-mode: works as both a CLI tool and an MCP server for AI-assisted bookkeeping16
## CLI Usage18
```19
tally serve Start MCP server20
tally pull [--since DATE] [--until DATE] [--profile TYPE]21
Pull transactions from Wise22
tally import [--journal FILE] [--since DATE] [--until DATE]23
Pull and write to journal24
tally balance [--profile TYPE] Show Wise balances25
tally report [--journal FILE] [--type bal|reg|is] [QUERY]26
Run hledger reports27
tally categorize [--journal FILE] List uncategorized transactions28
```30
### Examples32
```bash33
# Pull recent transactions34
tally pull --since 2026-03-01T00:00:00Z36
# Pull transactions within a date range37
tally pull --since 2026-01-01T00:00:00Z --until 2026-03-31T23:59:59Z39
# Import transactions to journal with deduplication40
tally import --journal finances.journal --since 2026-01-01T00:00:00Z42
# Check current Wise balances43
tally balance45
# Run a balance report46
tally report --type bal assets48
# Monthly income statement49
tally report --type is51
# List uncategorized transactions52
tally categorize --journal finances.journal53
```55
## MCP Server Tools57
When running as an MCP server (`tally serve`), the following tools are available:59
| Tool | Description |60
|------|-------------|61
| `tally/pull` | Pull recent transactions from Wise API |62
| `tally/import` | Pull and import new transactions into journal |63
| `tally/balance` | Show current Wise account balances |64
| `tally/report` | Run hledger reports (bal, reg, is) |65
| `tally/categorize` | List uncategorized transactions for review |67
## Configuration69
Environment variables:71
| Variable | Required | Description |72
|----------|----------|-------------|73
| `WISE_API_TOKEN` | Yes (for Wise operations) | Wise personal API token |74
| `TALLY_JOURNAL` | No | Default journal file path (default: `main.journal`) |75
| `TALLY_PROFILE` | No | Default Wise profile type: `personal` or `business` (default: `personal`) |77
## Account Mapping79
Wise transactions are mapped to hledger accounts as follows:81
- **Wise balances**: `assets:wise:{currency}` (e.g., `assets:wise:eur`, `assets:wise:usd`)82
- **Debit transactions**: `expenses:uncategorized` (re-categorize after import)83
- **Credit transactions**: `income:uncategorized` (re-categorize after import)85
Each imported transaction includes the Wise reference number as both a transaction86
code and a `ref` tag for deduplication.88
## Dependencies90
- [sigil-wise](https://codeberg.org/sigil/sigil-wise) — Wise API client library91
- [sigil-ledger](https://codeberg.org/sigil/sigil-ledger) — hledger journal read/write92
- [sigil-mcp](https://codeberg.org/sigil/sigil) — MCP server framework93
- [hledger](https://hledger.org/) — required on PATH for report commands95
## Building97
Requires a C toolchain. On Guix:99
```bash100
guix shell -m ../sigil/manifest.scm -- env CC=gcc sigil build --redirects dev-redirects.sgl101
```103
## Testing105
```bash106
guix shell -m ../sigil/manifest.scm -- env CC=gcc sigil test --redirects dev-redirects.sgl107
```109
Note: tests require a `lib` symlink to the build output for dependency resolution:111
```bash112
ln -s build/dev/lib lib113
```