id = "ledger" name = "Ledger" homepage = "https://www.ledger-cli.org" description = "A powerful, double-entry accounting system that is accessed from the UNIX command-line." executables = ["ledger"] platforms = ["macos", "linux"] [dotfiles] # ledger(1), the FILES section, lists exactly three places for "Your personal # ledger initializations": # # $XDG_CONFIG_HOME/ledger/ledgerrc # ~/.config/ledger/ledgerrc # ~/.ledgerrc # # The first two are one location — the XDG config home with its default spelled # out — which is [configHome]; the third is a dotfile ledger hard-codes in the # home directory. Both are listed because ledger still reads the old one. # Windows is not listed: ledger ships a Unix man page and no Windows path. paths = [ "[configHome]/ledger/ledgerrc", "~/.ledgerrc", ] exclude = [] # A plain-text accounting tool. The journal it reads is the user's own data # file, named on the command line or by $LEDGER_FILE, not a credential the # catalog places. secret = [] # ledger reads the init file at the start of each invocation and exits, so a # rewrite between runs is harmless. side_effect = false # An init file is command-line options, one per line — ledger(1) on # --init-file: "To specify options in the init file, use the same syntax as the # command-line, but put each option on its own line." Two of those options name # a file on this machine: --file (-f), the journal itself, and --price-db, the # downloaded price history. Both are absolute paths into the user's own # directories and differ from box to box; the rest of the file (report format, # date format, --strict) is preference. Both name the user's own books, which # is exactly what they would want back when rebuilding this machine, so the # values are kept for this device rather than dropped. [[dotfiles.machine_lines]] file = ["[configHome]/ledger/ledgerrc", "~/.ledgerrc"] match = { prefix = ["--file", "--price-db"] } scope = "backup" [commands] format = 1 label = "Run a ledger report" description = "Run a balance, register, print or accounts report over a journal file, with a date range, period and common filters. REPL mode, price lookups and format options are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "man" kind = "manual" url = "https://manpages.debian.org/unstable/ledger/ledger.1.en.html" revision = "2026-10" evidence = """ ledger [options] [command] [arguments] accounts [report-query] balance [report-query] print [report-query] register [report-query] --begin DATE (-b) --end DATE (-e) --file FILE (-f) --period PERIOD (-p) --monthly (-M) --market (-V) --cleared (-C) --pending --real (-R) --empty (-E) --depth INT --flat --no-total --invert --sort EXPR (-S) --limit EXPR (-l) --subtotal (-s) """ [[commands.field]] id = "file" label = "Journal file" type = "path" option = ["--file", "-f"] path = { kind = "file", role = "input" } sources = ["man"] [[commands.field]] id = "report" label = "Report" type = "enum" position = 0 choices = [{ value = "balance", label = "Balance" }, { value = "register", label = "Register" }, { value = "print", label = "Print transactions" }, { value = "accounts", label = "List accounts" }] sources = ["man"] [[commands.field]] id = "query" label = "Report query" description = "Account names, payees or tags to match; several terms are allowed." type = "string" position = 1 multiple = true sources = ["man"] [[commands.field]] id = "begin" label = "Start date" type = "string" option = ["--begin", "-b"] sources = ["man"] [[commands.field]] id = "end" label = "End date" description = "Transactions on or after this date are not considered." type = "string" option = ["--end", "-e"] sources = ["man"] [[commands.field]] id = "period" label = "Period expression" type = "string" option = ["--period", "-p"] suggestions = [{ value = "this month", label = "This month" }, { value = "last month", label = "Last month" }, { value = "this year", label = "This year" }] sources = ["man"] [[commands.field]] id = "monthly" label = "Group by month" type = "boolean" option = ["--monthly", "-M"] sources = ["man"] [[commands.field]] id = "market" label = "Market value" type = "boolean" option = ["--market", "-V"] sources = ["man"] [[commands.field]] id = "cleared" label = "Cleared postings only" type = "boolean" option = ["--cleared", "-C"] sources = ["man"] [[commands.field]] id = "empty" label = "Include empty accounts" type = "boolean" option = ["--empty", "-E"] sources = ["man"] [[commands.field]] id = "depth" label = "Account depth" type = "integer" option = ["--depth"] sources = ["man"] [[commands.field]] id = "flat" label = "Flat account list" type = "boolean" option = ["--flat"] sources = ["man"] [[commands.field]] id = "no_total" label = "Hide total line" type = "boolean" option = ["--no-total"] sources = ["man"] [[commands.field]] id = "sort" label = "Sort expression" type = "string" option = ["--sort", "-S"] sources = ["man"] [[commands.task]] id = "balances" label = "Account balances" fields = ["file", "report", "query", "begin", "end", "depth", "flat", "no_total"] required = ["file", "report"] set = { report = ["balance"] } [[commands.task]] id = "monthly_register" label = "Monthly register" fields = ["file", "report", "query", "period", "monthly"] required = ["file", "report"] set = { report = ["register"], monthly = [true] } [[commands.group]] id = "basic" label = "Basic" fields = ["file", "report", "query", "begin", "end", "period"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["monthly", "market", "cleared", "empty", "depth", "flat", "no_total", "sort"]