This page lists some extra tools and scripts you can install to augment the core hledger tools.
These are several common types:
- small shell scripts - aliases, functions, or script files - which run the
hledgercommand line program in useful ways, saving work
- haskell scripts or programs which call hledger as a library, to do more advanced things
- scripts or programs which don't use hledger directly, but perform useful related tasks.
Scripts or programs which are named
hledger-something and found in
$PATH are known as
add-on commands, and will show up in hledger's commands list.
To learn more about scripts and how to make your own, see Scripting.
Other add-ons are maintained as separate packages, and can be installed separately with stack or cabal or the hledger-install script. If you have trouble, check their READMEs or ask for help in chat. They include:
a terminal UI alternative to hledger's
generates interest transactions for an account according to various schemes.
downloads market prices for the commodities in your journal.
Some scripts are collected in the bin/ directory in the main hledger repo. To install these:
$ cd ~/finance # wherever you keep financial files # (the fast way, no version control:) $ curl -LOJ https://github.com/simonmichael/hledger/archive/refs/heads/master.zip && unzip hledger-master.zip && mv hledger-master hledger # (or the slow way, with version control:) # git clone https://github.com/simonmichael/hledger.git $ ln -s hledger/bin
Now do the PATH dance, eg as a bash user:
$ echo "export PATH=$PATH:$PWD/bin" >>~/.bash_profile" $ export PATH=$PATH:$PWD/bin
bin/bashrcdefines some example bash aliases and functions. After the above steps, as a bash user,
# customise FINDIR and LEDGER_FILE at the top of bin/bashrc $ source bin/bashrc $ fin # list the scripts available
paypaljsondownloads the last 30 days of Paypal transactions (requires a free developer account & API key).
paypaljson2csvconverts the above to CSV, with format similar to the CSV you could download manually.
hledger-simplebalis a standalone bash script. It calls hledger with lots of options (read it to see what it does).
$ hledger simplebal
hledger-gitprovides easy version control for your journal files, using git. Run it with no arguments for help.
$ hledger git log $ hledger git status $ hledger git record [MSG]
$ hledger pijul log $ hledger pijul status $ hledger pijul record [MSG]
Also in the bin directory are some add-on commands written in Haskell (
These call hledger as a library to process command line arguments, read data,
run reports etc., so they can be as powerful as built-in commands.
You can run them interpreted, for easy customisation (you will need the
stack tool). Or you can
compile them for faster startup. They include:
hledger-print-location.hsis a simple example of a haskell script with hledger-style command-line help. It is a custom version of the built-in
$ hledger print-location -f hledger/examples/sample.journal desc:eat 2008/06/03 * eat & shop ; location: /Users/simon/src/hledger/examples/sample.journal:30 expenses:food $1 expenses:supplies $1 assets:cash
hledger-check-tagfiles.hsinterprets all tag values containing a
/(forward slash) as file paths, and checks that those files exist.
hledger-check-tagfiles.cabal.hsis the above as a cabal script.
hledger-swap-dates.hsprints transactions with their date and date2 fields swapped.
hledger-balance-as-budget.hsuses one balance report to set budget goals for another balance report.
hledger-combine-balances.hsshows balance reports for two different periods side by side.
hledger-smooth.hsis an incomplete attempt at automatically splitting infrequent/irregular transactions.
hledger-check-fancyassertions.hsis a more complex command that checks account balances in ways that the built-in balance assertions can't.