
# Recipes

These use [jq](https://jqlang.org/) to read fob-actual's JSON. Amounts in JSON are integer minor units, so the recipes divide by 100.

## Export a year of transactions to CSV

```bash
fob-actual transactions list --account Checking \
  --from 2026-01-01 --to 2026-12-31 --format csv --output checking-2026.csv
```

## Spending by payee for a month

```bash
fob-actual query run --table transactions \
  --filter '{"date":{"$gte":"2026-09-01"}}' --filter '{"date":{"$lte":"2026-09-30"}}' \
  --filter '{"amount":{"$lt":0}}' --select payee.name,amount --json \
  | jq -r '.data | group_by(.["payee.name"]) | map({payee: .[0]["payee.name"], total: (map(.amount) | add / -100)}) | sort_by(-.total) | .[] | "\(.total)\t\(.payee)"'
```

```text
1800	Landlord
147.22	Corner Grocery
```

## Balances of every account

```bash
fob-actual accounts list --json | jq -r '.accounts[] | "\(.balance / 100)\t\(.name)"'
```

## Import a bank CSV

Convert the bank's CSV to Actual's JSON format (amounts in minor units), preview, then import:

```bash
# date,description,amount  →  [{ date, payee_name, amount }]
tail -n +2 bank.csv | jq -R -s '
  split("\n") | map(select(length > 0) | split(",")) |
  map({ date: .[0], payee_name: .[1], amount: ((.[2] | tonumber) * 100 | round) })' > import.json

fob-actual transactions import --account Checking --file import.json --dry-run
fob-actual transactions import --account Checking --file import.json
```

Real bank files often quote fields or use other date formats; adjust the conversion to match. Duplicate detection means running the import twice doesn't add the same transactions twice.

## Find uncategorized transactions

```bash
fob-actual query run --table transactions \
  --select date,account.name,payee.name,amount --filter '{"category":null}'
```

## Budget the same amount every month

```bash
CATEGORY=$(fob-actual categories list --json | jq -r '.categories[] | select(.name=="Groceries") | .id')
for m in 2026-10 2026-11 2026-12; do
  fob-actual budgets set-amount "$m" "$CATEGORY" --amount 450.00
done
```

## Work with a second budget

```bash
fob-actual accounts list --profile business
fob-actual transactions list --account Operating --profile business --format csv
```

See [Profiles](/docs/actual/cli/profiles).
