Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
Improvements
Hledger.Cli.Script now also exports
Control.Applicative
Control.Concurrent
Data.Char
Data.Functor
System.IO
System.IO.Error
and new string helpers
strip1Char
stripBy
strip1By
Allow building with GHC 9.6.1 (#2011)
Fixes
Docs
hledger close
docs (Yehoshua Pesach Wallach)At https://hledger.org/install, binary packages should be available for this release within a few days (look for green badges).
Or, you can build from source as described there, after cloning at tag 1.29.1
:
git clone https://github.com/simonmichael/hledger --depth 1 -b 1.29.1
Or, if under "Assets" below there are release binaries suitable for your OS and hardware, you can use those.
Here are platform-specific instructions for the release binaries. (You can copy & paste each block of commands as a unit to save time.):
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.29.1/hledger-linux-x64.zip # can rerun if interrupted
unzip hledger-linux-x64.zip; tar xvf hledger-linux-x64.tar; rm hledger-linux-x64.{zip,tar} # github workaround, preserves permissions
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.29.1/hledger-mac-x64.zip
unzip hledger-mac-x64.zip && tar xvf hledger-mac-x64.tar && rm hledger-mac-x64.{zip,tar} # github workaround, preserves permissions
open .
# for the hledger, hledger-ui, hledger-web icons: right-click, Open, confirm it's ok to run
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
In a powershell window (press Windows-r, type powershell, press enter),
Make a place to keep hledger binaries, and add it to your PATH; this makes running hledger easier. You only need to do this once, not for every release:
mkdir -force $HOME\bin >$null
$ENV:PATH += ";"+$HOME+"\bin"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)
Download and install the release binaries:
cd $HOME\bin
curl https://github.com/simonmichael/hledger/releases/download/1.29.1/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
Expand-Archive hledger-windows-x64.zip -DestinationPath .
rm hledger-windows-x64.zip
cd $HOME
hledger --version # should show the new version
And ensure a default journal file exists:
out-file -append -encoding ascii $HOME/.hledger.journal
Problems:
echo %PATH%
, like C:\Windows
(though that one will require administrator permission); otherwise, your home directory (C:\Users\YOURNAME
)\Windows
, you'll need to scroll down)hledger --version
should show the new versionecho # >> .hledger.journal
to ensure a default journal file exists. (Important: the doubled >> is needed to avoid overwriting existing data.)Problems:
Tag checking, flexible multi-period start dates, flexible cost/conversion posting combining, new commands list, hledger manual reorg, easier close command, 10% more Ledger file compatible
Breaking changes
Features
In journal format there is now a tag
directive for declaring tag names,
and the check command now has a tags
check to enforce use of declared tag names.
Periodic transactions and multi-period reports can now start on any date. To enable this while still maintaining pretty good backward compatibility, hledger now treats inferred dates, and dates where the day is unspecified, as "flexible" (which can be automatically adjusted to interval boundaries), and dates specified to the day as "exact" (which can not). Eg:
A periodic rule like ~ monthly from 2023-01-15
now works as
you'd expect instead of raising an error. This also improves
our ability to read Ledger files.
Period options like -p 'monthly from 2023/1/15'
or -M -b 2023/1/15
now start the report on exactly 1/15 instead of being adjusted to 1/1.
Note: periods using in
may look partial but are considered to specify exact dates.
So weekly reports such as -p 'weekly in 2023-01'
, which previously
were adjusted to start on a monday, will now start exactly on 2023-01-01.
This can also cause more verbose column headings.
To guarantee simple week headings, you must now start such reports
exactly on a monday, eg -p 'weekly from 2022-12-26 to 2023-02'
.
(#1982)
You can now freely combine @/@@ costs and conversion postings
in a single transaction. This can help readability, and also allows
more flexibility when recording cost. hledger will check that the
two notations are in agreement, and ignore the redundancy if they are.
(Conversion postings are postings to accounts with type V
/Conversion
or name equity:conversion
/equity:trade
/equity:trading
,
or subaccounts of these. See also COST.)
Improvements
hledger's commands list has been reorganised for clarity. More add-on commands are now recognised and categorised, and unrecognised add-on commands are listed in a more compact multi-column layout. (Simon Michael, Michael Grünewald)
hledger's commands list and command line help now use ANSI (bold headings) when supported.
hledger's commands list and command line help now use a pager (respecting $PAGER) for long output except on MS Windows.
hledger's --version
output no longer shows +
for dev builds made
in dirty repos (it was buggy).
The add command's Description completions now also include payee names
(declared with payee
or recorded in transactions with |
),
not just full descriptions.
aregister now supports HTML output. (#1996) (Jonathan Dowland)
aregister now shows a " (matching query)" hint in report title when extra query args (other than date: or depth:) are used, to reduce confusion.
close now has three modes, --retain
/--migrate
/--open
,
clarifying its uses and providing more useful defaults.
register-match is now the --match
mode of the register command.
(This command was used by ledger-autosync at one point; if you still
need it, hopefully register --match
works similarly.)
print-unique has been dropped, because it doesn't support print's options, it disorders same-day transactions, I don't know of any users or use cases, and it could easily be recreated as an addon script.
print's JSON output now also includes source positions for --forecast
transactions.
(Chris Lemaire)
Journal format now allows the empty commodity symbol to be written
as ""
, so it's now possible to declare market prices for it:
P 2022-01-01 "" $100
. This can be useful for timedot data.
Inferring costs from equity now happens after transaction balancing,
not before. As a result, --infer-costs
now works in transactions
where an amount is left blank.
account
declarations now reject parenthesised account names,
reducing confusion.
(Chris Lemaire)
Our journal reader now accepts more Ledger syntax, improving Ledger file compatibility (#1962). We now test our ability to at least read the sample journals from Ledger's baseline functional tests, and our success rate has improved from 80% to 90% since 1.28.
since
is accepted as synonym of from
in period expressionsapply year
and year
are accepted as synonyms of Y
(lot notes)
in amounts and ((valuation expressions))
after amounts are now ignoredA
, assert
, bucket
, capture
, check
, define
,
expr
, eval
, python
, value
,
apply fixed
, apply tag
,
end apply fixed
, end apply tag
, end apply year
are now ignoredpayee
, tag
, and commodity
(other than format
) are now ignoredpop
directive is no longer supportedWhen reading CSV, we now check that assigned account names are valid (parseable). (#1978)
Fixes
aregister now handles an extra account query correctly. (#2007)
balance's --help
now mentions --layout=tidy
Balance commands with --layout=bare
now generate proper table
layout in HTML output.
register's -w
/--width
option no longer gives ugly parse error messages.
stats's --help
no longer wrongly claims to support -O/--output-format.
Balance assignments with a cost now generate a correct balance assertion. (#1965)
The CSV reader now properly skips header lines before attempting to parse records. (#1967)
Scripts/addons
Scripts can now use Hledger.Cli.Script, a convenient new prelude which helps reduce import boilerplate. It currently re-exports:
Control.Monad
Data.Either
Data.List
Data.Maybe
Data.Ord
Data.Time
Text.Printf hiding (formatString)
Data.Text (Text, pack, unpack)
Safe hiding (at)
System.Directory
System.Environment
System.Exit
System.FilePath
System.Process
Hledger
Hledger.Cli
Hledger.Cli.Main (argsToCliOpts)
(Not much of Data.Text/Data.Text.IO because those need to be qualified.)
Docs
In the help dialog, mention that LEFT shows other screens.
In the manual, mention shift-up/down config needed for Terminal.app.
The add form's typeahead now shows non-ascii text correctly. (#1961) (Arsen Arsenović)
In the manual, improve --base-url's description. (#1562)
Scripts/addons
Docs
Infrastructure
Simon Michael, Chris Lemaire, Caleb Maclennan, Jonathan Dowland, J. B. Rainsberger, Michael Grünewald, Robert Nielsen, Yann Büchau.
At https://hledger.org/install, binary packages should be available for this release within a few days (look for green badges).
Or, you can build from source as described there, after cloning at tag 1.29
:
git clone https://github.com/simonmichael/hledger --depth 1 -b 1.29
Or, if under "Assets" below there are release binaries suitable for your OS and hardware, you can use those.
Here are platform-specific instructions for the release binaries. (You can copy & paste each block of commands as a unit to save time.):
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.29/hledger-linux-x64.zip # can rerun if interrupted
unzip hledger-linux-x64.zip; tar xvf hledger-linux-x64.tar; rm hledger-linux-x64.{zip,tar} # github workaround, preserves permissions
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.29/hledger-mac-x64.zip
unzip hledger-mac-x64.zip && tar xvf hledger-mac-x64.tar && rm hledger-mac-x64.{zip,tar} # github workaround, preserves permissions
open .
# for the hledger, hledger-ui, hledger-web icons: right-click, Open, confirm it's ok to run
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
In a powershell window (press Windows-r, type powershell, press enter),
Make a place to keep hledger binaries, and add it to your PATH; this makes running hledger easier. You only need to do this once, not for every release:
mkdir -force $HOME\bin >$null
$ENV:PATH += ";"+$HOME+"\bin"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)
Download and install the release binaries:
cd $HOME\bin
curl https://github.com/simonmichael/hledger/releases/download/1.29/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
Expand-Archive hledger-windows-x64.zip -DestinationPath .
rm hledger-windows-x64.zip
cd $HOME
hledger --version # should show the new version
And ensure a default journal file exists:
out-file -append -encoding ascii $HOME/.hledger.journal
Problems:
echo %PATH%
, like C:\Windows
(though that one will require administrator permission); otherwise, your home directory (C:\Users\YOURNAME
)\Windows
, you'll need to scroll down)hledger --version
should show the new versionecho # >> .hledger.journal
to ensure a default journal file exists. (Important: the doubled >> is needed to avoid overwriting existing data.)Problems:
new hledger-ui screens, better debug output; accounts, print, csv-reading improvements; new hledger-move, watchaccounts scripts
Features
The accounts
command has new flags: --undeclared
(show accounts used but not declared),
--unused
(show accounts declared but not used), and --find
(find the first account
matched by the first command argument, a convenience for scripts).
Also -u
and -d
short flags have been added for --used
and --declared
.
A new CSV rule intra-day-reversed
helps generate transactions in correct order
with CSVs where records are reversed within each day.
CSV rules can now correctly convert CSV date-times with a implicit or explicit timezone to dates in your local timezone. Previously, CSV date-times with a different time zone from yours could convert to off-by-one dates, because the CSV's timezone was ignored. Now,
When a CSV has date-times with an implicit timezone different from yours,
you can use the timezone
rule to declare it.
CSV date-times with a known timezone (either declared by timezone
or parsed with %Z
) will be localised to the system timezone
(or to the timezone set with the TZ
environment variable).
(#1936)
Improvements
print --match now respects -o and -O.
print --match now returns a non-zero exit code when there is no acceptable match.
Support megaparsec 9.3. (Felix Yan)
Support GHC 9.4.
Fixes
accountN
,
extra whitespace is now ignored, allowing unbalanced postings to be detected correctly.Scripts/addons
bin/hledger-move helps record transfers involving subaccounts and costs, eg when withdrawing some or all of an investment balance containing many lots and costs.
bin/hledger-git no longer uses the non-existent git record command. (#1942) (Patrick Fiaux)
bin/watchaccounts is a small shell script for watching the account tree as you make changes.
Features
New "Balance sheet accounts" and "Income statement accounts" screens have been added, along with a new top-level "Menu" screen for navigating between these and the "All accounts" screen.
hledger-ui now starts in the "Balance sheet accounts" screen by default
(unless no asset/liability/equity accounts can be detected,
or command line account query arguments are provided).
This provides a more useful default view than the giant "All accounts" list.
Or, you can force a particular starting screen with the new --menu/--all/--bs/--is flags
(eg, hledger-ui --all
to replicate the old behaviour).
Improvements
The ENTER key is equivalent to RIGHT for navigation.
hledger-ui debug output is now always logged to ./hledger-ui.log rather than the console, --debug with no argument is equivalent to --debug=1, and debug output is much more informative.
Support GHC 9.4.
Support megaparsec 9.3 (Felix Yan)
Support (and require) brick 1.5, fsnotify 0.4.x.
Fixes
Mouse-clicking in empty space below the last list item no longer navigates back. It was too obtrusive, eg when you just want to focus the window. You can still navigate back with the mouse by clicking the left edge of the window.
A possible bug with detecting change of date while in --watch mode has been fixed.
API
hledger-ui's internal types have been changed to allow fewer invalid states
and make it easier to develop and debug.
(#1889, #1919).
Debug logging helpers have been added and cleaned up in Hledger.Ui.UIUtils: dbgui dbguiIO dbguiEv dbguiScreensEv mapScreens screenId screenRegisterDescriptions
Improvements
--debug with no argument is now equivalent to --debug=1.
Allow megaparsec 9.3 (Felix Yan)
Support GHC 9.4
Docs
Examples
Infrastructure
make site-watch: switch from entr to watchexec.
make hoogle-setup, hoogle-serve: run a local hoogle on hledger code.
make man-watch-PROG: watch a hledger program's man page as source files change.
Simon Michael, Felix Yan, Patrick Fiaux.
At https://hledger.org/install, binary packages should be available for this release within a few days (look for green badges).
Or, you can build from source as described there, after cloning at tag 1.28
:
git clone https://github.com/simonmichael/hledger --depth 1 -b 1.28
Or, if under "Assets" below there are release binaries suitable for your OS and hardware, you can use those.
Here are platform-specific instructions for the release binaries. (You can copy & paste each block of commands as a unit to save time.):
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.28/hledger-linux-x64.zip # can rerun if interrupted
unzip hledger-linux-x64.zip; tar xvf hledger-linux-x64.tar; rm hledger-linux-x64.{zip,tar} # github workaround, preserves permissions
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.28/hledger-mac-x64.zip
unzip hledger-mac-x64.zip && tar xvf hledger-mac-x64.tar && rm hledger-mac-x64.{zip,tar} # github workaround, preserves permissions
open .
# for the hledger, hledger-ui, hledger-web icons: right-click, Open, confirm it's ok to run
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
In a powershell window (press Windows-r, type powershell, press enter),
Make a place to keep hledger binaries, and add it to your PATH; this makes running hledger easier. You only need to do this once, not for every release:
mkdir -force $HOME\bin >$null
$ENV:PATH += ";"+$HOME+"\bin"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)
Download and install the release binaries:
cd $HOME\bin
curl https://github.com/simonmichael/hledger/releases/download/1.28/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
Expand-Archive hledger-windows-x64.zip -DestinationPath .
rm hledger-windows-x64.zip
cd $HOME
hledger --version # should show the new version
And ensure a default journal file exists:
out-file -append -encoding ascii $HOME/.hledger.journal
Problems:
echo %PATH%
, like C:\Windows
(though that one will require administrator permission); otherwise, your home directory (C:\Users\YOURNAME
)\Windows
, you'll need to scroll down)hledger --version
should show the new versionecho # >> .hledger.journal
to ensure a default journal file exists. (Important: the doubled >> is needed to avoid overwriting existing data.)Problems:
Fixes
-T -O html
no longer fail with an error
when there is no data to report.
(#1933)Fixes
The add form no longer gives an error when there is just a single file and no file field showing. (#1932)
Uses hledger-1.27.1
At https://hledger.org/install, binary packages should be available for this release within a few days (look for green badges).
Or, you can build from source as described there, after cloning at tag 1.27.1
:
git clone https://github.com/simonmichael/hledger --depth 1 -b 1.27.1
Or, if under "Assets" below there are release binaries suitable for your OS and hardware, you can use those.
Here are platform-specific instructions for the release binaries. (You can copy & paste each block of commands as a unit to save time.):
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.27.1/hledger-linux-x64.zip # can rerun if interrupted
unzip hledger-linux-x64.zip; tar xvf hledger-linux-x64.tar; rm hledger-linux-x64.{zip,tar} # github workaround, preserves permissions
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.27.1/hledger-mac-x64.zip
unzip hledger-mac-x64.zip; tar xvf hledger-mac-x64.tar; rm hledger-mac-x64.{zip,tar} # github workaround, preserves permissions
open .
# for the hledger, hledger-ui, hledger-web icons: right-click, Open, confirm it's ok to run
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
In a powershell window (press Windows-r, type powershell, press enter),
Make a place to keep hledger binaries, and add it to your PATH; this makes running hledger easier. You only need to do this once, not for every release:
mkdir -force $HOME\bin >$null
$ENV:PATH += ";"+$HOME+"\bin"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)
Download and install the release binaries:
cd $HOME\bin
curl https://github.com/simonmichael/hledger/releases/download/1.27.1/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
Expand-Archive hledger-windows-x64.zip -DestinationPath .
rm hledger-windows-x64.zip
cd $HOME
hledger --version # should show the new version
And ensure a default journal file exists:
out-file -append -encoding ascii $HOME/.hledger.journal
Problems:
echo %PATH%
, like C:\Windows
(though that one will require administrator permission); otherwise, your home directory (C:\Users\YOURNAME
)\Windows
, you'll need to scroll down)hledger --version
should show the new versionecho # >> .hledger.journal
to ensure a default journal file exists. (Important: the doubled >> is needed to avoid overwriting existing data.)Problems:
Infer costs from equity postings, new error checks, improved error messages, fixes.
Features
hledger check recentassertions
(and flycheck-hledger in Emacs if
you enable this check) requires that all balance-asserted accounts
have a balance assertion within 7 days before their latest posting.
This helps remind you to not only record transactions, but also to regularly check account balances against the real world, to catch errors sooner and avoid a time-consuming hunt.
The --infer-costs general flag has been added, as the inverse operation to --infer-equity. --infer-costs detects commodity conversion transactions which have been written with equity conversion postings (the traditional accounting notation) and adds PTA cost notation (@@) to them (allowing cost reporting). See https://hledger.org/hledger.html#equity-conversion-postings . (Stephen Morgan)
Improvements
Many error messages have been improved. Most error messages now use a consistent, more informative format. (#1436)
The accounts command has a new --directives flag which makes it show valid account directives which you can paste into a journal.
The accounts command has a new --positions flag which shows where accounts were declared, useful for troubleshooting. (#1909)
Bump lower bounds for Diff and githash. (Andrew Lelechenko)
GHC 8.6 and 8.8 are no longer supported. Building hledger now requires GHC 8.10 or greater.
Fixes
Account display order is now calculated correctly even when accounts are declared in multiple files. (#1909)
At --debug 5 and up, account declarations info is logged. (#1909)
hledger aregister and hledger-ui now show transactions correctly when there is a type: query. (#1905)
bal: Allow cumulative gain and valuechange reports. Previously, --cumulative with --gain or --valuechange would produce an empty report. This fixes this issue to produce a reasonable report. (Stephen Morgan)
bal: budget goal amounts now respect -c styles (fixes #1907)
bal: budget goals now respect -H (#1879)
bal: budget goals were ignoring rule-specified start date
cf/bs/is: Fixed non-display of child accounts when there is an intervening account of another type. (#1921) (Stephen Morgan)
roi: make sure empty cashflows are skipped when determining first cashflow (Charlotte Van Petegem) Empty cashflows are added when the begin date of the report is before the first transaction.
Scripts/addons
https://hledger.org/scripts.html - an overview of scripts and addons in bin/.
paypaljson, paypaljson2csv - download txns from paypal API
hledger-check-postable.hs - check that no postings are made to accounts with a postable:(n|no) tag
hledger-addon-example.hs - script template
Improvements
At --debug=2 and up, log debug output to ./debug.log.
Use/require brick 1.0+. (#1889)
Use hledger 1.27
Improvements
Improve the add form's layout and space usage.
Pre-fill the add form's date field.
Highlight today in the add form's date picker.
Focus the add form's description field by default.
Allow an empty description in the add form.
Use hledger 1.27
Fixes
Docs
https://hledger.org/ERRORS.html - an overview of hledger's error messages.
Rewrite/consolidate cost and conversion docs.
New template for github releases, with improved install instructions for binaries.
Add modern windows binary install instructions. (Lazar Lazarov, Simon Michael)
Fix tables of contents in developer documentation. (Alex Hirzel)
Update ACHIEVEMENTS. (Alex Hirzel)
Corrected the extension for the CREDITS file. (Pranesh Prakash)
Fix broken link in bin/README.md. (David D Lowe)
Examples
Process
Revive github projects, set up http://projects.hledger.org shortcut url
Many cleanups and improvements to the CI test and binary-generating github actions. The CI tests for master now also include hledger-lib's doctests.
All packages now disallow name shadowing in their code.
make scc gives a modern report of code line counts.
make ghci-unit-test loads hledger-lib unit tests in GHCI.
Simon Michael, Stephen Morgan, Alex Hirzel, Pranesh Prakash, David D Lowe, Charlotte Van Petegem, Max Thomas, Andrew Lelechenko.
At https://hledger.org/install, binary packages should be available for this release within a few days (look for green badges).
Or, you can build from source as described there, after cloning at tag 1.27
:
git clone https://github.com/simonmichael/hledger --depth 1 -b 1.27
Or, if under "Assets" below there are release binaries suitable for your OS and hardware, you can use those.
Here are platform-specific instructions for the release binaries. (You can copy & paste each block of commands as a unit to save time.):
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.27/hledger-linux-x64.zip # can rerun if interrupted
unzip hledger-linux-x64.zip; tar xvf hledger-linux-x64.tar; rm hledger-linux-x64.{zip,tar} # github workaround, preserves permissions
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.27/hledger-mac-x64.zip
unzip hledger-mac-x64.zip; tar xvf hledger-mac-x64.tar; rm hledger-mac-x64.{zip,tar} # github workaround, preserves permissions
open .
# for the hledger, hledger-ui, hledger-web icons: right-click, Open, confirm it's ok to run
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
In a powershell window (press Windows-r, type powershell, press enter),
Make a place to keep hledger binaries, and add it to your PATH; this makes running hledger easier. You only need to do this once, not for every release:
mkdir -force $HOME\bin >$null
$ENV:PATH += ";"+$HOME+"\bin"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)
Download and install the release binaries:
cd $HOME\bin
curl https://github.com/simonmichael/hledger/releases/download/1.27/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
Expand-Archive hledger-windows-x64.zip -DestinationPath .
rm hledger-windows-x64.zip
cd $HOME
hledger --version # should show the new version
And ensure a default journal file exists:
out-file -append -encoding ascii $HOME/.hledger.journal
Problems:
echo %PATH%
, like C:\Windows
(though that one will require administrator permission); otherwise, your home directory (C:\Users\YOURNAME
)\Windows
, you'll need to scroll down)hledger --version
should show the new versionecho # >> .hledger.journal
to ensure a default journal file exists. (Important: the doubled >> is needed to avoid overwriting existing data.)Problems:
support doclayout 0.4, brick 0.72+
require safe 0.3.19+ to avoid deprecation warning
At https://hledger.org/install, binary packages should be available for this release within a few days (look for green badges).
Or, you can build from source as described there, after cloning at tag 1.26.1
:
git clone https://github.com/simonmichael/hledger --depth 1 -b 1.26.1
Or, if there are release binaries below suitable for your OS and hardware, you can use those. Note: release binaries have been updated:
Here are some approximate per-platform instructions. (You can copy & paste each block of commands as a unit, to save time.)
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.26.1/hledger-linux-x64.zip # can rerun this if interrupted
unzip hledger-linux-x64.zip
chmod +x hledger hledger-ui hledger-web
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.26.1/hledger-mac-x64.zip
unzip hledger-mac-x64.zip
chmod +x hledger hledger-ui hledger-web
open .
# for the hledger, hledger-ui, hledger-web icons: right-click the executable, Open, confirm it's ok to run
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
In a powershell window (press Windows-r, type powershell, press enter),
Make a place to keep hledger binaries, and add it to your PATH; this makes running hledger easier. You only need to do this once, not for every release.
mkdir -force $HOME\bin >$null
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)
$ENV:PATH += ";"+$HOME+"\bin"
Download and install the release binaries:
cd $HOME\bin
curl https://github.com/simonmichael/hledger/releases/download/1.26.1/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
Expand-Archive hledger-windows-x64.zip -DestinationPath .
rm hledger-windows-x64.zip
cd $HOME
hledger --version # should show the new version
And ensure a default journal file exists:
out-file -append -encoding ascii $HOME/.hledger.journal
Problems:
Once installed, you could try these quick starts / tutorials:
Miscellaneous improvements.
Improvements
register
and aregister
have been made faster, by
considering only the first 1000 items for choosing column
widths. You can restore the old behaviour (guaranteed alignment
across all items) with the new --align-all
flag.
(#1839, Stephen Morgan)
discarding cost data more aggressively, giving big speedups for large journals with many costs. (#1828, Stephen Morgan)
Most error messages from the journal reader and the check
command now use
a consistent layout, with an "Error:" prefix, line and column numbers,
and an excerpt highlighting the problem. Work in progress.
(#1436) (Simon Michael, Stephen Morgan)
hledger check ordereddates
now always checks all transactions
(previously it could be restricted by query arguments).
The --pivot
options now supports a status
argument, to pivot on transaction status.
Update bash completions (Jakob Schöttl)
Fixes
Value reports with --date2
and a report interval (like hledger bal -VM --date2
)
were failing with a "expected all spans to have an end date" error since 1.22;
this is now fixed.
(#1851, Stephen Morgan)
In CSV rules, interpolation of a non-existent field like %999
or %nosuchfield
is now ignored (previously it inserted that literal text).
Note this means such an error will not be reported;
Simon chose this as the more convenient behaviour when converting CSV.
Experimental.
(#1803, #1814) (Stephen Morgan)
--infer-market-price
was inferring a negative price when selling.
(#1813, Stephen Morgan)
Allow an escaped forward slash in regular expression account aliases. (#982, Stephen Morgan)
The tags
command now also lists tags from unused account declarations.
It also has improved command-line help layout.
(#1857)
hledger accounts
now shows its debug output at a more appropriate level (4).
Fixes
Improvements
Now builds with GHC 9.2.
Uses hledger 1.26.
Scripts/addons
renamed hledger-number.sh to hledger-simplebal
added hledger-git, hledger-pijul
fin (and bin) scripts show available scripts and their help
renamed aliases.sh to bashrc
Get hledger-print-location working. (Stephen Morgan)
Docs
README cleanup, inspired by feedback from README reviewer Lars Wirzenius.
Clearer sponsoring info and more complete sponsor lists on website and README.
The new https://github.com/simonmichael/hledger_finance repo keeps track of our public finances (on Open Collective, Liberapay etc.)
Examples
Process
Stackage nightly and GHC 9.2 are now the default for dev builds.
CI workflows:
linux-x64-test
, replacing push
and pull
.
It runs for both pushes and pull requests, and generates binaries on every run.linux-x64-test
on another github branch first.make buildtimes
, make buildtimes-cabal
show GHC codegen times.
Simon Michael, Stephen Morgan, Jakob Schöttl, Patrik Keller.
At https://hledger.org/install, binary packages should be available for this release within a few days (look for green badges).
Or, you can build from source as described there, after cloning at tag 1.26
:
git clone https://github.com/simonmichael/hledger --depth 1 -b 1.26
Or, if there are release binaries below suitable for your OS and hardware, you can use those. (Release binaries have been updated:
Here are some approximate per-platform instructions. (You can copy & paste each block of commands as a unit, to save time.)
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.26/hledger-linux-x64.zip # can rerun this if interrupted
unzip hledger-linux-x64.zip
chmod +x hledger hledger-ui hledger-web
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.26/hledger-mac-x64.zip
unzip hledger-mac-x64.zip
chmod +x hledger hledger-ui hledger-web
open .
# for the hledger, hledger-ui, hledger-web icons: right-click the executable, Open, confirm it's ok to run
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
In a powershell window (press Windows-r, type powershell, press enter),
Make a place to keep hledger binaries, and add it to your PATH; this makes running hledger easier. You only need to do this once, not for every release.
mkdir -force $HOME\bin >$null
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)
$ENV:PATH += ";"+$HOME+"\bin"
Download and install the release binaries:
cd $HOME\bin
curl https://github.com/simonmichael/hledger/releases/download/1.26/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
Expand-Archive hledger-windows-x64.zip -DestinationPath .
rm hledger-windows-x64.zip
cd $HOME
hledger --version # should show the new version
And ensure a default journal file exists:
out-file -append -encoding ascii $HOME/.hledger.journal
Problems:
echo %PATH%
, like C:\Windows
(though that one will require administrator permission); otherwise, your home directory (C:\Users\YOURNAME
)\Windows
, you'll need to scroll down)hledger --version
should show the new versionecho # >> .hledger.journal
to ensure a default journal file existsProblems:
Once installed, you could try these quick starts / tutorials:
Account type and tag querying, infer equity postings from @ notation, easily-consumed "tidy" CSV output.
Breaking changes
Journal format's account NAME TYPECODE
syntax, deprecated in 1.13, has been dropped.
Please use account NAME ; type:TYPECODE
instead.
(Stephen Morgan)
The rule for auto-detecting "cash" (liquid asset) accounts from account names
for the cashflow
report has been simplified.
If you have been using the cashflow report, without explicitly declaring Cash accounts,
you might notice a change, and might need to declare your Cash accounts explicitly
(by adding type:C
tags to top-level cash account directives).
Features
The new type:TYPECODES
query matches accounts by their accounting type.
Account types are declared with a type:
tag in account directives,
or inferred from common english account names, or inherited from parent accounts,
as described at [Declaring accounts > Account types].
This generalises the account type detection of balancesheet
, incomestatement
etc.,
so you can now select accounts by type without needing fragile account name regexps.
Also, the accounts
command has a new --types
flag to show account types.
Eg:
hledger bal type:AL # balance report showing assets and liabilities
hledger reg type:x # register of all expenses
hledger acc --types # list accounts and their types
The tag:
query can now also match account tags, as defined in account directives.
Subaccounts inherit tags from their parents.
Accounts, postings and transactions can be filtered by account tag.
(#1817)
The new --infer-equity
flag replaces the @
/@@
price notation in commodity
conversion transactions with more correct equity postings (when not using -B/--cost
).
This makes these transactions fully balanced, and preserves the accounting equation.
For example:
2000-01-01
a 1 AAA @@ 2 BBB
b -2 BBB
$ hledger print --infer-equity
2000-01-01
a 1 AAA
equity:conversion:AAA-BBB:AAA -1 AAA
equity:conversion:AAA-BBB:BBB 2 BBB
b -2 BBB
equity:conversion
is the account used by default. To use a different account,
declare it with an account directive and the new V
(Conversion
) account type.
Eg:
account Equity:Trading ; type:V
(#1554) (Stephen Morgan, Simon Michael)
Normalised, easy-to-process "tidy" CSV data can now be generated with --layout tidy -O csv
.
In tidy data, every variable is a column and each row represents a single data point
(cf https://vita.had.co.nz/papers/tidy-data.html).
(#1768,
#1773,
#1775)
(Stephen Morgan)
Improvements
Strict mode (-s/--strict
) now also checks periodic transactions (--forecast
)
and auto postings (--auto
).
(#1810) (Stephen Morgan)
hledger check commodities
now always accepts zero amounts which have no commodity symbol.
(#1767) (Stephen Morgan)
Relative smart dates may now specify an arbitrary number of some period into the future or past). Some examples:
in 5 days
in -6 months
5 weeks ahead
2 quarters ago
(Stephen Morgan)
CSV output now always disables digit group marks (eg, thousands separators), making it more machine readable by default. (#1771) (Stephen Morgan)
Unicode may now be used in field names/references in CSV rules files. (#1809) (Stephen Morgan)
Error messages improved:
Fixes
--layout=bare
no longer shows a commodity symbol for zero amounts.
(#1789) (Stephen Morgan)
balance --budget
no longer elides boring parents of unbudgeted accounts
if they have a budget.
(#1800) (Stephen Morgan)
roi
now reports TWR correctly
(#1791) (Dmitry Astapov)
Documentation
There is a new CONVERSION & COST section, replacing COSTING. (#1554)
Some problematic interactions of account aliases with other features have been noted. (#1788)
[Declaring accounts > Account types]: (https://hledger.org/hledger.html#account-types
Scripts/addons
hledger-install.sh now also installs Pavan Rikhi's hledger-stockquotes tool.
The bin/hledger-number addon was added.
The bin/hledger-check-fancyassertions addon now shows docs in --help.
A new invoice-making script was added: examples/invoicing/invoice-script/invoice
Process/tools
The RELEASING doc and release process has been updated,
and a new helper script added: tools/releaseprep.
make hackageupload
now only works from a branch named
VERSION-branch or VERSION-release. Ie, making releases from master
is no longer allowed, a release branch is always required,
CI: The commitlint check is more robust, and now runs only in the push to master and pull request workflows, and not eg when building release binaries. linux-x64 binaries are now built with ghc 9.0, not 8.10. Workflow, branch, and binary names have been improved.
make ghci-ui
/make ghcid-ui
now use older ghc 8.10 to avoid
ghc 9.0-triggered failures.
hls support: The hie.yaml added to help hls work on mac m1 has been moved out of the way, since it probably makes things worse on other architectures.
Simon Michael, Stephen Morgan, Dmitry Astapov, Patrik Keller.
You can build this release from tag 1.25
, or try the binaries below, or see https://hledger.org/install for other install methods.
About these binaries:
Download and unzip the appropriate zip file. Unix and mac users will need to chmod +x
the binaries to make them executable. Mac users will need to mark them as trusted, eg right-click the file in Finder and option-click Open. Windows users will need to do something similar. There is no hledger-ui binary for Windows.
This is an early preview of the WIP hledger 1.25, with binaries for easy installation by testers and early adopters. Your testing and feedback is appreciated and will make the final release better.
You can build this prerelease from tag 1.24.99.2
, or try the CI binaries below. Download and unzip the appropriate zip file. Unix and mac users will need to chmod +x
the binaries to make them executable. Mac users will need to mark them as trusted, eg right-click the file in Finder and option-click Open. WIndows users will need to do something similar. There is no hledger-ui binary for Windows.
Breaking changes
Journal format's account NAME TYPECODE
syntax, deprecated in 1.13, has been dropped.
Please use account NAME ; type:TYPECODE
instead.
(Stephen Morgan)
The rule for auto-detecting "cash" (liquid asset) accounts from account names
for the cashflow
report has been simplified.
If you have been using the cashflow report, without explicitly declaring Cash accounts,
you might notice a change, and might need to declare your Cash accounts explicitly
(by adding type:C
tags to top-level cash account directives).
Features
The new type:TYPECODES
query matches accounts by their accounting type.
Account types are declared with a type:
tag in account directives,
or inferred from common english account names, or inherited from parent accounts,
as described at [Declaring accounts > Account types].
This generalises the account type detection of balancesheet
, incomestatement
etc.,
so you can now select accounts by type without needing fragile account name regexps.
Also, the accounts
command has a new --types
flag to show account types.
Eg:
hledger bal type:AL # balance report showing assets and liabilities
hledger reg type:x # register of all expenses
hledger acc --types # list accounts and their types
(#1820, #1822) (Simon Michael, Stephen Morgan)
The tag:
query can now also match account tags, as defined in account directives.
Subaccounts inherit tags from their parents.
Accounts, postings and transactions can be filtered by account tag.
(#1817)
The new --infer-equity
flag replaces the @
/@@
price notation in commodity
conversion transactions with more correct equity postings (when not using -B/--cost
).
This makes these transactions fully balanced, and preserves the accounting equation.
For example:
2000-01-01
a 1 AAA @@ 2 BBB
b -2 BBB
$ hledger print --infer-equity
2000-01-01
a 1 AAA
equity:conversion:AAA-BBB:AAA -1 AAA
equity:conversion:AAA-BBB:BBB 2 BBB
b -2 BBB
equity:conversion
is the account used by default. To use a different account,
declare it with an account directive and the new V
(Conversion
) account type.
Eg:
account Equity:Trading ; type:V
(#1554) (Stephen Morgan, Simon Michael)
Normalised, easy-to-process "tidy" CSV data can now be generated with --layout tidy -O csv
.
In tidy data, every variable is a column and each row represents a single data point
(cf https://vita.had.co.nz/papers/tidy-data.html).
(#1768, #1773, #1775) (Stephen Morgan)
Improvements
Strict mode (-s/--strict
) now also checks periodic transactions (--forecast
)
and auto postings (--auto
).
(#1810) (Stephen Morgan)
hledger check commodities
now always accepts zero amounts which have no commodity symbol.
(#1767) (Stephen Morgan)
Relative smart dates may now specify an arbitrary number of some period into the future or past). Some examples:
in 5 days
in -6 months
5 weeks ahead
2 quarters ago
(Stephen Morgan)
CSV output now always disables digit group marks (eg, thousands separators), making it more machine readable by default. (#1771) (Stephen Morgan)
Error messages improved:
Fixes
--layout=bare
no longer shows a commodity symbol for zero amounts.
(#1789) (Stephen Morgan)
balance --budget
no longer elides boring parents of unbudgeted accounts
if they have a budget.
(#1800) (Stephen Morgan)
roi
now reports TWR correctly
(#1791) (Dmitry Astapov)
Documentation
There is a new CONVERSION & COST section, replacing COSTING. (#1554)
Some problematic interactions of account aliases with other features have been noted. (#1788)
[Declaring accounts > Account types]: (https://hledger.org/hledger.html#account-types
hledger-lib now builds with GHC 9.2 and latest deps. (#1774)
Journal has a new jaccounttypes map. The journalAccountType lookup function makes it easy to check an account's type. The journalTags and journalInheritedTags functions look up an account's tags. Functions like journalFilterPostings and journalFilterTransactions, and new matching functions matchesAccountExtra, matchesPostingExtra and matchesTransactionExtra, use these to allow more powerful matching that is aware of account types and tags.
Journal has a new jdeclaredaccounttags field for easy lookup of account tags. Query.matchesTaggedAccount is a tag-aware version of matchesAccount.
Renamed: CommodityLayout to Layout.
This is not a full hledger release, just an early preview of the 1.25 release for testers and early adopters. Your testing and feedback will help make the final release better! Preview releases are new in 2022, RELEASING has more details.
Features
The new --infer-equity flag replaces @/@@ prices in commodity
conversion transactions with equity postings, making them fully
balanced and preserving the accounting equation. (When not doing
cost reporting; --cost/-B overrides and disables --infer-equity.)
For example, hledger print --infer-equity
will show:
2000-01-01
a 1 AAA @@ 2 BBB
b -2 BBB
as:
2000-01-01
a 1 AAA
equity:conversion:AAA-BBB:AAA -1 AAA
equity:conversion:AAA-BBB:BBB 2 BBB
b -2 BBB
The equity:conversion
account name is used by default. You can use
another account by declaring it with the new Conversion
/V
account type (a subtype of Equity
/E
), eg:
account Equity:Currency Conversions ; type: V
Normalised, easy-to-process "tidy" CSV data can now be generated with --layout tidy -O csv
.
In tidy data, every variable is a column and each row represents a single data point
(cf https://vita.had.co.nz/papers/tidy-data.html).
(#1768, #1773, #1775) (Stephen Morgan)
Improvements
Fixes
Documentation
Account aliases' ability to cause malformed account names is noted. (#1788)
There is a new CONVERSION & COST section, replacing COSTING. (#1554)
Improvements
Costing has been changed to ConversionOp with three options: NoConversionOp, ToCost, and InferEquity. The first correspond to the previous NoCost and Cost options, while the third corresponds to the --infer-equity flag. This converts transactions with costs (one or more transaction prices) to transactions with equity:conversion postings. It is in ConversionOp because converting to cost with -B/--cost and inferring conversion equity postings with --infer-equity are mutually exclusive. The cost_ record of ReportOpts has been changed to conversionop_.
hledger-lib now builds with GHC 9.2 and newer libs (#1774).
Renamed: CommodityLayout to Layout. (Stephen Morgan)
You can build this prerelease from source (tag 1.24.99.1
).
Or, you can try the CI binaries below. Download the appropriate "hledger-PLATFORM.zip" file and unzip it to get 2 or 3 hledger binaries in the current directory. On GNU/Linux, you will need to chmod +x
these files to make them executable. They should run on most GNU/Linux machines with x64 or (when provided) arm32v7 architecture. On mac machines, you will need to chmod +x
them and then mark them as trusted: in Finder, right-click the file then option-click Open. On windows machines you'll need to do something similar. There is no hledger-ui binary for Windows.