From 2db11aa5d34766e4d23ccc308c57c470b6aa6dba Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 30 Jun 2026 12:53:01 +0200 Subject: tx add: auto-create categories instead of requiring them 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 --- firefly_cli/commands/transaction.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'firefly_cli/commands/transaction.py') diff --git a/firefly_cli/commands/transaction.py b/firefly_cli/commands/transaction.py index 7d48f78..be8d281 100644 --- a/firefly_cli/commands/transaction.py +++ b/firefly_cli/commands/transaction.py @@ -45,7 +45,8 @@ def cmd_add(args, ctx): "destination_id": dst["id"], } if args.category: - split["category_name"] = ctx.resolver.category(args.category).get("name", args.category) + # Pass name raw; Firefly auto-creates the category if it doesn't exist. + split["category_name"] = args.category if args.tags: split["tags"] = [t.strip() for t in args.tags.split(",") if t.strip()] resp = ctx.client.request("POST", "/api/v1/transactions", -- cgit v1.2.3