aboutsummaryrefslogtreecommitdiffstats
path: root/firefly_cli/commands/transaction.py
AgeCommit message (Collapse)AuthorFilesLines
20 hoursfeat: tx list --flat, account create --if-not-exists, --since/--until doc ↵v0.3.6Danilo M.1-2/+11
(v0.3.6) Three smaller ISSUES.md items, one PATCH (two optional flags + a doc fix; no existing caller or JSON shape changes). - tx list --flat: emit one top-level object per split (journal id repeated), dropping the transactions[] nesting so single-split journals script cleanly. JSON-only; --human already explodes splits into a table. - account create --if-not-exists: resolve the name first; on a clash return the existing account with "existed": true (exit 0) instead of surfacing Firefly's 422, so import scripts are idempotent. Detects via resolver, not by parsing the error string. - SKILL.md documents that --since/--until filter on the transaction date (the value date); Firefly journals have a single date field, no separate book date (verified against firefly-iii TimeCollection setRange). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 hoursfeat: tx add echoes transfer direction to stderr (v0.3.5)v0.3.5Danilo M.1-0/+7
Transfers are easy to reverse silently (swapped --from/--to), showing up later as a 2x balance discrepancy (ISSUES.md #5). On a transfer, tx add now prints "transfer: <from> → <to>, <amount>" to stderr before writing, in both the real-write and --dry-run paths. stdout JSON and exit codes are unchanged, so the contract holds; PATCH bump. Withdrawals/deposits are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 hoursfeat: tx add --skip-dupes for idempotent imports (v0.3.4)Danilo M.1-0/+14
Re-running an import (a retried or double-read batch) created phantom duplicate transactions and drifted balances, with no signal. --skip-dupes searches for an existing tx with the same amount + date + source + destination before writing; on a match it emits {"skipped": "duplicate", "matched_id": "<id>"} and exits 0 without writing. Off by default (one extra search per add only when set). dry-run wins over skip-dupes: a preview never triggers the search. Match is amount+date+ accounts, not description, so genuinely distinct same-value same-day transfers between the same accounts look like duplicates; documented. Also document a Firefly quirk in SKILL.md: a missing/deleted transaction id returns 401 (not 404) on tx get/edit/delete, so a 401 after delete confirms the record is gone rather than signalling an auth failure. Verified live on the test instance: create -> identical --skip-dupes skips with matched_id and no write, --dry-run --skip-dupes previews without searching, no-match --skip-dupes writes; records cleaned up after. PATCH: new optional flag, contract unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 hoursfeat: tx add --dry-run to validate before writing (v0.3.3)Danilo M.1-0/+6
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 <noreply@anthropic.com>
22 hoursfeat: tx list --all + truncation signal (v0.3.1)Danilo M.1-0/+20
tx list silently returned only --limit rows (default 20) with no signal when more matched, making a correct ledger look wrong during reconciliation. - --all auto-paginates every page via meta.pagination.total_pages - without --all, print "showing N of M (use --all for all)" to stderr when the result is truncated (stdout JSON stays clean) PATCH: new optional flag + stderr note, contract unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 hoursfeat: add tx edit and tx delete (v0.3.0)v0.3.0Danilo M.1-0/+51
Implements ISSUES.md #1, the missing other half of an import tool: correcting and removing mis-imported transactions without the web UI. - tx edit <id>: PATCH a single-split journal; only the fields passed are sent (--amount/--date/--desc/--from/--to/--category/--tags/--type). Errors if no field is given. Accounts resolve to ids; category/tags pass raw. - tx delete <id>: requires --yes (no interactive prompt, agent-first); prints {"deleted": "<id>"} on success. Also fix gen_completion.py: running it as a script put scripts/ on sys.path[0] and imported the installed (stale) firefly_cli, so the generated completion drifted (missing account balance/get, tx get/search). Prepend the repo root so the documented regen command uses this tree. The regenerated completion now reflects the full command surface. MINOR bump per the contract-keyed scheme: new commands, no breaking change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
41 hourshelp, completion: descriptive help text and bash completionv0.2.1Danilo M.1-4/+4
Add group/leaf descriptions to argparse help and richer command help strings. Add generated bash completion (completions/firefly.bash) plus its generator (scripts/gen_completion.py), wired into the command checklist in CLAUDE.md and documented in the README. Bump to 0.2.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
43 hourstx add: auto-create categories instead of requiring themDanilo M.1-1/+2
Pass --category straight to Firefly III as category_name; the API creates the category if it does not exist, matching --tags behavior. Drops the resolver lookup that turned an unknown category into a hard error. Accounts still resolve strictly (real money). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
45 hoursfeat: transaction add/list/get/search with type inferenceDanilo M.1-0/+95