{
  "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": {
    "paths": [
      "[configHome]/ledger/ledgerrc",
      "~/.ledgerrc"
    ],
    "exclude": [],
    "secret": [],
    "side_effect": false,
    "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
    },
    "source": [
      {
        "id": "man",
        "kind": "manual",
        "url": "https://manpages.debian.org/unstable/ledger/ledger.1.en.html",
        "revision": "2026-10",
        "evidence": "ledger [options] [command] [arguments]\naccounts [report-query]\nbalance [report-query]\nprint [report-query]\nregister [report-query]\n--begin DATE (-b)\n--end DATE (-e)\n--file FILE (-f)\n--period PERIOD (-p)\n--monthly (-M)\n--market (-V)\n--cleared (-C)\n--pending\n--real (-R)\n--empty (-E)\n--depth INT\n--flat\n--no-total\n--invert\n--sort EXPR (-S)\n--limit EXPR (-l)\n--subtotal (-s)\n"
      }
    ],
    "field": [
      {
        "id": "file",
        "label": "Journal file",
        "type": "path",
        "option": [
          "--file",
          "-f"
        ],
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "man"
        ]
      },
      {
        "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"
        ]
      },
      {
        "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"
        ]
      },
      {
        "id": "begin",
        "label": "Start date",
        "type": "string",
        "option": [
          "--begin",
          "-b"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "id": "end",
        "label": "End date",
        "description": "Transactions on or after this date are not considered.",
        "type": "string",
        "option": [
          "--end",
          "-e"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "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"
        ]
      },
      {
        "id": "monthly",
        "label": "Group by month",
        "type": "boolean",
        "option": [
          "--monthly",
          "-M"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "id": "market",
        "label": "Market value",
        "type": "boolean",
        "option": [
          "--market",
          "-V"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "id": "cleared",
        "label": "Cleared postings only",
        "type": "boolean",
        "option": [
          "--cleared",
          "-C"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "id": "empty",
        "label": "Include empty accounts",
        "type": "boolean",
        "option": [
          "--empty",
          "-E"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "id": "depth",
        "label": "Account depth",
        "type": "integer",
        "option": [
          "--depth"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "id": "flat",
        "label": "Flat account list",
        "type": "boolean",
        "option": [
          "--flat"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "id": "no_total",
        "label": "Hide total line",
        "type": "boolean",
        "option": [
          "--no-total"
        ],
        "sources": [
          "man"
        ]
      },
      {
        "id": "sort",
        "label": "Sort expression",
        "type": "string",
        "option": [
          "--sort",
          "-S"
        ],
        "sources": [
          "man"
        ]
      }
    ],
    "task": [
      {
        "id": "balances",
        "label": "Account balances",
        "fields": [
          "file",
          "report",
          "query",
          "begin",
          "end",
          "depth",
          "flat",
          "no_total"
        ],
        "required": [
          "file",
          "report"
        ],
        "set": {
          "report": [
            "balance"
          ]
        }
      },
      {
        "id": "monthly_register",
        "label": "Monthly register",
        "fields": [
          "file",
          "report",
          "query",
          "period",
          "monthly"
        ],
        "required": [
          "file",
          "report"
        ],
        "set": {
          "report": [
            "register"
          ],
          "monthly": [
            true
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "file",
          "report",
          "query",
          "begin",
          "end",
          "period"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "monthly",
          "market",
          "cleared",
          "empty",
          "depth",
          "flat",
          "no_total",
          "sort"
        ]
      }
    ]
  }
}
