From 69647b1ca6f2e11429850b0782c65d04b86509cb Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 1 Jul 2026 10:40:32 +0200 Subject: feat: tx add --dry-run to validate before writing (v0.3.3) An agent importing rows in a loop could fail mid-batch: a --to account that didn't exist yet errored after earlier rows had already been written, leaving a half-applied batch to clean up by hand. --dry-run resolves --from/--to and infers the type but sends nothing, printing {"dry_run": true, "would_send": {...}}. A missing account stays a hard error (exit 1) so the agent can dry-run every row first, create the accounts the errors name, then run the batch for real. No batch input mode: the agent already owns the loop. Verified live read-only: valid accounts emit would_send and write nothing (search confirms []), missing account exits 1 with the candidate list. PATCH: new optional flag, contract unchanged. Co-Authored-By: Claude Opus 4.8 --- SKILL.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'SKILL.md') diff --git a/SKILL.md b/SKILL.md index 672c97e..42d5fb4 100644 --- a/SKILL.md +++ b/SKILL.md @@ -56,7 +56,7 @@ firefly account balance [--at YYYY-MM-DD] firefly account create --type asset|expense|revenue [--opening-balance N] [--currency CODE] firefly tx add --from --to - [--desc TEXT] [--date YYYY-MM-DD] [--category NAME] [--tags a,b] [--type T] + [--desc TEXT] [--date YYYY-MM-DD] [--category NAME] [--tags a,b] [--type T] [--dry-run] firefly tx edit [--amount N] [--date YYYY-MM-DD] [--desc TEXT] [--from ] [--to ] [--category NAME] [--tags a,b] [--type T] # only fields passed are changed @@ -102,6 +102,14 @@ Supports asset, expense, revenue. asset accounts get the default role automatically. Unlike categories/tags, accounts are NOT auto-created by `tx add`, create them explicitly here first. +**Validate a batch before writing any of it:** when importing many rows in a +loop, a mid-batch failure (a `--to` account that doesn't exist yet) leaves the +earlier rows already written. Dry-run each row first so the whole batch fails +fast: `tx add ... --dry-run` resolves `--from`/`--to` and infers the type but +sends nothing, printing `{"dry_run": true, "would_send": {...}}`. A missing +account is still a hard error (exit 1). Recipe: dry-run every row, create any +accounts the errors name, then run the batch for real. + **Check a balance:** ```bash firefly account balance test01 # -> {"id","name","current_balance"} -- cgit v1.2.3