LinuxCommandLibrary

hledger-web

View hledger journal in a web browser

TLDR

Start the web app, and a browser if possible, for local viewing and adding only

$ hledger-web
copy

As above but with a specified file, and allow editing of existing data
$ hledger-web [[-f|--file]] [path/to/file.journal] --allow edit
copy

Start just the web app, and accept incoming connections to the specified host and port
$ hledger-web --serve --host [my.host.name] --port 8000
copy

Start just the web app's JSON API, and allow only read access
$ hledger-web --serve-api --host [my.host.name] --allow view
copy

Show amounts converted to current market value in your base currency when known
$ hledger-web --value now --infer-market-prices
copy

Show the manual in Info format if possible
$ hledger-web --info
copy

Display help
$ hledger-web [[-h|--help]]
copy

SYNOPSIS

hledger-web [options] [journal-file...]

PARAMETERS

-f FILE, --file=FILE
    Specifies the journal file(s) to load. Multiple -f or --file options can be provided to load several files.

-p PORT, --port=PORT
    Sets the TCP port for the web server to listen on. The default port is 5000.

--serve-dir=DIR
    Specifies a directory from which static files (e.g., CSS, JS) should be served alongside the web interface.

--rules-file=FILE
    Loads a rules file to apply transformations to transactions during import or parsing.

--no-browser
    Prevents hledger-web from automatically opening a web browser when it starts.

--base-url=URL
    Sets the base URL for all links generated by the web interface. Useful when running behind a reverse proxy.

--access-log=FILE
    Specifies a file to which HTTP access logs will be written.

--error-log=FILE
    Specifies a file to which server error logs will be written.

--cors-origin=ORIGIN
    Enables Cross-Origin Resource Sharing (CORS) for requests originating from the specified domain.

--web-dir=DIR
    Specifies the directory containing hledger-web's own static assets (e.g., its default HTML, CSS, JS).

--debug
    Enables debug mode, providing more verbose logging and potentially aiding in troubleshooting issues.

-h, --help
    Displays a help message with available command-line options and exits.

-v, --version
    Prints the version information of hledger-web and exits.

DESCRIPTION

hledger-web is the official web user interface for hledger, a powerful plain-text accounting system. It provides a convenient way to view, analyze, and manage your financial transactions through a modern web browser. Users can explore balances, generate reports, view register entries, and even add new transactions via an intuitive HTML interface. By default, it serves content on http://localhost:5000 and automatically attempts to open a browser window to this address. It's a key component for users who prefer a graphical interface over the command-line for their hledger workflow, making financial data more accessible and interactive.

CAVEATS

  • Security: hledger-web does not provide built-in authentication or encryption (HTTPS). It is generally intended for local use or behind a secure reverse proxy that handles authentication and SSL/TLS. Exposing it directly to the internet without proper security measures is strongly discouraged.
  • Dependencies: Requires a working hledger installation to parse journal files and perform calculations.
  • Journal Format: Relies on the strict plain-text accounting format of hledger journal files. Malformed files may lead to errors or unexpected behavior.

DEFAULT BEHAVIOR

By default, hledger-web listens on localhost:5000 and automatically attempts to open your default web browser to this address upon startup.

EXTENSIBILITY

While primarily a viewer, hledger-web allows basic transaction entry and can be customized by serving custom static files or integrating with other tools via its base URL option.

PLAIN TEXT FOCUS

Despite being a web interface, hledger-web adheres to hledger's core philosophy of plain-text accounting, ensuring your financial data remains in a human-readable, auditable format, stored directly in your journal files.

HISTORY

hledger-web emerged as a key component of the hledger ecosystem, which began as a Haskell-based re-implementation of the popular ledger command-line accounting system. The hledger project, initiated by Simon Michael, aimed to provide a robust, cross-platform, and extensible plain-text accounting solution. Recognizing the growing demand for graphical interfaces, hledger-web was developed to offer an accessible browser-based UI, broadening hledger's appeal beyond command-line enthusiasts. Its development has closely paralleled that of the core hledger tool, continuously adding features and improving usability for web-centric financial management.

SEE ALSO

hledger(1), hledger-cli(1), hledger-report(1), ledger(1)

Copied to clipboard