Skip to content

Commit

Permalink
readme: update guides for the watch transactions feature
Browse files Browse the repository at this point in the history
Signed-off-by: Gunwant Jain <[email protected]>
  • Loading branch information
wantguns committed Oct 15, 2023
1 parent 081c440 commit 8d5c208
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8d5c208

Please sign in to comment.