From 8d5c208fb846153815fd4062ddb88065b0baaefc Mon Sep 17 00:00:00 2001 From: Gunwant Jain Date: Mon, 16 Oct 2023 00:22:26 +0530 Subject: [PATCH] readme: update guides for the watch transactions feature Signed-off-by: Gunwant Jain --- readme.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 4b900ef..4227a54 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,9 @@ Unfold is an unofficial [Fold Money](https://fold.money) CLI client, which covers the bare minimum API routes to fetch your transactions for a given -period and even write them to a sqlite database. +period and even write them to a sqlite database. It also provides options for +running an internal cron job through which this CLI acts as a daemon and +fetches transactions every time the cron job's timer is met. Fold's API is not publically available, I had to MITM their app to write this tool, and so **there might be unforeseen consequences for your Fold account if @@ -37,6 +39,15 @@ automatically logged out on your Phone's app** $ unfold transactions -s 2023-09-20 --db ``` + c. Create an internal cron job to fetch transactions every 6 hours and save them to a db: + ```bash + # Note: You need to enable the `-d` or `--db` flag to ensure that the changes are written to a database + $ unfold transactions -s 2023-09-20 --db -w '@every 20s' + 12:19AM INF Cron job set for fetching transactions, going into daemon mode + 12:19AM INF Fetched transactions till 2023-10-17 + 12:20AM INF Fetched transactions till 2023-10-16 + ``` + c. For a complete glossary of available options: ``` $ unfold transactions -h @@ -49,12 +60,14 @@ automatically logged out on your Phone's app** -d, --db Save the results in a sqlite db -D, --db-path string Sets path for the database (default "db.sqlite") -h, --help help for transactions - -s, --since string fetch transactions since in this format: YYYY-MM-DD (default "2023-09-15") - -t, --till string fetch transactions till in this format: YYYY-MM-DD (default "2023-10-16") + -s, --since string fetch transactions since in this format: YYYY-MM-DD (default "XXXX-XX-XX") + -t, --till string fetch transactions till in this format: YYYY-MM-DD (default "XXXX-XX-XX") + -w, --watch string Set an internal cron job to trigger this command. You can use non-standard cron expressions like '@every 6h'. This will disable plaintext mode, so add a '-d' flag if you want to write to db Global Flags: --config string config file (default is $HOME/.config/unfold/config.yaml) -v, --debug Enable debug mode + Prints the transactions from all of your accounts (default period: 1 month) ``` There are a few more subcommands which Unfold provides and uses internally. You