Go to file
gesh a24c39f13f fix: Use POSIX API to compute tty width (#2332)
On some systems, TERM is set to a value that doesn't have a valid
terminfo entry. Rather than hackily fall back on a value for TERM that
appears to work in most contexts (TERM=dumb) but which isn't guaranteed
anywhere to be valid, use proper POSIX ioctls to get the tty width.

This has the added bonus of also working on Windows.

In fact, we already settled on computing the terminal size in this way
in hledger-lib, so this commit centralizes the choice of the logic
there.

Also added a note for alternative methods and their tradeoffs, in case
this turns out to be fragile on some systems.
2025-02-27 13:41:48 -10:00
.github ;ci:linux: work around yesod-core/wai-extra bound issue 2024-12-02 21:07:34 -10:00
.sandstorm
.vscode/notebooks
bin script: balance-as-budget properly applies commodity styles now 2025-02-11 11:04:51 -10:00
checks
doc ;doc:dev: updates, cleanups 2025-02-18 00:10:02 -10:00
docker
docker-arm32v7 ;ci: linux: expect linux builds to be warning free like the rest 2024-09-30 17:21:23 -10:00
examples ;examples: test files for CSV encoding [#2319] 2025-02-15 14:48:30 -10:00
hledger fix: Use POSIX API to compute tty width (#2332) 2025-02-27 13:41:48 -10:00
hledger-install ;pkg:hledger-install: try third party packages again without bounds 2024-12-12 17:23:40 -10:00
hledger-lib fix: Use POSIX API to compute tty width (#2332) 2025-02-27 13:41:48 -10:00
hledger-ui pkg:ui: allow brick 2.8 2025-02-15 15:22:33 -10:00
hledger-web feat:csv: add an encoding rule, allowing non-UTF8 CSV to be read [#2319] 2025-02-15 14:48:30 -10:00
tools ;tools: bump tools & bin to recent stackage / ghc 9.10 2024-12-20 10:41:46 -10:00
.ci
.ctags
.dockerignore
.editorconfig
.ghci ;dev: .ghci: cleanup 2024-07-13 07:32:18 +01:00
.gitignore ;dev: ignores 2025-02-25 10:59:12 -10:00
.hlint.yaml
.mailmap
.version ;pkg: set version to 1.41.99 2024-12-09 17:58:24 -10:00
azure-pipelines.yml
bench1k.sh ;dev: update bench*.sh files 2025-02-27 07:32:44 -10:00
bench5k.sh ;dev: update bench*.sh files 2025-02-27 07:32:44 -10:00
bench10k.sh ;dev: update bench*.sh files 2025-02-27 07:32:44 -10:00
bench100k.sh ;dev: update bench*.sh files 2025-02-27 07:32:44 -10:00
bench-10ktxns-10kaccts.sh ;dev: update bench*.sh files 2025-02-27 07:32:44 -10:00
bench-10ktxns-100kaccts.sh ;dev: update bench*.sh files 2025-02-27 07:32:44 -10:00
bench-ledger.sh
bench-many-accts.sh ;just: more benchmarks 2024-01-26 22:23:04 -10:00
bench-many-txns.sh ;just: more benchmarks 2024-01-26 17:14:25 -10:00
bench.sh ;dev: update bench*.sh files 2025-02-27 07:32:44 -10:00
cabal.project
CHANGES.md ;doc: changelogs: fix heading 2024-12-09 16:03:40 -10:00
dev.hs
dir
Dockerfile
ghc-tags.yaml ;dev:ghc-tags: ignore hledger/test/addons 2024-02-29 21:44:35 +00:00
hie-stack.yaml
hledger.conf imp:cli: handle -NUM in config file properly 2024-10-19 16:56:14 -10:00
hledger.conf.sample ;examples: hledger.conf.sample: updates 2024-10-19 18:00:51 -10:00
Justfile ;dev: update bench*.sh files 2025-02-27 07:32:44 -10:00
LICENSE
Makefile ;tools: retire the main Makefile 2024-04-24 07:34:31 -10:00
Makefile.helpsys
README.md ;doc: readme: fix contributors link 2024-07-17 07:06:12 +01:00
Shake.hs ;dev: fix Shake.hs typo 2025-02-11 08:26:53 -10:00
stack8.10.yaml ;pkg:stack: drop obsolete systemencoding flag [#2319] 2025-02-16 07:19:09 -10:00
stack9.0.yaml ;pkg:stack: drop obsolete systemencoding flag [#2319] 2025-02-16 07:19:09 -10:00
stack9.2.yaml ;pkg:stack: drop obsolete systemencoding flag [#2319] 2025-02-16 07:19:09 -10:00
stack9.4.yaml ;pkg:stack: drop obsolete systemencoding flag [#2319] 2025-02-16 07:19:09 -10:00
stack9.6.yaml ;pkg:stack: drop obsolete systemencoding flag [#2319] 2025-02-16 07:19:09 -10:00
stack9.8.yaml ;pkg:stack: drop obsolete systemencoding flag [#2319] 2025-02-16 07:19:09 -10:00
stack9.12.yaml ;pkg:stack: drop obsolete systemencoding flag [#2319] 2025-02-16 07:19:09 -10:00
stack.yaml pkg:stack: use latest snapshots 2025-02-15 15:22:33 -10:00

hledger

Robust, intuitive plain text accounting

license on hackage github issues

Welcome! This a brief intro to hledger. For a more detailed version, see the home page: https://hledger.org

hledger is lightweight, cross platform, multi-currency, double-entry accounting software. It lets you track money, investments, cryptocurrencies, invoices, time, inventory and more, in a safe, future-proof plain text data format with full version control and privacy.

hledger aims to help both computer experts and regular folks gain clarity in their finances and time management. Though the UIs are basic, hledger can model any accounting situation and provide precise, clear reports. It is reliable, quick, and backed by the highly supportive Plain Text Accounting ecosystem. Using it is an excellent way to learn double entry accounting.

Compared to other PTA apps, hledger is actively maintained, with regular releases, and a strong focus on being easy to use and practical for everyday accounting.

More features: - Installs easily on unix, mac or windows - Complete, built-in documentation in multiple formats, beginner videos, tutorials etc. - Multiple UIs: command-line, terminal, web, mobile, editors/IDEs - Good at importing and exporting CSV; also outputs text/HTML/JSON/SQL - A robust, general, well-specified multi-currency accounting engine - Fast, analysing 25k transactions per second on a macbook air m1 - Accurate to 255 decimal places - Supports your preferred account names, currencies, number formats - Inspired by and partly compatible with Ledger CLI; interconvertible with Beancount - Scriptable by CLI, HTTP or API, with plenty of examples - Clean Haskell codebase, continually improved since 2007, with $100 regression bounties - Free software licensed under GPLv3+.

Examples

I use hledger to: - track income and spending, sometimes with budgets - see time reports by day/week/month/project - track reimbursables, invoices and payments - predict cashflow and account balances - get accurate numbers for tax filing - research past events

Heres an example of the journal file format:

2022-01-01 opening balances as of this date
    assets:bank:checking                $1000
    assets:bank:savings                 $2000
    assets:cash                          $100
    liabilities:creditcard               $-50
    equity:opening/closing balances

2022-01-15 market
    expenses:food             $50
    assets:cash              $-50

2022-02-01 GOODWORKS CORP
    assets:bank:checking           $1000
    income:salary                 $-1000

and some simple reports:

$ hledger bs
Balance Sheet 2022-02-15

                        || 2022-02-15 
========================++============
 Assets                 ||            
------------------------++------------
 assets:bank:checking   ||      $2000 
 assets:bank:savings    ||      $2000 
 assets:cash            ||        $50 
------------------------++------------
                        ||      $4050 
========================++============
 Liabilities            ||            
------------------------++------------
 liabilities:creditcard ||        $50 
------------------------++------------
                        ||        $50 
========================++============
 Net:                   ||      $4000 
$ hledger is --monthly                                            
Income Statement 2022-01-01..2022-02-28                                               
                                                                                      
               ||  Jan    Feb                                                         
===============++=============                                                        
 Revenues      ||                                                                     
---------------++-------------                                                        
 income:salary ||    0  $1000                                                         
---------------++-------------                                                        
               ||    0  $1000                                                         
===============++=============                                                        
 Expenses      ||                                                                     
---------------++-------------                                                        
 expenses:food ||  $50      0                                                         
---------------++-------------                                                        
               ||  $50      0                                                         
===============++=============                                                        
 Net:          || $-50  $1000                                                         

More examples and screenshots: https://hledger.org/#how-to-get-started

Funding

hledger is brought to you by Simon Michael, 140+ contributors, and the generous financial sponsors below.

After enjoying some personal or organisational success with hledger, you might want to become one of them, to help support this work. Its easy! Please see https://hledger.org/sponsor.html for details.

Organisational sponsors

Individual sponsors