From 38142caf85fbb4b6df10c808aaa925bfc0e56b01 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Sat, 25 May 2024 00:13:39 +0000 Subject: [PATCH] Update cheatsheets --- tldr/hledger | 35 ++++++++++++++++++++++-------- tldr/hledger-accounts | 41 ++++++++++++++++++++++++++++++++++++ tldr/hledger-add | 29 +++++++++++++++++++++++++ tldr/hledger-aregister | 25 ++++++++++++++++++++++ tldr/hledger-balancesheet | 37 ++++++++++++++++++++++++++++++++ tldr/hledger-import | 33 +++++++++++++++++++++++++++++ tldr/hledger-incomestatement | 25 ++++++++++++++++++++++ tldr/hledger-print | 37 ++++++++++++++++++++++++++++++++ tldr/hledger-ui | 38 +++++++++++++++++++++++++++++++++ tldr/hledger-web | 38 +++++++++++++++++++++++++++++++++ 10 files changed, 329 insertions(+), 9 deletions(-) create mode 100644 tldr/hledger-accounts create mode 100644 tldr/hledger-add create mode 100644 tldr/hledger-aregister create mode 100644 tldr/hledger-balancesheet create mode 100644 tldr/hledger-import create mode 100644 tldr/hledger-incomestatement create mode 100644 tldr/hledger-print create mode 100644 tldr/hledger-ui create mode 100644 tldr/hledger-web diff --git a/tldr/hledger b/tldr/hledger index aaa3f03c..46bfe0d0 100644 --- a/tldr/hledger +++ b/tldr/hledger @@ -5,21 +5,38 @@ source: https://github.com/tldr-pages/tldr.git --- # hledger -> A plain text accounting software for the command-line. -> More information: . +> A robust, friendly plain text accounting app. +> See also: `hledger-ui` for TUI, `hledger-web` for web interface. +> More information: . -- Add transactions to your journal interactively: +- Record new transactions interactively, saving to the default journal file: `hledger add` -- Show the account hierarchy, using a specific journal file: +- Import new transactions from `bank.csv`, using `bank.csv.rules` to convert: -`hledger --file {{path/to/file.journal}} accounts --tree` +`hledger import {{path/to/bank.csv}}` -- Show a monthly income statement: +- Print all transactions, reading from multiple specified journal files: -`hledger incomestatement --monthly --depth 2` +`hledger print --file {{path/to/prices-2024.journal}} --file {{path/to/prices-2023.journal}}` -- Print the amount of cash spent on food: +- Show all accounts, as a hierarchy, and their types: -`hledger print assets:cash | hledger -f- -I balance expenses:food --depth 2` +`hledger accounts --tree --types` + +- Show asset and liability account balances, including zeros, hierarchically: + +`hledger balancesheet --empty --tree --no-elide` + +- Show monthly incomes/expenses/totals, largest first, summarised to 2 levels: + +`hledger incomestatement --monthly --row-total --average --sort --depth 2` + +- Show the `assets:bank:checking` account's transactions and running balance: + +`hledger aregister assets:bank:checking` + +- Show the amount spent on food from the `assets:cash` account: + +`hledger print assets:cash | hledger -f- -I aregister expenses:food` diff --git a/tldr/hledger-accounts b/tldr/hledger-accounts new file mode 100644 index 00000000..a576f0bb --- /dev/null +++ b/tldr/hledger-accounts @@ -0,0 +1,41 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger accounts + +> List account names. +> More information: . + +- Show all accounts used or declared in the default journal file: + +`hledger accounts` + +- Show accounts used by transactions: + +`hledger accounts --used` + +- Show accounts declared with account directives: + +`hledger accounts --declared` + +- Add new account directives, for accounts used but not declared, to the journal: + +`hledger accounts --undeclared --directives >> {{2024-accounts.journal}}` + +- Show accounts with `asset` in their name, and their declared/inferred types: + +`hledger accounts asset --types` + +- Show accounts of the Asset type: + +`hledger accounts type:a` + +- Show the first two levels of the accounts hierarchy: + +`hledger accounts --tree --depth 2` + +- Short form of the above: + +`hledger acc -t -2` diff --git a/tldr/hledger-add b/tldr/hledger-add new file mode 100644 index 00000000..fbc060de --- /dev/null +++ b/tldr/hledger-add @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger add + +> Record new transactions with interactive prompting in the console. +> More information: . + +- Record new transactions, saving to the default journal file: + +`hledger add` + +- Add transactions to `2024.journal`, but also load `2023.journal` for completions: + +`hledger add --file {{path/to/2024.journal}} --file {{path/to/2023.journal}}` + +- Provide answers for the first four prompts: + +`hledger add {{today}} '{{best buy}}' {{expenses:supplies}} '{{$20}}'` + +- Show `add`'s options and documentation with `$PAGER`: + +`hledger add --help` + +- Show `add`'s documentation with `info` or `man` if available: + +`hledger help add` diff --git a/tldr/hledger-aregister b/tldr/hledger-aregister new file mode 100644 index 00000000..b7086b7b --- /dev/null +++ b/tldr/hledger-aregister @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger aregister + +> Show the transactions and running balances in one account. +> More information: . + +- Show transactions and running balance in the `assets:bank:checking` account: + +`hledger aregister assets:bank:checking` + +- Show transactions and running balance in the first account named `*savings*`: + +`hledger aregister savings` + +- Show the checking account's cleared transactions, with a specified width: + +`hledger aregister checking --cleared --width {{120}}` + +- Show the checking register, including transactions from forecast rules: + +`hledger aregister checking --forecast` diff --git a/tldr/hledger-balancesheet b/tldr/hledger-balancesheet new file mode 100644 index 00000000..adedbe6e --- /dev/null +++ b/tldr/hledger-balancesheet @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger balancesheet + +> Show the end balances in asset and liability accounts. +> More information: . + +- Show the current balances in Asset and Liability accounts, excluding zeros: + +`hledger balancesheet` + +- Show just the liquid assets (Cash account type): + +`hledger balancesheet type:c` + +- Include accounts with zero balances, and show the account hierarchy: + +`hledger balancesheet --empty --tree` + +- Show the balances at the end of each month: + +`hledger balancesheet --monthly` + +- Show the balances' market value in home currency at the end of each month: + +`hledger balancesheet --monthly -V` + +- Show quarterly balances, with just the top two levels of account hierarchy: + +`hledger balancesheet --quarterly --tree --depth 2` + +- Short form of the above, and generate HTML output in `bs.html`: + +`hledger bs -Qt -2 -o bs.html` diff --git a/tldr/hledger-import b/tldr/hledger-import new file mode 100644 index 00000000..c12f6ca6 --- /dev/null +++ b/tldr/hledger-import @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger import + +> Import new transactions from one or more data files to the main journal. +> More information: . + +- Import new transactions from `bank.csv`, using `bank.csv.rules` to convert: + +`hledger import {{path/to/bank.csv}}` + +- Show what would be imported from these two files, without doing anything: + +`hledger import {{path/to/bank1.csv}} {{path/to/bank2.csv}} --dry-run` + +- Import new transactions from all CSV files, using the same rules for all: + +`hledger import --rules-file {{common.rules}} *.csv` + +- Show conversion errors or results while editing `bank.csv.rules`: + +`watchexec -- hledger -f {{path/to/bank.csv}} print` + +- Mark `bank.csv`'s current data as seen, as if already imported: + +`hledger import --catchup {{path/to/bank.csv}}` + +- Mark `bank.csv` as all new, as if not yet imported: + +`rm -f .latest.bank.csv` diff --git a/tldr/hledger-incomestatement b/tldr/hledger-incomestatement new file mode 100644 index 00000000..3fbbecf9 --- /dev/null +++ b/tldr/hledger-incomestatement @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger incomestatement + +> Show revenue inflows and expense outflows during the report period. +> More information: . + +- Show revenues and expenses (changes in Revenue and Expense accounts): + +`hledger incomestatement` + +- Show revenues and expenses each month: + +`hledger incomestatement --monthly` + +- Show monthly revenues/expenses/totals, largest first, summarised to 2 levels: + +`hledger incomestatement --monthly --row-total --average --sort --depth 2` + +- Short form of the above, and generate HTML output in `is.html`: + +`hledger is -MTAS -2 -o is.html` diff --git a/tldr/hledger-print b/tldr/hledger-print new file mode 100644 index 00000000..f683851e --- /dev/null +++ b/tldr/hledger-print @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger print + +> Show full journal entries, representing transactions. +> More information: . + +- Show all transactions in the default journal file: + +`hledger print` + +- Show transactions, with any implied amounts or costs made explicit: + +`hledger print --explicit --infer-costs` + +- Show transactions from two specified files, with amounts converted to cost: + +`hledger print --file {{path/to/2023.journal}} --file {{path/to/2024.journal}} --cost` + +- Show `$` transactions in `*food*` but not `*groceries*` accounts this month: + +`hledger print cur:\$ food not:groceries date:thismonth` + +- Show transactions of amount 50 or more, with `whole foods` in their description: + +`hledger print amt:'>50' desc:'whole foods'` + +- Show cleared transactions, with `EUR` amounts rounded and with decimal commas: + +`hledger print --cleared --commodity '1000, EUR' --round hard` + +- Write transactions from `foo.journal` as a CSV file: + +`hledger print --file {{path/to/foo.journal}} --output-file {{path/to/output_file.csv}}` diff --git a/tldr/hledger-ui b/tldr/hledger-ui new file mode 100644 index 00000000..588d47eb --- /dev/null +++ b/tldr/hledger-ui @@ -0,0 +1,38 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger-ui + +> Terminal UI (TUI) to `hledger`. +> A robust, friendly plain text accounting app. +> More information: . + +- Start in the main menu screen, reading from the default journal file: + +`hledger-ui` + +- Start with a different color theme: + +`hledger-ui --theme {{terminal|greenterm|dark}}` + +- Start in the balance sheet accounts screen, showing hierarchy down to level 3: + +`hledger-ui --bs --tree --depth 3` + +- Start in this account's screen, showing cleared transactions, and reload on change: + +`hledger-ui --register {{assets:bank:checking}} --cleared --watch` + +- Read two journal files, and show amounts as current value when known: + +`hledger-ui --file {{path/to/2024.journal}} --file {{path/to/2024-prices.journal}} --value now` + +- Show the manual in Info format, if possible: + +`hledger-ui --info` + +- Display help: + +`hledger-ui --help` diff --git a/tldr/hledger-web b/tldr/hledger-web new file mode 100644 index 00000000..4683aa83 --- /dev/null +++ b/tldr/hledger-web @@ -0,0 +1,38 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# hledger-web + +> Web interface and API to `hledger`. +> A robust, friendly plain text accounting app. +> More information: . + +- Start the web app, and a browser if possible, for local viewing and adding only: + +`hledger-web` + +- As above but with a specified file, and allow editing of existing data: + +`hledger-web --file {{path/to/file.journal}} --allow edit` + +- Start just the web app, and accept incoming connections to the specified host and port: + +`hledger-web --serve --host {{my.host.name}} --port 8000` + +- Start just the web app's JSON API, and allow only read access: + +`hledger-web --serve-api --host {{my.host.name}} --allow view` + +- Show amounts converted to current market value in your base currency when known: + +`hledger-web --value now --infer-market-prices` + +- Show the manual in Info format if possible: + +`hledger-web --info` + +- Display help: + +`hledger-web --help`