hledger/bin
2020-08-15 10:25:13 -07:00
..
_hledger-chart.hs code: Strip extraneous trailing whitespace from Haskell sources 2019-07-15 16:40:49 +01:00
.gitignore prices: new addon (#486) 2017-01-25 11:50:54 -08:00
aliases.sh move add-ons and scripts to bin/ 2017-01-08 07:28:23 -08:00
budget-rewrite.sh bin: add budget-rewrite.sh example 2017-01-08 07:28:23 -08:00
compile.sh bin: stop listing addons after compiling them 2017-11-01 08:05:17 -07:00
csv.mk doc: move last addon docs out of hledger manual; add hledger-iadd 2017-01-24 15:39:38 -08:00
hledger-balance-as-budget.hs bin: drop explicit --package options from stack scripts, not needed 2020-08-15 09:59:59 -07:00
hledger-check-tag-files.cabal.hs ;bin: rename example cabal script 2020-08-15 09:51:44 -07:00
hledger-check-tag-files.hs bin: drop explicit --package options from stack scripts, not needed 2020-08-15 09:59:59 -07:00
hledger-check.hs bin: drop explicit --package options from stack scripts, not needed 2020-08-15 09:59:59 -07:00
hledger-combine-balances.hs bin: drop explicit --package options from stack scripts, not needed 2020-08-15 09:59:59 -07:00
hledger-print-location.hs bin: drop explicit --package options from stack scripts, not needed 2020-08-15 09:59:59 -07:00
hledger-smooth.hs bin: drop explicit --package options from stack scripts, not needed 2020-08-15 09:59:59 -07:00
hledger-swap-dates.hs bin: drop explicit --package options from stack scripts, not needed 2020-08-15 09:59:59 -07:00
README.md ;bin: update scripts readme 2020-08-15 10:25:13 -07:00

Miscellaneous hledger add-ons, bash scripts, example make rules, etc.

The hledger-*.hs scripts here are example/experimental hledger add-on commands. See https://hledger.org/scripting.html for more about this.

They are mostly implemented as stack scripts; if you have stack in your $PATH, they should just work, automatically installing their dependencies if needed. (You can also run them with cabal, or runghc, or compile them with ghc, if you take care of the dependencies yourself.)

Scripts overview, simplest first:

  • hledger-check-tag-files.hs - check that all tag values containing / exist as file paths
  • hledger-check-tag-files.cabal.hs - the above as a cabal script
  • hledger-swap-dates.hs - print transactions with their date and date2 fields swapped
  • hledger-print-location.hs - add file path/line number tags to the print command
  • hledger-balance-as-budget.hs - use one balance report as budget goals for another one
  • hledger-combine-balances.hs - show balance reports for two different periods side by side
  • hledger-smooth.hs - incomplete attempt at automatically splitting infrequent/irregular transactions
  • hledger-check.hs - check more complex account balance assertions

Installing a single script

$ curl -sO https://raw.githubusercontent.com/simonmichael/hledger/master/bin/hledger-check.hs
$ chmod +x hledger-check.hs
$ ./hledger-check.hs --help

If you put the script somewhere in your $PATH, it will also show up as a hledger command, so this also works:

$ hledger check -- --help

Note the --, which is required to separate script options from hledger options:

$ hledger [HLEDGEROPTS] ADDONCMD [-- ADDONOPTS]

Installing all scripts

$ git clone https://github.com/simonmichael/hledger
$ # add hledger/bin/ to your $PATH
$ hledger  # addons appear in command list

stack exec ghcid bin/hledger-import-shared-expenses.hs

stack ghci bin/hledger-import-shared-expenses.hs