diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-30 12:53:01 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-30 12:53:01 +0200 |
| commit | 2db11aa5d34766e4d23ccc308c57c470b6aa6dba (patch) | |
| tree | aa30c498fc23da90a31c72024146066c7dd8223f /firefly_cli | |
| parent | a257b55fe44535af7f8f9197c018154c2441f9ab (diff) | |
| download | firefly-cli-2db11aa5d34766e4d23ccc308c57c470b6aa6dba.tar.gz firefly-cli-2db11aa5d34766e4d23ccc308c57c470b6aa6dba.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'firefly_cli')
| -rw-r--r-- | firefly_cli/commands/transaction.py | 3 |
1 files changed, 2 insertions, 1 deletions
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", |
