Ledger CLI

2024-11-23

I found it might be worth sharing an awesome bookkeeping tool here, when I was checking my expenses this month.

There were lots of bookkeeping apps in iOS App Store. However, to be honest, they are awful. I suggest avoiding using such apps for important data for the following reason:

I recommend to bookkeep by Plain Text Accounting with tools like,

With the help of these tools, you can simple bookkeep in a .txt file in any computers. Every transaction is in a format below.

2024-11-23 * Apple
    Expenses:Digital:Cloud  10 USD
    Assets:Checking:BOA

A transaction involves 4 components:

Double entry bookkeeping gives you the power to bookkeep for complicated situations.

You can create currencies that don’t exist in the real life. So you can track your investment easily. For example, the transaction below means that I purchase 10 Apple stocks with the price of 100 USD per share on November 11, 2024.

2024-11-23 * IBKR
    Assets:Brokerage:IBKR  10 AAPL @ 100 USD
    Assets:Checking:BOA

The entries are not required to happen in the same date. So I can create a transaction for my renting. I pay every 3 monthes. In theory, it is a monthly expenses with one time pay. I believe most mobile apps cannot describe such situation.

2024-11-23 * Landlord
    Expenses:Rent  1000 USD ; [=2024-11-23]
    Expenses:Rent  1000 USD ; [=2024-12-23]
    Expenses:Rent  1000 USD ; [=2025-01-23]
    Assets:Checking:BOA

With plain text,

Then, what is these tools for if all data is now written in a plain text? They are for querying and analysis.

For example, I want to how much I spend for each accounts this month. I will use a query like,

ledger bal --period 2024-11 ^expenses

If I want to every transaction where Apple steals from me, I can use a query like,

ledger print payee Apple

For more functionality, check the documents of the tools you pick.

The only drawback of CLI tools and plain text accounting is that they are hard to be used in mobile phones. However, it is not that necessary to bookkeeping when you are outside. You can always do that when you are back home daily or weekly. And then, spend more time thinking of whether the finance is healthy or not, instead of recording then forgetting with mobile apps.