What's new in hledger 2
hledger 2.0 is hledger's biggest-ever update, released on 2026-12-01 after six preview releases during 2026. This release was developed with careful, measured AI assistance (why ? please see hledger 2 and AI below).
Most hledger 1 users can switch to hledger 2 with no changes (see Upgrading to hledger 2). Here are the highlights; for the full list of changes, see the release notes.
Running hledger
- Speed: hledger 2 is 2-3x faster than hledger 1, and uses up to a third less memory.
- Twelve languages: reports and the UIs can be shown in Brazilian Portuguese, Chinese, English, French, German, Hawaiian, Irish, Italian, Japanese, Russian, Spanish and Ukrainian (see Languages). Reviews and new languages are welcome.
- Custom commands: you can define your own command aliases and scripts in the config file.
- Help, repl and run: help is reorganised, and repl and run are much more usable.
- Clearer errors: more error messages show a position and an excerpt, in the standard layout which editor add-ons recognise. The Emacs add-ons flycheck-hledger and flymake-hledger are updated for hledger 2.
Investments
- Lot tracking: hledger can track each purchase's cost basis, infer and validate lot movements, and calculate capital gains/losses when you sell, including transfers between accounts and short positions. See Start tracking lots for an introduction, and Lots and capital gains for the details.
- Multiple cost basis methods are supported (FIFO, LIFO, HIFO, AVERAGE..), configurable per account or across all accounts.
- Holdings: the new holdings report shows your investments' performance.
Charts
Most reports can now be shown as charts, with --chart. Charting is built in, with nothing else to install.
- Viewable everywhere: the same charts can be viewed in the terminal, as SVG, in HTML reports, and in hledger-web.
- Charts follow the report: they adapt to your options and data, showing subperiods, stacked bars, totals and averages, with accounts coloured by type.
- Layout options:
--chart=groupedputs bars side by side;netshows the net totals; a fixed scale makes separate charts comparable. - Holdings and activity charts:
holdingscharts each holding's value and gain or loss (or their history, by period), andactivitycharts transactions per week.
Reporting
- Simpler viewing:
--viewopens a report or chart in an appropriate viewer, eg a browser or spreadsheet. - Find anywhere:
::TEXTis an easy way to match on any field. - Filter by totals:
change:andbalance:select report rows by their change or balance, eghledger bal expenses change:'>100'. - Transactions overview: the new transactions (tx) command prints transactions as one line each.
Getting data in
- Quick setup: the setup command detects more problems, and the new init command creates journal files to get you started.
- Simpler importing: the new get command fetches new transactions and market prices,
and with a conventional
data/,rules/,prices/layout,hledger importneeds no arguments (see Finding the data). - More powerful CSV rules: merge combines several CSV records into one transaction,
functions transform field values,
ifstables are easier to write, and amounts can be expressions. CSV or rules files can be included in a journal. - Easier CSV rules troubleshooting: errors show the CSV record, hledger field values, and the rules that set them;
--debug=2shows which if rules matched each record. - Safer writes:
add,import, and hledger-web's add, edit and upload refuse to save a change that would make the journal unreadable.
Exporting
- Tidier, lossless print:
printaligns amounts at their decimal marks (--layoutadjusts this), andprint --exportreproduces the whole journal, with its directives and comments, so you can reformat or bulk-rewrite a journal (included files are inlined). - Ledger and Beancount: the new ledger output format uses Ledger's lot syntax, and beancount output is much improved, generating the directives Beancount needs.
Journal format
- Assert rules: assert directives declare rules, written as queries,
which hledger checks like balance assertions, eg
assert none daily type:A balance:<0(no asset account ever goes negative). - Amount expressions: a posting amount can be an arithmetic expression, like
($50.20 + $16.54) * 1.05. - Commodity aliases: commodity aliases help unify a commodity's symbols/units.
- Account aliases: an
alias:tag on an account declaration gives it a shorter alternate name.
hledger-ui and hledger-web
- hledger-ui updates automatically when your files change, shows lot details, and checks assert rules.
- hledger-web has had an extensive overhaul. It now provides all the main hledger reports, with charts, report options, paging, fast keyboard navigation, a dark mode, and security hardening.
Docs and examples
- The manual is reorganised and easier to navigate, with more getting-started information at the start, and new/rewritten sections.
- New examples include file layouts, lot tracking, and CSV rules for PayPal, Kraken and SimpleFIN (see examples/).
hledger 2 and AI
hledger 2 is the first hledger developed with AI assistance. In brief:
- hledger, hledger-ui and hledger-web do not use AI at runtime.
- hledger developers use AI tools carefully (Level 5-6 on this scale): a human directs, reviews and is responsible for every change, and each commit discloses the model and approximate tokens used. We don't use OpenAI, and don't accept AI-generated code in first-time contributions.
- We track and report our AI usage.
- Why: AI assistance made it possible to deliver robust lot and capital gains tracking, a complex feature that was long needed but too big for a part-time community project. It also allowed us to make hledger more secure, more correct, better tested, better documented, and much faster.
- Also: an efficient, reliable tool, built once with AI's help, can save much repeated AI computation by people who would otherwise ask an AI to do accounting calculations. I conjecture that moving AI computation upstream can produce a net reduction in overall AI usage.
- hledger's use of AI as a dev tool is an experiment that we can stop at any time; we do not depend on AI to keep moving forward.
Our AI policy gives more reasoning, rules, and evolving thoughts on the many open questions (copyright, social and environmental costs, experience reports, discussions pro and con).
If you prefer to avoid hledger 2, hledger 1 is still a great tool, and has had no AI-assisted development up to 1.52.1. (hledger-web 1.52.2+ contains a few small but necessary security fixes backported from hledger 2.)
Next steps
- Install hledger 2
- Upgrading to hledger 2: checking your data and setup, and what might need changing
- Release notes: every change since hledger 1.52
- Preview release notes: the 1.99.x previews, and 2.0's changes since the last of them