
hledger
CLI纯文本复式记账工具:记录收支、投资与工时,一条命令生成资产负债表、利润表与预算报表,支持 CSV 导入和 JSON 输出,便于 agent 对账出报表;可与 Beancount 账本互转。
hledger
Robust, intuitive plain text accounting
Welcome! This is 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
- Free software licensed under GNU General Public License v3.0 or later.
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
Here's 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
hledger 1.x and 2.x
In 2026, the master branch was renamed to hledger1,
and work began on hledger 2.x, now in the main branch.
Some goals for 2.x:
- continue and improve 1.x's reliability
- provide excellent lot tracking and capital gains calculation
- explore ethical use of AI as a dev tool
- more cleanup and simplification of code, docs, process, finance
- more speed
- more interoperability
- more use of jj for version management
- easier contribution
and for 1.x:
- continued stability, installability
- bugfix releases to fix newly discovered regressions, if any
- preserve the non-AI-assisted codebase, and try to keep it that way
Related:
- Thoughts on hledger 2 #2547
- https://hledger.org/AI.html
- https://hledger.org/relnotes.html#2026-03-28-hledger-1991
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. It's easy! Please see https://hledger.org/sponsor.html for details.
相關資源

Beancount
CLI用文本文件记录复式记账交易的记账语言与工具集:bean-check 校验账本、bean-format 统一格式,配合 Fava、beanquery 出报表与查询;账本是纯文本,便于 agent 生成和版本管理。
beancount/beancount6.1k
rustledger
CLIBeancount 纯文本复式记账的 Rust 实现,命令是 rledger:校验账本、跑 BQL 查询、出资产负债表与收支表,能导入银行 CSV/OFX 对账单、对比预算、计算投资收益和资本利得;另有 MCP 服务,GitHub 发行包还附带输出 JSON 的 ag-rledger,便于 agent 调用。账本需是 Beancount 格式,报表与涉税数字需会计复核。
rustledger/rustledger409
Ledger
CLI经典的纯文本复式记账命令行工具:账目写在文本文件里,直接生成余额、明细、预算等报表,没有数据库和隐藏状态,方便 agent 读写账本、对账和出报表。
ledger/ledger6.1k
hledger-flow
CLIhledger 的自动记账流程工具:把银行、信用卡导出的 CSV 对账单按固定目录归档,套用分类规则一键生成账本,改规则后可重新生成,适合会计批量整理流水。需先安装 hledger,再从 Releases 页面下载程序(仅 macOS、Linux);账目结论需会计复核。
apauley/hledger-flow219
beanquery
CLIBeancount 官方账本查询工具 bean-query,用类 SQL 语句查询纯文本复式账本,出余额、收支分类汇总和账户明细,适合会计让 agent 核对账目、整理报表。需 uv 或 Python 3.8+ 和 Beancount 格式账本;报表结论需会计复核。
beancount/beanquery65
Actual CLI
CLI本地优先预算软件 Actual Budget 的官方命令行(命令是 actual):连接 Actual 同步服务器后,可查询和修改账户、交易、分类、收款方、规则与月度预算,默认输出 JSON,也能导出 CSV,适合让 agent 批量归类账目、整理报表。需 Node.js 22+,并准备已部署的 Actual 服务器地址、密码和预算 Sync ID。
actualbudget/actual29.5k





