# Ledger — Double-Entry Accounting via the Command Line > A powerful plain-text accounting system that uses a simple text file format for double-entry bookkeeping, budgeting, and financial reporting from the terminal. ## Install Save in your project root: # Ledger — Double-Entry Accounting via the Command Line ## Quick Use ```bash # Install brew install ledger # macOS sudo apt install ledger # Debian/Ubuntu # Create a journal file cat > finances.dat << EOF 2026/05/01 Salary Assets:Checking 5000.00 Income:Salary 2026/05/05 Rent Expenses:Rent 1500.00 Assets:Checking EOF ledger -f finances.dat balance ledger -f finances.dat register Expenses ``` ## Introduction Ledger is a command-line accounting tool that reads plain-text journal files and produces financial reports. It implements full double-entry bookkeeping without requiring a database, GUI, or proprietary file format, making it ideal for developers and power users who prefer text-based workflows. ## What Ledger Does - Parses plain-text journal files with double-entry transaction records - Produces balance reports, registers, budgets, and custom queries from the command line - Supports multiple currencies, commodities, and automatic currency conversion - Handles lot tracking for stocks and other investments with cost basis calculations - Integrates with version control for complete audit history of financial changes ## Architecture Overview Ledger is written in C++ for performance and reads journal files in a simple indentation-based format. Each transaction must balance to zero across its postings. The reporting engine applies filters, groupings, and format expressions to produce customizable output. The parser supports includes, automated transactions, and periodic entries. ## Self-Hosting & Configuration - Install via package managers on Linux, macOS, or build from source - Store journal entries in plain text files managed by any text editor - Use version control (Git) to track changes and maintain an audit trail - Configure default file paths and display options via environment variables - Automate imports from bank CSVs using companion tools like ledger-autosync ## Key Features - Plain-text storage that is human-readable, greppable, and version-control friendly - Extremely fast report generation even with years of transaction history - Flexible reporting with custom format strings and expression-based filters - Multi-currency and commodity tracking with automatic lot matching - No lock-in: data is portable text that can be processed by any tool ## Comparison with Similar Tools - **GnuCash** — GUI-based with database storage; Ledger is text-based and terminal-native - **Beancount** — Similar plain-text approach in Python; Ledger is faster (C++) with different syntax - **hledger** — Haskell reimplementation with web UI; Ledger is the original with C++ performance - **YNAB** — Commercial budgeting SaaS; Ledger is free, private, and infinitely customizable ## FAQ **Q: Is the plain-text format standardized?** A: The format originated with Ledger and has influenced hledger and Beancount, though each has variations. **Q: Can Ledger handle business accounting?** A: Yes, it supports invoicing workflows, tax reporting, and multi-entity tracking through accounts. **Q: How do I import bank transactions?** A: Use tools like ledger-autosync or reckon to convert CSV/OFX bank exports into Ledger format. **Q: Does Ledger have a GUI?** A: No, but Emacs ledger-mode and other editor integrations provide syntax highlighting and completion. ## Sources - https://github.com/ledger/ledger - https://ledger-cli.org --- Source: https://tokrepo.com/en/workflows/asset-0413334e Author: AI Open Source