github simonmichael/hledger 1.99.2

pre-release5 hours ago

Release notes

Lot tracking refinements.

hledger 1.99.2

Breaking changes

  • Lot processing and checking is now performed by default when reading a journal with lot entries.
    The --lots flag is now a display toggle; without it, lot subaccounts are hidden from reports.

  • The G (Gain) account type is no longer auto-detected from account names
    (to avoid breaking hledger 1 journals using those names).
    And a U (UnrealisedGain) account type has been added (a subtype of Equity).

  • Disposal transactions now produce a balanced pair of gain postings:
    a transfer between the first U account and the first G account.
    (If none are declared, the names equity:unrealised-gain and revenues:gain will be used.)
    The special exception for gain postings during transaction balancing,
    and the separate disposal balancing step, have been dropped.

  • Amountless explicit gain postings are no longer allowed; if you write gain
    postings in the journal, you must write their amounts also.

Features, Improvements

  • The new --ignore-lots flag disables lot processing. This can be useful
    to avoid errors when working with incomplete journals.

  • The -I flag is now a shorthand for --ignore-assertions --ignore-lots.

  • Capital gain is now computed more robustly, from disposal postings only
    (not from the entry's cost basis residual).

  • Cost amounts in lot subaccount names like assets:x1:{2026-01-15, $1,500}
    are now styled with the canonical commodity styles.
    Likewise for inferred gain posting amounts.

  • Lot transfer transactions with a priced fee posting will be automatically
    split into a transfer portion and a disposal portion (for the fee), if possible.

  • A new optional hledger check basis check verifies that each acquire posting's
    cost basis matches its transacted cost ({B} = @T).
    This prevents typos in cost basis which could silently cause wrong capital gain to be calculated.

  • print's -x/--explicit flag now implies --lots, so you can just
    type hledger print -x to see lot details. (To see all possible details,
    add --verbose-tags.)

  • print --verbose-tags now shows some new lot posting ptype tag values:

    • rgain and ugain on generated realised- and unrealised-gain postings
    • lot-parent-assertion on generated postings preserving balance assertions across lot splitting
    • split-posting on the disposal portion of auto-split lot transfers.
  • When inferring a transacted price to balance a two-commodity transaction,
    if one of the postings is lotful, hledger will attach the price to that one,
    rather than always picking the first posting.
    #2571

  • Transaction-balancing error messages have been improved, and now show the summed amounts
    to help with troubleshooting.

  • In CSV rules, a %(FIELD) interpolation syntax with parentheses is now accepted.
    This is useful when the field name needs to be delimited from adjacent text.
    Eg: account1 assets:%(type)checking.

  • When using the less pager, hledger no longer duplicates options in the LESS environment variable.

  • add now date-weights similar transactions by absolute distance from today,
    not from the journal's latest date. This prevents a future date typo from skewing defaults.

  • setup now also checks for the G (Gain) and U (UnrealisedGain) account types.
    Also output related to the less pager, lot-related data, and strict checking has been improved.

Fixes

  • The G (Gain) account type's spelling has been fixed (it's Gain, not Gains). #2570

  • add no longer breaks when the journal contains postings to a type G account.
    #2572

  • register and aregister now omit postings whose amount couldn't be inferred
    instead of showing blank entries and report layout problems. (Shouldn't occur in practice.)
    #2571

  • Equity conversion postings generated by --infer-equity no longer break
    transaction balancing in lot disposals.

  • {{TOTALCOST}} annotations may now contain a date and label too.

  • {{TOTALCOST}} annotations now preserve decimal digits (capped at 8 digits)
    when converted to {UNITCOST}.

Scripts/addons

  • hledger-fancyassertions: add -s/--strict flag. (Joshua Chapman)

Docs

  • Cost basis, Lot reporting: many updates.

hledger-ui 1.99.2

Fixes

  • Navigating to lot subaccounts (with names like {2026-01-01, $50}) no longer
    fails with "invalid regular expression" — regex metacharacters in account
    names are now properly escaped.

Improvements

  • Allow brick 3.x.

  • Uses hledger 1.99.2.

hledger-web 1.99.2

Improvements

  • Allow yesod-static 1.6.1.1 and later again.

  • Uses hledger 1.99.2.

project changes 1.99.2

Doc updates

  • AI: ongoing edits, new monitoring scripts and notes, FOSS credit, link cleanups
  • ACHIEVEMENTS, ANNOUNCE, DECISIONS, DEVFAQ, README, RELEASING: edits
  • SPEC-lots: edits and cleanups
  • SPEC-special-postings: converted to markdown tables
  • relnotes/ghrelnotes: AI doc url fixes, edits
  • references to the master branch updated to main

Infrastructure/tools

  • stack configs: bumped to nightly-2026-04-17
  • workflows: fix stack.yaml path in binaries-windows
  • justfile: ccusage scripts
  • justfile: functest uses more threads
  • general --help options doc updated

credits 1.99.2

Simon Michael,
Joshua Chapman.

Install

For all install options, see hledger.org: Install.
You can install hledger from most package managers (but check for a green badge indicating it's up to date).
Or you can build it from source yourself.

Or you can install up to date binaries from this page, by following the appropriate instructions below.
If you find problems with these instructions, please let us know.

All platforms

If you have eget, that's a convenient way to download the right binaries for your machine:

eget simonmichael/hledger --all

Otherwise:

GNU/Linux, 64-bit Intel

At the command line:

curl -fLOC- https://github.com/simonmichael/hledger/releases/download/1.99.2/hledger-linux-x64.tar.gz | tar -xzv -f- -C/usr/local/bin hledger hledger-ui hledger-web
hledger --version; hledger-ui --version; hledger-web --version    # should show 1.99.2

Mac, 64-bit ARM or Intel

In a terminal window (don't download the binaries with your web browser, they won't get authorised):

On ARM macs:

curl -fLOC- https://github.com/simonmichael/hledger/releases/download/1.99.2/hledger-mac-arm64.tar.gz | tar -xzv -f- -C/usr/local/bin hledger hledger-ui hledger-web
hledger --version; hledger-ui --version; hledger-web --version    # should show 1.99.2

On Intel macs:

curl -fLOC- https://github.com/simonmichael/hledger/releases/download/1.99.2/hledger-mac-x64.tar.gz | tar -xzv -f- -C/usr/local/bin hledger hledger-ui hledger-web
hledger --version; hledger-ui --version; hledger-web --version    # should show 1.99.2

Windows, 64-bit ARM or Intel

In a powershell window (press WINDOWS-R, powershell, ENTER):

cd ~
curl https://github.com/simonmichael/hledger/releases/download/1.99.2/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
Expand-Archive hledger-windows-x64.zip -Force -DestinationPath AppData\Roaming\local\bin
hledger --version; hledger-ui --version; hledger-web --version    # should show 1.99.2

Windows 7, 64-bit Intel

These instructions have not been tested recently, please let us know if they work for you:

  • click hledger-windows-x64.zip below
  • choose Open with Windows Explorer, OK
  • click Extract all files
  • choose a destination folder - ideally one that appears in echo %PATH%, like C:\Windows (though that one will require administrator permission); otherwise, your home directory (C:\Users\YOURNAME)
  • check "Show extracted files when complete"
  • click Extract, wait for the destination folder to open
  • find the hledger, hledger-web icons (if you extracted to \Windows, you'll need to scroll down)
  • for each icon: double-click, uncheck "Always ask before opening this file", click Run
  • close those Explorer windows
  • open a command window (press Windows-r, type CMD, press enter)
  • hledger --version; hledger-ui --version; hledger-web --version should show 1.99.2
  • echo # >> .hledger.journal to ensure a default journal file exists. (Important: the doubled >> is needed to avoid overwriting existing data.)

Problems:

  • Starting hledger by double-clicking its icon won't work because it needs arguments; run it from the command window instead.
  • Starting hledger-web by double-clicking its icon may fail eg because Explorer's command window is too small;
    configure that to be larger, or run hledger-web from a command window instead.
  • hledger or hledger-web may fail to run if there is not enough memory available.

Next steps

Once installed, run hledger, and perhaps read hledger.org: Quick start.

Don't miss a new hledger release

NewReleases is sending notifications on new releases.