Karan Sharma

Why Plain-Text Ledger is Powerful for Gullak

3 minutes (792 words)

In my previous post, I introduced Gullak, an expense tracker I built to categorize transactions using LLMs. While the initial prototype used SQLite, I’ve since made a fundamental shift in how Gullak stores data. It now uses the ledger-cli format—a plain-text accounting standard that has been around for over 20 years.

The Core Insight#

Ledger-cli uses a format that is, at its core, just text files. There are no database migrations to manage, no proprietary binary formats, and absolutely no vendor lock-in. The promise is simple: your financial data should outlive the application you use to track it.

Hackability in Gullak’s Context#

Moving to a plain-text format unlocked several advantages that align perfectly with modern AI capabilities and the Unix philosophy.

1. AI-Native Format#

Consider a typical transaction entry in a ledger file:

2026/01/21 Swiggy
    Expenses:Food:Delivery  584.23 INR
    Liabilities:CreditCard:ICICI  -584.23 INR

This structure is trivially parseable by Large Language Models (LLMs). An AI agent can read, write, and reason about these transactions without needing complex serialization logic. Compare this to the friction of extracting data from a SQLite blob or interfacing with a proprietary API like Splitwise’s. The text is the interface.

2. Git-Friendly#

Because every transaction is just a few lines of text, your financial history becomes a git repository. Every change is a diff.

This gives you:

3. Unix Philosophy#

The file serves as the API. You don’t need export buttons or data liberation requests. You can use standard Unix tools to query your finances.

Find all Swiggy orders over 500 INR:

grep -A2 "Swiggy" main.ledger | grep -E "[5-9][0-9]{2,}|[0-9]{4,}"

Check your monthly food spending:

ledger -f main.ledger bal Expenses:Food -p "this month"

Export to CSV for Google Sheets:

ledger -f main.ledger csv Expenses

4. Extensibility via Comments#

Gullak adds its own metadata using standard ledger comments, which are ignored by the accounting tools but used by the app:

2026/01/21 Zomato
    ; gullak:id 7559a51f
    ; gullak:source whatsapp
    ; gullak:user 919876543210
    Expenses:Food:Delivery  584.23 INR

Custom tags for your own organization—like ; Recurring: Netflix—just work out of the box.

5. Ecosystem Interoperability#

Because the format is standard, Gullak plays nice with others:

What This Enables#

FeatureHow Plain Text Helps
WhatsApp loggingAI parses “swiggy 500” → appends text to file
Receipt OCRExtract data → format as ledger → append
Bank CSV importTransform CSV → ledger format → append
Transaction editingFind by gullak:id → text replacement
Undo/historyGit handles it for free
Backupcp main.ledger backup.ledger
MigrationIt’s text. There’s nothing to migrate.

The Trade-off#

Of course, you lose ACID transactions, database indexes, and complex SQL queries. But for personal finance, the scale makes these unnecessary trade-offs.

Conclusion#

Adopting the ledger format turns Gullak from “yet another expense app” into a thin AI layer over your permanent financial record. By decoupling the data from the application logic, we ensure that the data remains accessible, hackable, and enduring.

Tags: #sideproject #ledger #plaintext #ai