A beautiful, keyboard-driven terminal UI for viewing and analyzing your hledger financial data. Built with Textual, this TUI provides an intuitive interface to explore your expenses, assets, and financial statistics.
Observe your finances without leaving the terminal!
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- ๐ Expenses Analysis: Categorized expense tracking with bar charts, tag pivoting, and flexible time period navigation (weeks, months, quarters, years)
- ๐ฐ Asset Monitoring: Track asset balances over time with interactive line charts and customizable time subdivisions (day, week, month, year)
- ๐ Statistics Dashboard: Comprehensive journal insights including account summaries, commodity tracking, and transaction metrics
- ๐ Detailed Views: Dive into account overviews, transaction lists, and balance histories for any account
- โจ๏ธ Keyboard-Driven: Fast navigation with intuitive keyboard shortcuts and context-sensitive footer
- ๐จ Visual Charts: Compare data across accounts and time periods with built-in bar and line charts
- Python >= 3.10
- hledger >= 1.25 installed and available on your PATH
- LEDGER_FILE environment variable or
-f/--fileflag specifying your hledger journal file
pip install hledger-tuiOr try it without installing (requires uv):
uvx hledger-tui-
Set up your environment (optional if using
-fflag):export LEDGER_FILE=/path/to/your/journal.ledger -
Launch the TUI:
hledger-tui
Or with a specific ledger file:
hledger-tui -f /path/to/your/journal.ledger
Or alternatively:
hledger tui
-
Web App Mode (optional):
You can also run hledger-tui as a web application accessible via browser:
hledger-tui --serve
This will start a web server and provide a URL to access the TUI in your browser.
-f,--file: Specify the path to your hledger journal file (takes precedence overLEDGER_FILEenvironment variable)--serve: Run the app in web app mode, accessible via browser--help: Show help message with all available options and examples
That's it! Use the keyboard shortcuts shown in the footer to navigate and explore your financial data.
hledger-tui can be configured using a YAML config file or environment variables. The config file is the recommended approach for most users, while environment variables are useful for temporary overrides or containerized deployments.
When the same setting is specified in multiple places, they are applied in this priority order (highest to lowest):
- Environment variables (e.g.,
HLEDGER_TUI_DEPTH=3) - Config file (
~/.config/hledger-tui/config.yaml) - Default values (built into the application)
Create a config file at the platform-specific location:
- Linux:
~/.config/hledger-tui/config.yaml - macOS:
~/Library/Application Support/hledger-tui/config.yaml - Windows:
%LOCALAPPDATA%\hledger-tui\config.yaml
Example config.yaml:
# Path to hledger file:oOptional if LEDGER_FILE is set, or when using `-f`/`--file`
ledger_file: /path/to/hledger.journal
# Query defaults for filtering results in various tabs
queries:
assets:
- acct:assets
expenses:
- acct:expenses
tags:
- acct:expenses
# Display settings
depth: 2
commodity: "" # Empty = use market prices; set to "$" or "โฌ" to convert
# Period settings
period:
unit: months # Options: weeks, months, quarters, years
subdivision: weekly # Options: daily, weekly, monthly, yearly
# Extra options for HLedger commands
extra_options:
balance: [] # Example: ["--cost", "--depth", "4"]
register: [] # Example: ["--related", "--cost"]You can override any config file setting using environment variables. This is especially useful for CI/CD, containers, or temporary changes.
| Variable | Description | Default | Example |
|---|---|---|---|
LEDGER_FILE |
Path to your hledger journal file (can be overridden with -f flag) |
None | /path/to/journal.ledger |
HLEDGER_TUI_QUERIES_ASSETS |
JSON array of asset query filters | ["acct:assets", "acct:liabilities", ...] |
'["acct:assets", "acct:liabilities"]' |
HLEDGER_TUI_QUERIES_EXPENSES |
JSON array of expense query filters | ["acct:expenses", "not:acct:financial", ...] |
'["acct:expenses", "not:tag:excluded"]' |
HLEDGER_TUI_QUERIES_TAGS |
JSON array of tag query filters | ["acct:expenses"] |
'["acct:expenses", "acct:income"]' |
HLEDGER_TUI_DEPTH |
Default depth for account hierarchy display | 2 |
3 |
HLEDGER_TUI_COMMODITY |
Currency for exchange conversion (empty = use market prices) | `` (empty) | โฌ, $, USD |
HLEDGER_TUI_EXTRA_OPTIONS_BALANCE |
JSON array of extra options for hledger balance command |
[] |
'["--cost", "--depth", "4"]' |
HLEDGER_TUI_EXTRA_OPTIONS_REGISTER |
JSON array of extra options for hledger register command |
[] |
'["--cost", "--related"]' |
Note: List-type environment variables must be in JSON array format. Use single quotes to wrap the JSON string in shell:
export HLEDGER_TUI_QUERIES_EXPENSES='["acct:expenses", "not:acct:financial"]'hledger-tui supports journals with multiple currencies, but it can only display one at a time. Terminal plots require a single currency, because trying to display multiple at once would make bar and line charts in the TUI cluttered, or would make lines overlap.
There are three main strategies to handle multi-currency journals.
When HLEDGER_TUI_COMMODITY is not set (default), hledger-tui uses the --market flag from HLedger to convert all amounts to one currency, based on market prices declared in your journal:
Set HLEDGER_TUI_COMMODITY to convert all amounts to a specific currency using the --exchange HLedger flag.
# Convert everything to euros
export HLEDGER_TUI_COMMODITY="โฌ"
hledger-tuiThe currency must exist in hledger commodities --declared or an error will be raised.
Add currency filters to your queries to view only transactions related to a specific commodity:
# Show only euro transactions
export HLEDGER_TUI_QUERIES_EXPENSES="acct:expenses,cur:โฌ"
export HLEDGER_TUI_QUERIES_ASSETS="acct:assets,cur:โฌ"
export HLEDGER_TUI_COMMODITY="โฌ"
hledger-tuiYou can pass additional HLedger options using the HLEDGER_TUI_EXTRA_OPTIONS_BALANCE and HLEDGER_TUI_EXTRA_OPTIONS_REGISTER environment variables. For example, to use cost basis conversion instead of market prices:
# Use cost basis for all balance commands
export HLEDGER_TUI_EXTRA_OPTIONS_BALANCE='["--cost"]'
export HLEDGER_TUI_EXTRA_OPTIONS_REGISTER='["--cost"]'
hledger-tuiThese variables accept any valid HLedger command-line options and can be used to customize behavior beyond the built-in settings.
# Clone the repository
git clone https://github.com/lucabello/hledger-tui.git
cd hledger-tui
# Install development dependencies
uv sync --extra devRun just to see all available commands:
โฎ just
just --list
Available recipes:
[build]
build # Build the project
clean # Remove build artifacts, caches, and temporary files
[dev]
check # Run all quality checks
format # Format the codebase using ruff
lint # Lint the codebase using ruff
run # Run the app with hledger-tui
test # Run tests
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run quality checks (
just check) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code follows the project's style guidelines and includes appropriate tests.
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
- hledger - Plain text accounting software
- Textual - Modern TUI framework for Python
- textual-plotext - Charts for Textual
Project Link: https://github.com/lucabello/hledger-tui
Made with โค๏ธ for plain text accounting enthusiasts






