Encrypted Local-first Ledger

legdgerEncrypted local-first ledger

Obsidian for bookkeeping: local-first, an on-device AI finance copilot, and a plugin system open to any AI. All ledger data is encrypted on the machine and AI analysis never leaves the device. Only sync requires an account and a fee; local capability is free forever.

ledger-cli
01$ ledger-cli doctor
02{ "ok": true, "store": "ledger-mac.store", "readonly": true }
03
04$ ledger-cli stats --month 2026-09
05{ "monthExpense": 12483.20, "monthIncome": 32000.00,
06 "netWorth": 486210.55, "wallets": 7 }
$

The data is yours; the AI is just a finance copilot living on your device.

Design

Design decisions

Why this tool is built the way it is, and what that buys.

Two platforms, two jobs

iOS is the quick-entry bookkeeper; macOS is the full data terminal hosting the plugin system, AI access and batch consolidation.

A century kernel

One unified bag model, legs summing to zero per currency, and a three-verb validation gate on opening entries — once settled, the data model is never overturned.

Sync design

UUIDv7 primary keys + HLC versioning + entity-state mirror sync; the server keeps only the latest ciphertext and accumulates no history.

AI access

ledger-cli opens the local store read-only; tokens are issued and revoked by the Mac app, with an audit log attached.

Highlights

Capabilities at a glance

  • Local-first with on-device AI: statistics, Q&A and chat all run on the device
  • Double-entry kernel: an entry is a set of legs summing to zero, and balances are always derived, never stored
  • Eleven wallet bag types: assets, liabilities, securities, crypto holdings, reconciliation and split accounts
  • On-device receipt OCR: Vision parsing → rules engine → confirmation card
  • Native App Intents and Shortcuts: log an entry in one sentence
  • ledger-cli: a read-only CLI with token authorization for external AI agents to analyse safely
Metrics

Design metrics

Each one maps to a concrete decision in the implementation.

plaintext data stored in the cloud
0

Entries are encrypted on the machine; the cloud only keeps the latest ciphertext

wallet bag types
11 types

Assets, liabilities, securities, crypto holdings, pending reconciliation, split intermediates and more

kernel tests
127+

LedgerCore is a standalone Swift package with full kernel test coverage

stored balance fields
0

Balances are always derived from legs; no cached value can drift out of sync

sync payload
latest only

Entity-state mirror sync; the server accumulates no history

AI data egress
on-device

Statistics, Q&A and chat all complete on the device

Platforms

Platform support

With kernel and shell separated, support levels can advance independently per platform.

macOS
Full

The full data terminal: plugin system, AI access and batch consolidation

iOS
Full

Quick-entry bookkeeping with App Intents, Shortcuts and widgets

CLI
Full

Read-only commands with JSON output, built for agents

Windows
Planned

The kernel is designed cross-platform; the shell is not yet scheduled

Android
Planned

Same kernel; on-device AI depends on platform capability adaptation

Comparison

How it differs from the common approach

The difference usually is not in the feature table — it is in where the boundary is drawn.

Where data lives
Local-first with on-machine encryption; the cloud only ever holds ciphertext
Entries stored in the cloud in plaintext; privacy depends on the provider
Balance consistency
Double-entry: legs sum to zero per currency, balances derived and never stored
Balance stored as a column, kept consistent by code on every change
AI capability
On-device model inference, data never leaves the device; automatic fallback to the rules engine when the model falls short
Upload the ledger to the cloud for analysis
External access
Read-only CLI + token authorization + audit log; AI can read, never write
Either fully closed, or the full dataset exported to a third party
Where payment starts
Local capability free forever; only sync requires an account and payment
Core features behind a subscription, with data export billed extra
Commands

Commands at a glance

For the full manual, see the CLI reference page. All commands output structured results by default.

Full command table
ledger-cli doctor

Self-check: store location, read-only state, kernel version and encryption status

--json
ledger-cli stats

Monthly income and expense, net worth and wallet distribution

--month YYYY-MM--wallet <id>
ledger-cli wallets

List wallets and their bag types (assets / liabilities / securities / crypto holdings, etc.)

ledger-cli query

Search entries by tag, time range and amount range

--tag <tag>--from--to--min
In Practice

Actual output

ledger-cli
01$ ledger-cli doctor
02{ "ok": true, "store": "ledger-mac.store", "readonly": true }
03
04$ ledger-cli stats --month 2026-09
05{ "monthExpense": 12483.20, "monthIncome": 32000.00,
06 "netWorth": 486210.55, "wallets": 7 }
Source

Modules

3 groups, 10 modules — all from the repository’s real directory structure.

SwiftUI · SwiftData · Swift 6 · FoundationModels · Vision · GRDB (V1) · CLI
Kernel packages

LedgerCore is a standalone Swift package; the app and the CLI share one implementation.

LedgerCore

The double-entry kernel: legs sum to zero, balances derived, a three-verb validation gate on opening entries

LedgerCore/Sources/LedgerCore
LedgerCoreStorage

Storage: SwiftData models and local-store reads; the CLI opens read-only

LedgerCore/Sources/LedgerCoreStorage
LedgerCoreCrypto

Encryption: storage encrypted on the machine; only ciphertext reaches the cloud

LedgerCore/Sources/LedgerCoreCrypto
LedgerCoreSync

Sync: UUIDv7 primary keys + HLC versions + entity-state mirror sync

LedgerCore/Sources/LedgerCoreSync
Both platforms & extensions

iOS for quick capture; macOS is the full data terminal.

ledger-ios

iOS: the main bookkeeping entry, App Intents and Shortcuts, widgets

ledger-ios/
ledger-mac

macOS: the full data terminal, plugin system and batch consolidation

ledger-mac/
Intelligence

On-device intelligence: FoundationModels inference + rules-engine fallback + Vision OCR receipt recognition

ledger/Intelligence
Import / LAN

Data import (standard formats) and a LAN sync channel

ledger/{Import,LAN}
AI access

Let external agents read your ledger safely — read-only.

ledger-cli

Read-only CLI: doctor / stats and friends, with JSON output for AI agents

ledger-cli/Sources/ledger-cli
Token authorization

Tokens are issued and revoked by the Mac app, with an audit log attached

ledger-mac/
Other tools
Get in touch

Hand the complexity of identity, agents and private domain to one governable kernel

Whether you are replacing an existing IAM, building an agent platform, or trying to make private-domain operations actually work — start with a 30-minute architecture call. We will first judge whether this is the kind of problem we are good at, and say so plainly if it is not.