Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Overview of commands

To list hledger's commands, run hledger help commands. (Running just hledger shows a quick reference card, including the most common commands.) With the hledger-ui and hledger-web addons installed, the list looks like this:

$ hledger help commands
HLEDGER COMMANDS
USER INTERFACES
 help (h)                 show documentation and examples
 repl                     run multiple commands from an interactive prompt
 run                      run multiple commands from a file or command line
 ui                       run a terminal UI
 web                      run a web UI
ENTERING DATA
 add                      add transactions using terminal prompts
 get                      fetch transaction and price data for import
 import                   add new transactions from other files, eg CSV files
REPORTS
 accounts (acc)           account names
 activity                 transaction or posting counts, as a bar chart
 aregister (areg)         an account's transactions & running balance
 balance (bal)            balance changes, end balances, gains, budgets & more
 balancesheet (bs)        assets, liabilities and net worth
 balancesheetequity (bse) assets, liabilities and equity
 cashflow (cf)            changes in liquid assets
 codes                    transaction codes
 commodities (comm)       commodity/currency symbols
 descriptions (desc)      transaction descriptions
 files                    input files used
 holdings                 investment holdings and performance
 incomestatement (is)     revenues and expenses
 notes                    the note part of transaction descriptions
 payees                   the payee part of transaction descriptions
 prices                   market prices
 print                    transaction entries, or a whole exported journal
 register (reg)           matched postings & running total, across accounts
 roi                      return on investments
 stats                    journal statistics
 tags                     tag names
 transactions (tx)        transactions, in compact one-line format
MAINTENANCE
 setup                    check your hledger installation
 check                    check your journal data
 diff                     compare an account's transactions in two journals
GENERATING DATA
 close                    generate transactions to zero/restore/assert balances
 rewrite                  generate postings by rule, like print --auto
OTHER ADDONS

(This is hledger 2's list; hledger 1's is grouped a little differently.)

Most commands are reports. Here's a good order to learn them in:

  1. Whole transactions: print shows them as journal entries; transactions shows them one per line.
  2. Detailed changes: register lists postings with a running total; aregister shows one account's transactions and its running balance.
  3. Financial statements: balancesheet and incomestatement; also cashflow and balancesheetequity.
  4. Flexible summaries: balance sums any accounts, over any periods; activity charts how many transactions there were.
  5. Investments: holdings and roi.
  6. Lists: accounts, payees, tags, commodities, stats and the rest, useful for exploring a journal or for scripting.

The other sections:

  • Entering data: add was covered earlier; import comes later.
  • Maintenance: setup checks your installation, and check your data.
  • Generating data: close and rewrite are more advanced; you won't need them at first.

Next, we'll explore some reports.


(Part of hledger by example.)