You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A fast, type-safe command-line client for Firefly III, built with Swift 6 and swift-argument-parser. Manage accounts and transactions without leaving your terminal. ๐
โจ Features
Feature
Description
๐ฆ accounts list
List accounts with balances in an aligned table
๐งพ transactions list
List transactions with --limit and --account filters
โ transactions create
Create a single-split transaction (withdrawal / deposit / transfer)
โ๏ธ transactions update
Update a single-split transaction by ID
โ๏ธ Flexible config
JSON config file with environment-variable fallback
๐ Secure by default
Config file permissions hardened to 0600 on load
๏ฟฝ Scriptable
--format json emits machine-readable output for piping into jq or scripts
๏ฟฝ๐งช Tested
Unit tests with fixture-backed networking mocks
๐ Requirements
Requirement
Version / Detail
๐ Swift
6.3.3 (see .swift-version)
๐ฆ SwiftPM
Bundled with the Swift toolchain
๐ Firefly III
Running instance with API access (/api/v1)
๐ API token
Personal access token from Firefly III (Profile โ OAuth)
๐ป Platform
macOS or Linux
๐ฆ Installation
1๏ธโฃ Clone the repository
git clone https://github.com/mknnjp/fina-cli.git
cd fina-cli
ID NAME TYPE CURRENCY BALANCE
1 Main Checking asset JPY 125000
2 Cash Wallet asset JPY 12000
๐งพ List transactions
fina transactions list --limit 10
fina transactions list --account "Main Checking"
fina transactions list --limit 20 --account 1
Example output:
ID DATE DESCRIPTION TYPE AMOUNT SOURCE DESTINATION
12 2026-09-01 Grocery run withdrawal 5400 Main Checking Supermarket
13 2026-09-02 Salary deposit 300000 Employer Main Checking
# Account names only
fina accounts list --format json | jq -r '.accounts[].name'# Transactions over 1000, most recent first
fina transactions list --limit 20 --format json | jq '.transactions[] | select(.amount > 1000)'# Capture the ID of a created transaction
id=$(fina transactions create --type withdrawal --date 2026-09-11 --amount 1500 \ --description "Coffee" --source "Main Checking" --destination "Cafe" --format json | jq -r '.id')
โ ๏ธ Errors
Success output goes to stdout; errors go to stderr and exit non-zero. With
--format json, errors are wrapped in an error object:
$ fina accounts list --format json
# stderr:
{"error":"Missing config at /home/you/.config/fina/config.json. Expected JSON with required fields: baseURL, token."}
๐ก Tip: argument errors (for example an unknown --format value) are always plain text with a usage hint, even when --format json is requested. Help output is plain text too.
๐๏ธ Project structure
Path
Description
Sources/fina/
Executable entry point (@main)
Sources/FinaCore/Commands/
accounts and transactions subcommands
Sources/FinaCore/Commands/Shared/
Shared CommandContext and ClientFactory wiring
Sources/FinaCore/Config/
FinaConfig, ConfigLoader, ConfigError
Sources/FinaCore/Models/
Account, Transaction, Budget, API envelopes
Sources/FinaCore/Networking/
FireflyClient, FireflyAPI, error mapping
Sources/FinaCore/Output/
Plain-table and JSON formatters
Tests/finaTests/
Unit tests + JSON fixtures
๐งช Development
Task
Command
๐จ Build
swift build
โถ๏ธ Run
swift run fina -- accounts list
โ Test
swift test
๐งน Format check
swiftformat --lint . (if installed)
โ ๏ธ Error handling
Situation
Behavior
๐ญ Missing config
Clear error with expected path and required fields (baseURL, token)
๐งจ Invalid JSON / bad URL
ConfigError.invalid with reason
๐ HTTP 4xx / 5xx
FireflyError.requestFailed with status code and body message
๐งฉ Decoding failure
FireflyError.decodingFailed with detail
๐บ๏ธ Roadmap
Status
Item
โ Done
Accounts list, transactions list / create / update