hledger-web 1.51.2 → 1.52
raw patch · 7 files changed
+740/−706 lines, 7 filesdep ~hledgerdep ~hledger-libPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hledger, hledger-lib
API changes (from Hackage documentation)
+ Hledger.Web.Import: typedContentToSnippet :: TypedContent -> Int64 -> Maybe Text
Files
- CHANGES.md +21/−0
- Hledger/Web/Main.hs +0/−4
- config/openapi.yaml +181/−154
- hledger-web.1 +137/−137
- hledger-web.cabal +8/−8
- hledger-web.info +11/−11
- hledger-web.txt +382/−392
CHANGES.md view
@@ -23,6 +23,21 @@ See also the hledger changelog. +# 1.52 2026-03-20++Fixes++- The less pager (used for displaying help, eg) is now invoked more robustly; we catch and report more kinds of failure clearly.+ [#2544]++Docs++- openapi.yaml (the OpenAPI spec for hledger-web's JSON API) has been updated.+ (n0vdd)++[#2544]: https://github.com/simonmichael/hledger/issues/2544++ # 1.51.2 2026-01-08 - The register view now prevents line wrapping in dates when the window is narrow. [#2520]@@ -31,6 +46,7 @@ [#2520]: https://github.com/simonmichael/hledger/issues/2520 + # 1.51.1 2025-12-08 - Uses hledger 1.51.1.@@ -41,6 +57,11 @@ Improvements - Uses hledger 1.51.+++# 1.50.5 2025-12-08++- Uses hledger 1.50.5. # 1.50.4 2025-12-04
Hledger/Web/Main.hs view
@@ -77,10 +77,6 @@ #endif #endif - -- try to encourage user's $PAGER to properly display ANSI (in command line help)- usecolor <- useColorOnStdout- when usecolor setupPager- wopts@WebOpts{cliopts_=copts@CliOpts{debug_, rawopts_}} <- getHledgerWebOpts when (debug_ > 0) $ printf "%s\n" prognameandversion >> printf "opts: %s\n" (show wopts) if
config/openapi.yaml view
@@ -111,6 +111,7 @@ required: - acommodity - acost+ - acostbasis - aquantity - astyle properties:@@ -126,11 +127,13 @@ required: - acommodity - acost+ - acostbasis - aquantity - astyle properties: acommodity: {} acost: {}+ acostbasis: {} aquantity: required: - decimalMantissa@@ -156,6 +159,7 @@ asprecision: {} asrounding: {} tag: {}+ acostbasis: {} aquantity: required: - decimalMantissa@@ -276,171 +280,190 @@ items: required: - aboring+ - adata - adeclarationinfo- - aebalance- - aibalance - aname- - anumpostings - aparent_ - asubs - asubs_ properties: aname: {} adeclarationinfo: {}- aebalance:- items:- required:- - acommodity- - acost- - aquantity- - astyle- properties:- acommodity: {}- acost:- anyOf:- - {}- - required:- - contents- - tag- properties:- contents:- required:- - acommodity- - acost- - aquantity- - astyle- properties:- acommodity: {}- acost: {}- aquantity:- required:- - decimalMantissa- - decimalPlaces- - floatingPoint- properties:- decimalMantissa: {}- decimalPlaces: {}- floatingPoint: {}- astyle:- required:- - ascommodityside- - ascommodityspaced- - asdecimalmark- - asdigitgroups- - asprecision- - asrounding- properties:- ascommodityside: {}- ascommodityspaced: {}- asdecimalmark: {}- asdigitgroups: {}- asprecision: {}- asrounding: {}- tag: {}- aquantity:- required:- - decimalMantissa- - decimalPlaces- - floatingPoint- properties:- decimalMantissa: {}- decimalPlaces: {}- floatingPoint: {}- astyle:- required:- - ascommodityside- - ascommodityspaced- - asdecimalmark- - asdigitgroups- - asprecision- - asrounding- properties:- ascommodityside: {}- ascommodityspaced: {}- asdecimalmark: {}- asdigitgroups: {}- asprecision: {}- asrounding: {}- aibalance:- items:- required:- - acommodity- - acost- - aquantity- - astyle- properties:- acommodity: {}- acost:- anyOf:- - {}- - required:- - contents- - tag- properties:- contents:- required:- - acommodity- - acost- - aquantity- - astyle- properties:- acommodity: {}- acost: {}- aquantity:- required:- - decimalMantissa- - decimalPlaces- - floatingPoint- properties:- decimalMantissa: {}- decimalPlaces: {}- floatingPoint: {}- astyle:- required:- - ascommodityside- - ascommodityspaced- - asdecimalmark- - asdigitgroups- - asprecision- - asrounding- properties:- ascommodityside: {}- ascommodityspaced: {}- asdecimalmark: {}- asdigitgroups: {}- asprecision: {}- asrounding: {}- tag: {}- aquantity:- required:- - decimalMantissa- - decimalPlaces- - floatingPoint- properties:- decimalMantissa: {}- decimalPlaces: {}- floatingPoint: {}- astyle:- required:- - ascommodityside- - ascommodityspaced- - asdecimalmark- - asdigitgroups- - asprecision- - asrounding- properties:- ascommodityside: {}- ascommodityspaced: {}- asdecimalmark: {}- asdigitgroups: {}- asprecision: {}- asrounding: {}- anumpostings: {}- aboring: {} aparent_: {} asubs_: items: {}- asubs: {}+ asubs:+ items: {}+ aboring: {}+ adata:+ required:+ - pdpre+ - pdperiods+ properties:+ pdpre:+ required:+ - bdexcludingsubs+ - bdincludingsubs+ - bdnumpostings+ properties:+ bdexcludingsubs:+ items:+ required:+ - acommodity+ - acost+ - acostbasis+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost:+ anyOf:+ - {}+ - required:+ - contents+ - tag+ properties:+ contents:+ required:+ - acommodity+ - acost+ - acostbasis+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost: {}+ acostbasis: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ tag: {}+ acostbasis: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ bdincludingsubs:+ items:+ required:+ - acommodity+ - acost+ - acostbasis+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost:+ anyOf:+ - {}+ - required:+ - contents+ - tag+ properties:+ contents:+ required:+ - acommodity+ - acost+ - acostbasis+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost: {}+ acostbasis: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ tag: {}+ acostbasis: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ bdnumpostings: {}+ pdperiods: {} security: - apikey_cookie__session: [] - apikey_header_cookie: []@@ -473,11 +496,13 @@ required: - acommodity - acost+ - acostbasis - aquantity - astyle properties: acommodity: {} acost: {}+ acostbasis: {} aquantity: required: - decimalMantissa@@ -542,11 +567,13 @@ required: - acommodity - acost+ - acostbasis - aquantity - astyle properties: acommodity: {} acost: {}+ acostbasis: {} aquantity: required: - decimalMantissa
hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "HLEDGER\-WEB" "1" "December 2025" "hledger-web-1.51.2 " "hledger User Manuals"+.TH "HLEDGER\-WEB" "1" "March 2026" "hledger-web-1.52 " "hledger User Manuals" @@ -17,7 +17,7 @@ .PD \f[CR]hledger web [OPTS] [QUERY]\f[R] .SH DESCRIPTION-This manual is for hledger\[aq]s web interface, version 1.51.2.+This manual is for hledger\(aqs web interface, version 1.52. See also the hledger manual for common concepts and file formats. .PP hledger is a robust, user\-friendly, cross\-platform set of programs for@@ -50,14 +50,14 @@ (See hledger(1) \-> Input for details.) .PP hledger\-web can be run in three modes:-.IP \[bu] 2+.IP \(bu 2 \f[CR]\-\-serve\-browse\f[R] mode (the default): the app serves the web UI and JSON API, and opens your default web browser to show the app if possible, and exits automatically after two minutes of inactivity (with no requests received and no open browser windows viewing it).-.IP \[bu] 2+.IP \(bu 2 \f[CR]\-\-serve\f[R]: the app just serves the web UI and JSON API.-.IP \[bu] 2+.IP \(bu 2 \f[CR]\-\-serve\-api\f[R]: the app just serves the JSON API. .PP In all cases hledger\-web runs as a foreground process, logging requests@@ -67,22 +67,22 @@ .IP .EX Flags:- \-\-serve \-\-server serve and log requests, don\[aq]t browse or auto\-exit+ \-\-serve \-\-server serve and log requests, don\(aqt browse or auto\-exit \-\-serve\-api like \-\-serve, but serve only the JSON web API, not the web UI- \-\-allow=view|add|edit set the user\[aq]s access level for changing data- (default: \[ga]add\[ga]). It also accepts \[ga]sandstorm\[ga] for+ \-\-allow=view|add|edit set the user\(aqs access level for changing data+ (default: \(gaadd\(ga). It also accepts \(gasandstorm\(ga for use on that platform (reads permissions from the- \[ga]X\-Sandstorm\-Permissions\[ga] request header).+ \(gaX\-Sandstorm\-Permissions\(ga request header). \-\-cors=ORIGIN allow cross\-origin requests from the specified- origin; setting ORIGIN to \[dq]*\[dq] allows requests from+ origin; setting ORIGIN to \(dq*\(dq allows requests from any origin \-\-host=IPADDR listen on this IP address (default: 127.0.0.1) \-\-port=PORT listen on this TCP port (default: 5000) \-\-socket=SOCKET listen on the given unix socket instead of an IP address and port (unix only; implies \-\-serve) \-\-base\-url=BASEURL set the base url (default: http://IPADDR:PORT)- \-\-test run hledger\-web\[aq]s tests and exit. hspec test+ \-\-test run hledger\-web\(aqs tests and exit. hspec test runner args may follow a \-\-, eg: hledger\-web \-\-test \-\-help .EE@@ -93,7 +93,7 @@ To allow access from elsewhere, use \f[CR]\-\-host\f[R] to specify an externally accessible address configured on this machine, The special address \f[CR]0.0.0.0\f[R] causes it to listen on all of this-machine\[aq]s addresses.+machine\(aqs addresses. .PP Similarly, you can use \f[CR]\-\-port\f[R] to listen on a TCP port other than 5000.@@ -109,14 +109,14 @@ \f[CR]proxy_pass http://unix:/tmp/hledger/${remote_user}.socket;\f[R].) .PP You can use \f[CR]\-\-base\-url\f[R] to change the protocol, hostname,-port and path that appear in hledger\-web\[aq]s hyperlinks.+port and path that appear in hledger\-web\(aqs hyperlinks. This is useful eg when integrating hledger\-web within a larger website.-The default is \f[CR]http://HOST:PORT/\f[R] using the server\[aq]s+The default is \f[CR]http://HOST:PORT/\f[R] using the server\(aqs configured host address and TCP port (or \f[CR]http://HOST\f[R] if PORT is 80). Note this affects url generation but not route parsing. .PP-hledger\-web also supports many of hledger\[aq]s general options:+hledger\-web also supports many of hledger\(aqs general options: .IP .EX General input/data transformation flags:@@ -130,18 +130,18 @@ \-\-alias=A=B|/RGX/=RPL transform account names from A to B, or by replacing regular expression matches \-\-auto generate extra postings by applying auto posting- rules (\[dq]=\[dq]) to all transactions+ rules (\(dq=\(dq) to all transactions \-\-forecast[=PERIOD] Generate extra transactions from periodic rules- (\[dq]\[ti]\[dq]), from after the latest ordinary transaction+ (\(dq\(ti\(dq), from after the latest ordinary transaction until 6 months from now. Or, during the specified PERIOD (the equals is required). Auto posting rules will also be applied to these transactions. In hledger\-ui, also make future\-dated transactions visible at startup.- \-I \-\-ignore\-assertions don\[aq]t check balance assertions by default+ \-I \-\-ignore\-assertions don\(aqt check balance assertions by default \-\-txn\-balancing=... how to check that transactions are balanced:- \[aq]old\[aq]: use global display precision- \[aq]exact\[aq]: use transaction precision (default)+ \(aqold\(aq: use global display precision+ \(aqexact\(aq: use transaction precision (default) \-\-infer\-costs infer conversion equity postings from costs \-\-infer\-equity infer costs from conversion equity postings \-\-infer\-market\-prices infer market prices from costs@@ -161,7 +161,7 @@ \-Y \-\-yearly multiperiod report with 1 year interval \-p \-\-period=PERIODEXP set begin date, end date, and/or report interval, with more flexibility- \-\-today=DATE override today\[aq]s date (affects relative dates)+ \-\-today=DATE override today\(aqs date (affects relative dates) \-\-date2 match/use secondary dates instead (deprecated) \-U \-\-unmarked include only unmarked postings/transactions \-P \-\-pending include only pending postings/transactions@@ -183,14 +183,14 @@ \-\-value=WHEN[,COMM] show amounts converted to their value on the specified date(s) in their default valuation commodity or a specified commodity. WHEN can be:- \[aq]then\[aq]: value on transaction dates- \[aq]end\[aq]: value at period end(s)- \[aq]now\[aq]: value today+ \(aqthen\(aq: value on transaction dates+ \(aqend\(aq: value at period end(s)+ \(aqnow\(aq: value today YYYY\-MM\-DD: value on given date- \-c \-\-commodity\-style=S Override a commodity\[aq]s display style.- Eg: \-c \[aq].\[aq] or \-c \[aq]1.000,00 EUR\[aq]+ \-c \-\-commodity\-style=S Override a commodity\(aqs display style.+ Eg: \-c \(aq.\(aq or \-c \(aq1.000,00 EUR\(aq \-\-pretty[=YN] Use box\-drawing characters in text output? Can be- \[aq]y\[aq]/\[aq]yes\[aq] or \[aq]n\[aq]/\[aq]no\[aq].+ \(aqy\(aq/\(aqyes\(aq or \(aqn\(aq/\(aqno\(aq. If YN is specified, the equals is required. General help flags:@@ -208,7 +208,7 @@ \f[CR]hledger\-ui\f[R], and unlike \f[CR]hledger\f[R]). Using the \f[CR]\-E/\-\-empty\f[R] flag will reverse this behaviour. If you see accounts which appear to have a zero balance, but cannot be-hidden with \f[CR]\-E\f[R], it\[aq]s because they have a mixed\-cost+hidden with \f[CR]\-E\f[R], it\(aqs because they have a mixed\-cost balance, which looks like zero when costs are hidden. (hledger\-web does not show costs.) .PP@@ -224,27 +224,27 @@ journal and to add new transactions, but not to change existing data. .PP You can restrict who can reach it, by-.IP \[bu] 2+.IP \(bu 2 setting the IP address it listens on (see \f[CR]\-\-host\f[R] above). By default it listens on 127.0.0.1, accessible to users on the local machine only.-.IP \[bu] 2+.IP \(bu 2 putting it behind an authenticating proxy, such as caddy or apache-.IP \[bu] 2+.IP \(bu 2 putting it behind a firewall .PP And you can restrict what the users reaching it can do, by specifying the \f[CR]\-\-allow=ACCESSLEVEL\f[R] option at startup. ACCESSLEVEL is one of:-.IP \[bu] 2+.IP \(bu 2 \f[CR]view\f[R] \- allows viewing the journal file(s)-.IP \[bu] 2+.IP \(bu 2 \f[CR]add\f[R] \- also allows adding new transactions to the main journal file-.IP \[bu] 2+.IP \(bu 2 \f[CR]edit\f[R] \- also allows editing, uploading or downloading the journal file(s)-.IP \[bu] 2+.IP \(bu 2 \f[CR]sandstorm\f[R] \- (for the hledger\-web Sandstorm app:) allows whichever of \f[CR]view\f[R], \f[CR]add\f[R], or \f[CR]edit\f[R] are specified in the \f[CR]X\-Sandstorm\-Permissions\f[R] HTTP header@@ -252,7 +252,7 @@ The default access level is \f[CR]add\f[R]. .SH EDITING, UPLOADING, DOWNLOADING If you enable the \f[CR]manage\f[R] capability mentioned above,-you\[aq]ll see a new \[dq]spanner\[dq] button to the right of the search+you\(aqll see a new \(dqspanner\(dq button to the right of the search form. Clicking this will let you edit, upload, or download the journal file or any files it includes.@@ -264,7 +264,7 @@ numbered backup (assuming file permissions allow it, the disk is not full, etc.) hledger\-web is not aware of version control systems, currently; if you-use one, you\[aq]ll have to arrange to commit the changes yourself (eg+use one, you\(aqll have to arrange to commit the changes yourself (eg with a cron job or a file watcher like entr). .PP Changes which would leave the journal file(s) unparseable or non\-valid@@ -305,25 +305,25 @@ .EE .PP Eg, all account names in the journal (similar to the accounts command).-(hledger\-web\[aq]s JSON does not include newlines, here we use python-to prettify it):+(hledger\-web\(aqs JSON does not include newlines, here we use python to+prettify it): .IP .EX $ curl \-s http://127.0.0.1:5000/accountnames | python \-m json.tool [- \[dq]assets\[dq],- \[dq]assets:bank\[dq],- \[dq]assets:bank:checking\[dq],- \[dq]assets:bank:saving\[dq],- \[dq]assets:cash\[dq],- \[dq]expenses\[dq],- \[dq]expenses:food\[dq],- \[dq]expenses:supplies\[dq],- \[dq]income\[dq],- \[dq]income:gifts\[dq],- \[dq]income:salary\[dq],- \[dq]liabilities\[dq],- \[dq]liabilities:debts\[dq]+ \(dqassets\(dq,+ \(dqassets:bank\(dq,+ \(dqassets:bank:checking\(dq,+ \(dqassets:bank:saving\(dq,+ \(dqassets:cash\(dq,+ \(dqexpenses\(dq,+ \(dqexpenses:food\(dq,+ \(dqexpenses:supplies\(dq,+ \(dqincome\(dq,+ \(dqincome:gifts\(dq,+ \(dqincome:salary\(dq,+ \(dqliabilities\(dq,+ \(dqliabilities:debts\(dq ] .EE .PP@@ -333,35 +333,35 @@ $ curl \-s http://127.0.0.1:5000/transactions | python \-m json.tool [ {- \[dq]tcode\[dq]: \[dq]\[dq],- \[dq]tcomment\[dq]: \[dq]\[dq],- \[dq]tdate\[dq]: \[dq]2008\-01\-01\[dq],- \[dq]tdate2\[dq]: null,- \[dq]tdescription\[dq]: \[dq]income\[dq],- \[dq]tindex\[dq]: 1,- \[dq]tpostings\[dq]: [+ \(dqtcode\(dq: \(dq\(dq,+ \(dqtcomment\(dq: \(dq\(dq,+ \(dqtdate\(dq: \(dq2008\-01\-01\(dq,+ \(dqtdate2\(dq: null,+ \(dqtdescription\(dq: \(dqincome\(dq,+ \(dqtindex\(dq: 1,+ \(dqtpostings\(dq: [ {- \[dq]paccount\[dq]: \[dq]assets:bank:checking\[dq],- \[dq]pamount\[dq]: [+ \(dqpaccount\(dq: \(dqassets:bank:checking\(dq,+ \(dqpamount\(dq: [ {- \[dq]acommodity\[dq]: \[dq]$\[dq],- \[dq]aismultiplier\[dq]: false,- \[dq]aprice\[dq]: null,+ \(dqacommodity\(dq: \(dq$\(dq,+ \(dqaismultiplier\(dq: false,+ \(dqaprice\(dq: null, \&... .EE .PP-Most of the JSON corresponds to hledger\[aq]s data types; for details of+Most of the JSON corresponds to hledger\(aqs data types; for details of what the fields mean, see the Hledger.Data.Json haddock docs and click on the various data types, eg Transaction. And for a higher level understanding, see the journal docs. There is also a basic OpenAPI specification. .PP-In some cases there is outer JSON corresponding to a \[dq]Report\[dq]+In some cases there is outer JSON corresponding to a \(dqReport\(dq type. To understand that, go to the Hledger.Web.Handler.MiscR haddock and look at the source for the appropriate handler to see what it returns.-Eg for \f[CR]/accounttransactions\f[R] it\[aq]s getAccounttransactionsR,-returning a \[dq]\f[CR]accountTransactionsReport ...\f[R]\[dq].+Eg for \f[CR]/accounttransactions\f[R] it\(aqs getAccounttransactionsR,+returning a \(dq\f[CR]accountTransactionsReport ...\f[R]\(dq. Looking up the haddock for that we can see that /accounttransactions returns an AccountTransactionsReport, which consists of a report title and a list of AccountTransactionsReportItem (etc).@@ -370,113 +370,113 @@ \f[CR]/add\f[R], if hledger\-web was started with the \f[CR]add\f[R] capability (enabled by default). The payload must be the full, exact JSON representation of a hledger-transaction (partial data won\[aq]t do).-You can get sample JSON from hledger\-web\[aq]s \f[CR]/transactions\f[R]+transaction (partial data won\(aqt do).+You can get sample JSON from hledger\-web\(aqs \f[CR]/transactions\f[R] or \f[CR]/accounttransactions\f[R], or you can export it with hledger\-lib, eg like so: .IP .EX \&.../hledger$ stack ghci hledger\-lib->>> writeJsonFile \[dq]txn.json\[dq] (head $ jtxns samplejournal)+>>> writeJsonFile \(dqtxn.json\(dq (head $ jtxns samplejournal) >>> :q .EE .PP-Here\[aq]s how it looks as of hledger\-1.17 (remember, this JSON-corresponds to hledger\[aq]s Transaction and related data types):+Here\(aqs how it looks as of hledger\-1.17 (remember, this JSON+corresponds to hledger\(aqs Transaction and related data types): .IP .EX {- \[dq]tcomment\[dq]: \[dq]\[dq],- \[dq]tpostings\[dq]: [+ \(dqtcomment\(dq: \(dq\(dq,+ \(dqtpostings\(dq: [ {- \[dq]pbalanceassertion\[dq]: \f[B]null\f[R],- \[dq]pstatus\[dq]: \[dq]Unmarked\[dq],- \[dq]pamount\[dq]: [+ \(dqpbalanceassertion\(dq: \f[B]null\f[R],+ \(dqpstatus\(dq: \(dqUnmarked\(dq,+ \(dqpamount\(dq: [ {- \[dq]aprice\[dq]: \f[B]null\f[R],- \[dq]acommodity\[dq]: \[dq]$\[dq],- \[dq]aquantity\[dq]: {- \[dq]floatingPoint\[dq]: 1,- \[dq]decimalPlaces\[dq]: 10,- \[dq]decimalMantissa\[dq]: 10000000000+ \(dqaprice\(dq: \f[B]null\f[R],+ \(dqacommodity\(dq: \(dq$\(dq,+ \(dqaquantity\(dq: {+ \(dqfloatingPoint\(dq: 1,+ \(dqdecimalPlaces\(dq: 10,+ \(dqdecimalMantissa\(dq: 10000000000 },- \[dq]aismultiplier\[dq]: \f[B]false\f[R],- \[dq]astyle\[dq]: {- \[dq]ascommodityside\[dq]: \[dq]L\[dq],- \[dq]asdigitgroups\[dq]: \f[B]null\f[R],- \[dq]ascommodityspaced\[dq]: \f[B]false\f[R],- \[dq]asprecision\[dq]: 2,- \[dq]asdecimalpoint\[dq]: \[dq].\[dq]+ \(dqaismultiplier\(dq: \f[B]false\f[R],+ \(dqastyle\(dq: {+ \(dqascommodityside\(dq: \(dqL\(dq,+ \(dqasdigitgroups\(dq: \f[B]null\f[R],+ \(dqascommodityspaced\(dq: \f[B]false\f[R],+ \(dqasprecision\(dq: 2,+ \(dqasdecimalpoint\(dq: \(dq.\(dq } } ],- \[dq]ptransaction_\[dq]: \[dq]1\[dq],- \[dq]paccount\[dq]: \[dq]assets:bank:checking\[dq],- \[dq]pdate\[dq]: \f[B]null\f[R],- \[dq]ptype\[dq]: \[dq]RegularPosting\[dq],- \[dq]pcomment\[dq]: \[dq]\[dq],- \[dq]pdate2\[dq]: \f[B]null\f[R],- \[dq]ptags\[dq]: [],- \[dq]poriginal\[dq]: \f[B]null\f[R]+ \(dqptransaction_\(dq: \(dq1\(dq,+ \(dqpaccount\(dq: \(dqassets:bank:checking\(dq,+ \(dqpdate\(dq: \f[B]null\f[R],+ \(dqptype\(dq: \(dqRegularPosting\(dq,+ \(dqpcomment\(dq: \(dq\(dq,+ \(dqpdate2\(dq: \f[B]null\f[R],+ \(dqptags\(dq: [],+ \(dqporiginal\(dq: \f[B]null\f[R] }, {- \[dq]pbalanceassertion\[dq]: \f[B]null\f[R],- \[dq]pstatus\[dq]: \[dq]Unmarked\[dq],- \[dq]pamount\[dq]: [+ \(dqpbalanceassertion\(dq: \f[B]null\f[R],+ \(dqpstatus\(dq: \(dqUnmarked\(dq,+ \(dqpamount\(dq: [ {- \[dq]aprice\[dq]: \f[B]null\f[R],- \[dq]acommodity\[dq]: \[dq]$\[dq],- \[dq]aquantity\[dq]: {- \[dq]floatingPoint\[dq]: \-1,- \[dq]decimalPlaces\[dq]: 10,- \[dq]decimalMantissa\[dq]: \-10000000000+ \(dqaprice\(dq: \f[B]null\f[R],+ \(dqacommodity\(dq: \(dq$\(dq,+ \(dqaquantity\(dq: {+ \(dqfloatingPoint\(dq: \-1,+ \(dqdecimalPlaces\(dq: 10,+ \(dqdecimalMantissa\(dq: \-10000000000 },- \[dq]aismultiplier\[dq]: \f[B]false\f[R],- \[dq]astyle\[dq]: {- \[dq]ascommodityside\[dq]: \[dq]L\[dq],- \[dq]asdigitgroups\[dq]: \f[B]null\f[R],- \[dq]ascommodityspaced\[dq]: \f[B]false\f[R],- \[dq]asprecision\[dq]: 2,- \[dq]asdecimalpoint\[dq]: \[dq].\[dq]+ \(dqaismultiplier\(dq: \f[B]false\f[R],+ \(dqastyle\(dq: {+ \(dqascommodityside\(dq: \(dqL\(dq,+ \(dqasdigitgroups\(dq: \f[B]null\f[R],+ \(dqascommodityspaced\(dq: \f[B]false\f[R],+ \(dqasprecision\(dq: 2,+ \(dqasdecimalpoint\(dq: \(dq.\(dq } } ],- \[dq]ptransaction_\[dq]: \[dq]1\[dq],- \[dq]paccount\[dq]: \[dq]income:salary\[dq],- \[dq]pdate\[dq]: \f[B]null\f[R],- \[dq]ptype\[dq]: \[dq]RegularPosting\[dq],- \[dq]pcomment\[dq]: \[dq]\[dq],- \[dq]pdate2\[dq]: \f[B]null\f[R],- \[dq]ptags\[dq]: [],- \[dq]poriginal\[dq]: \f[B]null\f[R]+ \(dqptransaction_\(dq: \(dq1\(dq,+ \(dqpaccount\(dq: \(dqincome:salary\(dq,+ \(dqpdate\(dq: \f[B]null\f[R],+ \(dqptype\(dq: \(dqRegularPosting\(dq,+ \(dqpcomment\(dq: \(dq\(dq,+ \(dqpdate2\(dq: \f[B]null\f[R],+ \(dqptags\(dq: [],+ \(dqporiginal\(dq: \f[B]null\f[R] } ],- \[dq]ttags\[dq]: [],- \[dq]tsourcepos\[dq]: {- \[dq]tag\[dq]: \[dq]JournalSourcePos\[dq],- \[dq]contents\[dq]: [- \[dq]\[dq],+ \(dqttags\(dq: [],+ \(dqtsourcepos\(dq: {+ \(dqtag\(dq: \(dqJournalSourcePos\(dq,+ \(dqcontents\(dq: [+ \(dq\(dq, [ 1, 1 ] ] },- \[dq]tdate\[dq]: \[dq]2008\-01\-01\[dq],- \[dq]tcode\[dq]: \[dq]\[dq],- \[dq]tindex\[dq]: 1,- \[dq]tprecedingcomment\[dq]: \[dq]\[dq],- \[dq]tdate2\[dq]: \f[B]null\f[R],- \[dq]tdescription\[dq]: \[dq]income\[dq],- \[dq]tstatus\[dq]: \[dq]Unmarked\[dq]+ \(dqtdate\(dq: \(dq2008\-01\-01\(dq,+ \(dqtcode\(dq: \(dq\(dq,+ \(dqtindex\(dq: 1,+ \(dqtprecedingcomment\(dq: \(dq\(dq,+ \(dqtdate2\(dq: \f[B]null\f[R],+ \(dqtdescription\(dq: \(dqincome\(dq,+ \(dqtstatus\(dq: \(dqUnmarked\(dq } .EE .PP-And here\[aq]s how to test adding it with curl.+And here\(aqs how to test adding it with curl. This should add a new entry to your journal: .IP .EX-$ curl http://127.0.0.1:5000/add \-X PUT \-H \[aq]Content\-Type: application/json\[aq] \-\-data\-binary \[at]txn.json+$ curl http://127.0.0.1:5000/add \-X PUT \-H \(aqContent\-Type: application/json\(aq \-\-data\-binary \(attxn.json .EE .SH DEBUG OUTPUT .SS Debug output
hledger-web.cabal view
@@ -1,11 +1,11 @@ cabal-version: 2.2 --- This file has been generated from package.yaml by hpack version 0.38.1.+-- This file has been generated from package.yaml by hpack version 0.39.1. -- -- see: https://github.com/sol/hpack name: hledger-web-version: 1.51.2+version: 1.52 synopsis: Web user interface for the hledger accounting system description: A simple web user interface for the hledger accounting system, providing a more modern UI than the command-line or terminal interfaces.@@ -154,7 +154,7 @@ hs-source-dirs: ./ ghc-options: -Wall -Wno-incomplete-uni-patterns -Wno-missing-signatures -Wno-orphans -Wno-type-defaults -Wno-unused-do-bind -threaded- cpp-options: -DVERSION="1.51.2"+ cpp-options: -DVERSION="1.52" build-depends: Decimal >=0.5.1 , aeson >=1 && <2.3@@ -176,8 +176,8 @@ , filepath , githash >=0.1.6.2 , hjsmin- , hledger >=1.51.2 && <1.52- , hledger-lib >=1.51.2 && <1.52+ , hledger ==1.52.*+ , hledger-lib ==1.52.* , hspec , http-client , http-conduit@@ -203,7 +203,7 @@ , yesod >=1.4 && <1.7 , yesod-core >=1.4 && <1.7 , yesod-form >=1.4 && <1.8- , yesod-static >=1.4 && <1.7+ , yesod-static >=1.4 && <1.6.1.1 , yesod-test default-language: GHC2021 if (flag(dev)) || (flag(library-only))@@ -222,7 +222,7 @@ hs-source-dirs: app ghc-options: -Wall -Wno-incomplete-uni-patterns -Wno-missing-signatures -Wno-orphans -Wno-type-defaults -Wno-unused-do-bind -threaded- cpp-options: -DVERSION="1.51.2"+ cpp-options: -DVERSION="1.52" build-depends: base >=4.18 && <4.23 , hledger-web@@ -242,7 +242,7 @@ hs-source-dirs: test ghc-options: -Wall -Wno-incomplete-uni-patterns -Wno-missing-signatures -Wno-orphans -Wno-type-defaults -Wno-unused-do-bind -threaded- cpp-options: -DVERSION="1.51.2"+ cpp-options: -DVERSION="1.52" build-depends: base >=4.18 && <4.23 , hledger-web
hledger-web.info view
@@ -1,4 +1,4 @@-This is hledger-web.info, produced by makeinfo version 7.2 from stdin.+This is hledger-web.info, produced by makeinfo version 7.3 from stdin. INFO-DIR-SECTION User Applications START-INFO-DIR-ENTRY@@ -18,7 +18,7 @@ or 'hledger web [OPTS] [QUERY]' - This manual is for hledger's web interface, version 1.51.2. See also+ This manual is for hledger's web interface, version 1.52. See also the hledger manual for common concepts and file formats. hledger is a robust, user-friendly, cross-platform set of programs@@ -528,15 +528,15 @@ Tag Table: Node: Top223-Node: OPTIONS2577-Node: PERMISSIONS11475-Node: EDITING UPLOADING DOWNLOADING12625-Node: RELOADING13640-Node: JSON API14207-Node: DEBUG OUTPUT19856-Node: Debug output20008-Node: ENVIRONMENT20526-Node: BUGS20762+Node: OPTIONS2575+Node: PERMISSIONS11473+Node: EDITING UPLOADING DOWNLOADING12623+Node: RELOADING13638+Node: JSON API14205+Node: DEBUG OUTPUT19854+Node: Debug output20006+Node: ENVIRONMENT20524+Node: BUGS20760 End Tag Table
hledger-web.txt view
@@ -1,483 +1,473 @@ -HLEDGER-WEB(1) hledger User Manuals HLEDGER-WEB(1)+HLEDGER-WEB(1) hledger User Manuals HLEDGER-WEB(1) NAME- hledger-web - web interface and API for hledger, a robust, friendly- plain text accounting app.+ hledger-web - web interface and API for hledger, a robust, friendly plain+ text accounting app. SYNOPSIS- hledger-web [OPTS] [QUERY]- or- hledger web [OPTS] [QUERY]+ hledger-web [OPTS] [QUERY]+ or+ hledger web [OPTS] [QUERY] DESCRIPTION- This manual is for hledger's web interface, version 1.51.2. See also- the hledger manual for common concepts and file formats.+ This manual is for hledger's web interface, version 1.52. See also the+ hledger manual for common concepts and file formats. - hledger is a robust, user-friendly, cross-platform set of programs for- tracking money, time, or any other commodity, using double-entry ac-- counting and a simple, editable file format. hledger is inspired by- and largely compatible with ledger(1), and largely interconvertible- with beancount(1).+ hledger is a robust, user-friendly, cross-platform set of programs for+ tracking money, time, or any other commodity, using double-entry accounting+ and a simple, editable file format. hledger is inspired by and largely+ compatible with ledger(1), and largely interconvertible with beancount(1). - hledger-web is a simple web application for browsing and adding trans-- actions. It provides a more user-friendly UI than the hledger CLI or- hledger-ui TUI, showing more at once (accounts, the current account- register, balance charts) and allowing history-aware data entry, inter-- active searching, and bookmarking.+ hledger-web is a simple web application for browsing and adding transac-+ tions. It provides a more user-friendly UI than the hledger CLI or+ hledger-ui TUI, showing more at once (accounts, the current account regis-+ ter, balance charts) and allowing history-aware data entry, interactive+ searching, and bookmarking. - hledger-web also lets you share a journal with multiple users, or even- the public web. There is no access control, so if you need that you- should put it behind a suitable web proxy. As a small protection- against data loss when running an unprotected instance, it writes a- numbered backup of the main journal file (only) on every edit.+ hledger-web also lets you share a journal with multiple users, or even the+ public web. There is no access control, so if you need that you should put+ it behind a suitable web proxy. As a small protection against data loss+ when running an unprotected instance, it writes a numbered backup of the+ main journal file (only) on every edit. - Like hledger, it reads from (and appends to) a journal file specified- by the LEDGER_FILE environment variable (defaulting to- $HOME/.hledger.journal); or you can specify files with -f options. It- can also read timeclock files, timedot files, or any CSV/SSV/TSV file- with a date field. (See hledger(1) -> Input for details.)+ Like hledger, it reads from (and appends to) a journal file specified by+ the LEDGER_FILE environment variable (defaulting to $HOME/.hledger.jour-+ nal); or you can specify files with -f options. It can also read timeclock+ files, timedot files, or any CSV/SSV/TSV file with a date field. (See+ hledger(1) -> Input for details.) - hledger-web can be run in three modes:+ hledger-web can be run in three modes: - o --serve-browse mode (the default): the app serves the web UI and JSON- API, and opens your default web browser to show the app if possible,- and exits automatically after two minutes of inactivity (with no re-- quests received and no open browser windows viewing it).+ * --serve-browse mode (the default): the app serves the web UI and JSON+ API, and opens your default web browser to show the app if possible, and+ exits automatically after two minutes of inactivity (with no requests re-+ ceived and no open browser windows viewing it). - o --serve: the app just serves the web UI and JSON API.+ * --serve: the app just serves the web UI and JSON API. - o --serve-api: the app just serves the JSON API.+ * --serve-api: the app just serves the JSON API. - In all cases hledger-web runs as a foreground process, logging requests- to stdout.+ In all cases hledger-web runs as a foreground process, logging requests to+ stdout. OPTIONS- hledger-web provides the following options:+ hledger-web provides the following options: - Flags:- --serve --server serve and log requests, don't browse or auto-exit- --serve-api like --serve, but serve only the JSON web API,- not the web UI- --allow=view|add|edit set the user's access level for changing data- (default: `add`). It also accepts `sandstorm` for- use on that platform (reads permissions from the- `X-Sandstorm-Permissions` request header).- --cors=ORIGIN allow cross-origin requests from the specified- origin; setting ORIGIN to "*" allows requests from- any origin- --host=IPADDR listen on this IP address (default: 127.0.0.1)- --port=PORT listen on this TCP port (default: 5000)- --socket=SOCKET listen on the given unix socket instead of an IP- address and port (unix only; implies --serve)- --base-url=BASEURL set the base url (default: http://IPADDR:PORT)- --test run hledger-web's tests and exit. hspec test- runner args may follow a --, eg: hledger-web --test- --help+ Flags:+ --serve --server serve and log requests, don't browse or auto-exit+ --serve-api like --serve, but serve only the JSON web API,+ not the web UI+ --allow=view|add|edit set the user's access level for changing data+ (default: `add`). It also accepts `sandstorm` for+ use on that platform (reads permissions from the+ `X-Sandstorm-Permissions` request header).+ --cors=ORIGIN allow cross-origin requests from the specified+ origin; setting ORIGIN to "*" allows requests from+ any origin+ --host=IPADDR listen on this IP address (default: 127.0.0.1)+ --port=PORT listen on this TCP port (default: 5000)+ --socket=SOCKET listen on the given unix socket instead of an IP+ address and port (unix only; implies --serve)+ --base-url=BASEURL set the base url (default: http://IPADDR:PORT)+ --test run hledger-web's tests and exit. hspec test+ runner args may follow a --, eg: hledger-web --test+ --help - By default hledger-web listens only on IP address 127.0.0.1, which be- accessed only from the local machine.+ By default hledger-web listens only on IP address 127.0.0.1, which be ac-+ cessed only from the local machine. - To allow access from elsewhere, use --host to specify an externally ac-- cessible address configured on this machine, The special address- 0.0.0.0 causes it to listen on all of this machine's addresses.+ To allow access from elsewhere, use --host to specify an externally acces-+ sible address configured on this machine, The special address 0.0.0.0+ causes it to listen on all of this machine's addresses. - Similarly, you can use --port to listen on a TCP port other than 5000.- This is useful if you want to run multiple hledger-web instances on a- machine.+ Similarly, you can use --port to listen on a TCP port other than 5000.+ This is useful if you want to run multiple hledger-web instances on a ma-+ chine. - When --socket is used, hledger-web creates and communicates via a- socket file instead of a TCP port. This can be more secure, respects- unix file permissions, and makes certain use cases easier, such as run-- ning per-user instances behind an nginx reverse proxy. (Eg: proxy_pass- http://unix:/tmp/hledger/${remote_user}.socket;.)+ When --socket is used, hledger-web creates and communicates via a socket+ file instead of a TCP port. This can be more secure, respects unix file+ permissions, and makes certain use cases easier, such as running per-user+ instances behind an nginx reverse proxy. (Eg: proxy_pass+ http://unix:/tmp/hledger/${remote_user}.socket;.) - You can use --base-url to change the protocol, hostname, port and path- that appear in hledger-web's hyperlinks. This is useful eg when inte-- grating hledger-web within a larger website. The default is- http://HOST:PORT/ using the server's configured host address and TCP- port (or http://HOST if PORT is 80). Note this affects url generation- but not route parsing.+ You can use --base-url to change the protocol, hostname, port and path that+ appear in hledger-web's hyperlinks. This is useful eg when integrating+ hledger-web within a larger website. The default is http://HOST:PORT/ us-+ ing the server's configured host address and TCP port (or http://HOST if+ PORT is 80). Note this affects url generation but not route parsing. - hledger-web also supports many of hledger's general options:+ hledger-web also supports many of hledger's general options: - General input/data transformation flags:- -f --file=[FMT:]FILE Read data from FILE, or from stdin if FILE is -,- inferring format from extension or a FMT: prefix.- Can be specified more than once. If not specified,- reads from $LEDGER_FILE or $HOME/.hledger.journal.- --rules=RULESFILE Use rules defined in this rules file for- converting subsequent CSV/SSV/TSV files. If not- specified, uses FILE.csv.rules for each FILE.csv.- --alias=A=B|/RGX/=RPL transform account names from A to B, or by- replacing regular expression matches- --auto generate extra postings by applying auto posting- rules ("=") to all transactions- --forecast[=PERIOD] Generate extra transactions from periodic rules- ("~"), from after the latest ordinary transaction- until 6 months from now. Or, during the specified- PERIOD (the equals is required). Auto posting rules- will also be applied to these transactions. In- hledger-ui, also make future-dated transactions- visible at startup.- -I --ignore-assertions don't check balance assertions by default- --txn-balancing=... how to check that transactions are balanced:- 'old': use global display precision- 'exact': use transaction precision (default)- --infer-costs infer conversion equity postings from costs- --infer-equity infer costs from conversion equity postings- --infer-market-prices infer market prices from costs- --pivot=TAGNAME use a different field or tag as account names- -s --strict do extra error checks (and override -I)- --verbose-tags add tags indicating generated/modified data+ General input/data transformation flags:+ -f --file=[FMT:]FILE Read data from FILE, or from stdin if FILE is -,+ inferring format from extension or a FMT: prefix.+ Can be specified more than once. If not specified,+ reads from $LEDGER_FILE or $HOME/.hledger.journal.+ --rules=RULESFILE Use rules defined in this rules file for+ converting subsequent CSV/SSV/TSV files. If not+ specified, uses FILE.csv.rules for each FILE.csv.+ --alias=A=B|/RGX/=RPL transform account names from A to B, or by+ replacing regular expression matches+ --auto generate extra postings by applying auto posting+ rules ("=") to all transactions+ --forecast[=PERIOD] Generate extra transactions from periodic rules+ ("~"), from after the latest ordinary transaction+ until 6 months from now. Or, during the specified+ PERIOD (the equals is required). Auto posting rules+ will also be applied to these transactions. In+ hledger-ui, also make future-dated transactions+ visible at startup.+ -I --ignore-assertions don't check balance assertions by default+ --txn-balancing=... how to check that transactions are balanced:+ 'old': use global display precision+ 'exact': use transaction precision (default)+ --infer-costs infer conversion equity postings from costs+ --infer-equity infer costs from conversion equity postings+ --infer-market-prices infer market prices from costs+ --pivot=TAGNAME use a different field or tag as account names+ -s --strict do extra error checks (and override -I)+ --verbose-tags add tags indicating generated/modified data - General output/reporting flags (supported by some commands):- -b --begin=DATE include postings/transactions on/after this date- -e --end=DATE include postings/transactions before this date- (with a report interval, will be adjusted to- following subperiod end)- -D --daily multiperiod report with 1 day interval- -W --weekly multiperiod report with 1 week interval- -M --monthly multiperiod report with 1 month interval- -Q --quarterly multiperiod report with 1 quarter interval- -Y --yearly multiperiod report with 1 year interval- -p --period=PERIODEXP set begin date, end date, and/or report interval,- with more flexibility- --today=DATE override today's date (affects relative dates)- --date2 match/use secondary dates instead (deprecated)- -U --unmarked include only unmarked postings/transactions- -P --pending include only pending postings/transactions- -C --cleared include only cleared postings/transactions- (-U/-P/-C can be combined)- -R --real include only non-virtual postings- -E --empty Show zero items, which are normally hidden.- In hledger-ui & hledger-web, do the opposite.- --depth=DEPTHEXP if a number (or -NUM): show only top NUM levels- of accounts. If REGEXP=NUM, only apply limiting to- accounts matching the regular expression.- -B --cost show amounts converted to their cost/sale amount- -V --market Show amounts converted to their value at period- end(s) in their default valuation commodity.- Equivalent to --value=end.- -X --exchange=COMM Show amounts converted to their value at period- end(s) in the specified commodity.- Equivalent to --value=end,COMM.- --value=WHEN[,COMM] show amounts converted to their value on the- specified date(s) in their default valuation- commodity or a specified commodity. WHEN can be:- 'then': value on transaction dates- 'end': value at period end(s)- 'now': value today- YYYY-MM-DD: value on given date- -c --commodity-style=S Override a commodity's display style.- Eg: -c '.' or -c '1.000,00 EUR'- --pretty[=YN] Use box-drawing characters in text output? Can be- 'y'/'yes' or 'n'/'no'.- If YN is specified, the equals is required.+ General output/reporting flags (supported by some commands):+ -b --begin=DATE include postings/transactions on/after this date+ -e --end=DATE include postings/transactions before this date+ (with a report interval, will be adjusted to+ following subperiod end)+ -D --daily multiperiod report with 1 day interval+ -W --weekly multiperiod report with 1 week interval+ -M --monthly multiperiod report with 1 month interval+ -Q --quarterly multiperiod report with 1 quarter interval+ -Y --yearly multiperiod report with 1 year interval+ -p --period=PERIODEXP set begin date, end date, and/or report interval,+ with more flexibility+ --today=DATE override today's date (affects relative dates)+ --date2 match/use secondary dates instead (deprecated)+ -U --unmarked include only unmarked postings/transactions+ -P --pending include only pending postings/transactions+ -C --cleared include only cleared postings/transactions+ (-U/-P/-C can be combined)+ -R --real include only non-virtual postings+ -E --empty Show zero items, which are normally hidden.+ In hledger-ui & hledger-web, do the opposite.+ --depth=DEPTHEXP if a number (or -NUM): show only top NUM levels+ of accounts. If REGEXP=NUM, only apply limiting to+ accounts matching the regular expression.+ -B --cost show amounts converted to their cost/sale amount+ -V --market Show amounts converted to their value at period+ end(s) in their default valuation commodity.+ Equivalent to --value=end.+ -X --exchange=COMM Show amounts converted to their value at period+ end(s) in the specified commodity.+ Equivalent to --value=end,COMM.+ --value=WHEN[,COMM] show amounts converted to their value on the+ specified date(s) in their default valuation+ commodity or a specified commodity. WHEN can be:+ 'then': value on transaction dates+ 'end': value at period end(s)+ 'now': value today+ YYYY-MM-DD: value on given date+ -c --commodity-style=S Override a commodity's display style.+ Eg: -c '.' or -c '1.000,00 EUR'+ --pretty[=YN] Use box-drawing characters in text output? Can be+ 'y'/'yes' or 'n'/'no'.+ If YN is specified, the equals is required. - General help flags:- -h --help show command line help- --tldr show command examples with tldr- --info show the manual with info- --man show the manual with man- --version show version information- --debug=[1-9] show this much debug output (default: 1)- --pager=YN use a pager when needed ? y/yes (default) or n/no- --color=YNA --colour use ANSI color ? y/yes, n/no, or auto (default)+ General help flags:+ -h --help show command line help+ --tldr show command examples with tldr+ --info show the manual with info+ --man show the manual with man+ --version show version information+ --debug=[1-9] show this much debug output (default: 1)+ --pager=YN use a pager when needed ? y/yes (default) or n/no+ --color=YNA --colour use ANSI color ? y/yes, n/no, or auto (default) - hledger-web shows accounts with zero balances by default (like- hledger-ui, and unlike hledger). Using the -E/--empty flag will re-- verse this behaviour. If you see accounts which appear to have a zero- balance, but cannot be hidden with -E, it's because they have a- mixed-cost balance, which looks like zero when costs are hidden.- (hledger-web does not show costs.)+ hledger-web shows accounts with zero balances by default (like hledger-ui,+ and unlike hledger). Using the -E/--empty flag will reverse this behav-+ iour. If you see accounts which appear to have a zero balance, but cannot+ be hidden with -E, it's because they have a mixed-cost balance, which looks+ like zero when costs are hidden. (hledger-web does not show costs.) - Reporting options and/or query arguments can be used to set an initial- query, which although not shown in the UI, will restrict the data shown- (in addition to any search query entered in the UI).+ Reporting options and/or query arguments can be used to set an initial+ query, which although not shown in the UI, will restrict the data shown (in+ addition to any search query entered in the UI). - If you use the bash shell, you can auto-complete flags by pressing TAB- in the command line. If this is not working see Install > Shell com-- pletions.+ If you use the bash shell, you can auto-complete flags by pressing TAB in+ the command line. If this is not working see Install > Shell completions. PERMISSIONS- By default, hledger-web allows anyone who can reach it to view the- journal and to add new transactions, but not to change existing data.+ By default, hledger-web allows anyone who can reach it to view the journal+ and to add new transactions, but not to change existing data. - You can restrict who can reach it, by+ You can restrict who can reach it, by - o setting the IP address it listens on (see --host above). By default- it listens on 127.0.0.1, accessible to users on the local machine- only.+ * setting the IP address it listens on (see --host above). By default it+ listens on 127.0.0.1, accessible to users on the local machine only. - o putting it behind an authenticating proxy, such as caddy or apache+ * putting it behind an authenticating proxy, such as caddy or apache - o putting it behind a firewall+ * putting it behind a firewall - And you can restrict what the users reaching it can do, by specifying- the --allow=ACCESSLEVEL option at startup. ACCESSLEVEL is one of:+ And you can restrict what the users reaching it can do, by specifying the+ --allow=ACCESSLEVEL option at startup. ACCESSLEVEL is one of: - o view - allows viewing the journal file(s)+ * view - allows viewing the journal file(s) - o add - also allows adding new transactions to the main journal file+ * add - also allows adding new transactions to the main journal file - o edit - also allows editing, uploading or downloading the journal- file(s)+ * edit - also allows editing, uploading or downloading the journal file(s) - o sandstorm - (for the hledger-web Sandstorm app:) allows whichever of- view, add, or edit are specified in the X-Sandstorm-Permissions HTTP- header+ * sandstorm - (for the hledger-web Sandstorm app:) allows whichever of+ view, add, or edit are specified in the X-Sandstorm-Permissions HTTP+ header - The default access level is add.+ The default access level is add. EDITING, UPLOADING, DOWNLOADING- If you enable the manage capability mentioned above, you'll see a new- "spanner" button to the right of the search form. Clicking this will- let you edit, upload, or download the journal file or any files it in-- cludes.+ If you enable the manage capability mentioned above, you'll see a new+ "spanner" button to the right of the search form. Clicking this will let+ you edit, upload, or download the journal file or any files it includes. - Note, unlike any other hledger command, in this mode you (or any visi-- tor) can alter or wipe the data files.+ Note, unlike any other hledger command, in this mode you (or any visitor)+ can alter or wipe the data files. - Normally whenever a file is changed in this way, hledger-web saves a- numbered backup (assuming file permissions allow it, the disk is not- full, etc.) hledger-web is not aware of version control systems, cur-- rently; if you use one, you'll have to arrange to commit the changes- yourself (eg with a cron job or a file watcher like entr).+ Normally whenever a file is changed in this way, hledger-web saves a num-+ bered backup (assuming file permissions allow it, the disk is not full,+ etc.) hledger-web is not aware of version control systems, currently; if+ you use one, you'll have to arrange to commit the changes yourself (eg with+ a cron job or a file watcher like entr). - Changes which would leave the journal file(s) unparseable or non-valid- (eg with failing balance assertions) are prevented. (Probably. This- needs re-testing.)+ Changes which would leave the journal file(s) unparseable or non-valid (eg+ with failing balance assertions) are prevented. (Probably. This needs+ re-testing.) RELOADING- hledger-web detects changes made to the files by other means (eg if you- edit it directly, outside of hledger-web), and it will show the new- data when you reload the page or navigate to a new page. If a change- makes a file unparseable, hledger-web will display an error message un-- til the file has been fixed.+ hledger-web detects changes made to the files by other means (eg if you+ edit it directly, outside of hledger-web), and it will show the new data+ when you reload the page or navigate to a new page. If a change makes a+ file unparseable, hledger-web will display an error message until the file+ has been fixed. - (Note: if you are viewing files mounted from another machine, make sure- that both machine clocks are roughly in step.)+ (Note: if you are viewing files mounted from another machine, make sure+ that both machine clocks are roughly in step.) JSON API- In addition to the web UI, hledger-web also serves a JSON API that can- be used to get data or add new transactions. If you want the JSON API- only, you can use the --serve-api flag. Eg:+ In addition to the web UI, hledger-web also serves a JSON API that can be+ used to get data or add new transactions. If you want the JSON API only,+ you can use the --serve-api flag. Eg: - $ hledger-web -f examples/sample.journal --serve-api- ...+ $ hledger-web -f examples/sample.journal --serve-api+ ... - You can get JSON data from these routes:+ You can get JSON data from these routes: - /version- /accountnames- /transactions- /prices- /commodities- /accounts- /accounttransactions/ACCOUNTNAME+ /version+ /accountnames+ /transactions+ /prices+ /commodities+ /accounts+ /accounttransactions/ACCOUNTNAME - Eg, all account names in the journal (similar to the accounts command).- (hledger-web's JSON does not include newlines, here we use python to- prettify it):+ Eg, all account names in the journal (similar to the accounts command).+ (hledger-web's JSON does not include newlines, here we use python to pret-+ tify it): - $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool- [- "assets",- "assets:bank",- "assets:bank:checking",- "assets:bank:saving",- "assets:cash",- "expenses",- "expenses:food",- "expenses:supplies",- "income",- "income:gifts",- "income:salary",- "liabilities",- "liabilities:debts"- ]+ $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool+ [+ "assets",+ "assets:bank",+ "assets:bank:checking",+ "assets:bank:saving",+ "assets:cash",+ "expenses",+ "expenses:food",+ "expenses:supplies",+ "income",+ "income:gifts",+ "income:salary",+ "liabilities",+ "liabilities:debts"+ ] - Or all transactions:+ Or all transactions: - $ curl -s http://127.0.0.1:5000/transactions | python -m json.tool- [- {- "tcode": "",- "tcomment": "",- "tdate": "2008-01-01",- "tdate2": null,- "tdescription": "income",- "tindex": 1,- "tpostings": [- {- "paccount": "assets:bank:checking",- "pamount": [- {- "acommodity": "$",- "aismultiplier": false,- "aprice": null,- ...+ $ curl -s http://127.0.0.1:5000/transactions | python -m json.tool+ [+ {+ "tcode": "",+ "tcomment": "",+ "tdate": "2008-01-01",+ "tdate2": null,+ "tdescription": "income",+ "tindex": 1,+ "tpostings": [+ {+ "paccount": "assets:bank:checking",+ "pamount": [+ {+ "acommodity": "$",+ "aismultiplier": false,+ "aprice": null,+ ... - Most of the JSON corresponds to hledger's data types; for details of- what the fields mean, see the Hledger.Data.Json haddock docs and click- on the various data types, eg Transaction. And for a higher level un-- derstanding, see the journal docs. There is also a basic OpenAPI spec-- ification.+ Most of the JSON corresponds to hledger's data types; for details of what+ the fields mean, see the Hledger.Data.Json haddock docs and click on the+ various data types, eg Transaction. And for a higher level understanding,+ see the journal docs. There is also a basic OpenAPI specification. - In some cases there is outer JSON corresponding to a "Report" type. To- understand that, go to the Hledger.Web.Handler.MiscR haddock and look- at the source for the appropriate handler to see what it returns. Eg- for /accounttransactions it's getAccounttransactionsR, returning a "ac-- countTransactionsReport ...". Looking up the haddock for that we can- see that /accounttransactions returns an AccountTransactionsReport,- which consists of a report title and a list of AccountTransactionsRe-- portItem (etc).+ In some cases there is outer JSON corresponding to a "Report" type. To un-+ derstand that, go to the Hledger.Web.Handler.MiscR haddock and look at the+ source for the appropriate handler to see what it returns. Eg for /ac-+ counttransactions it's getAccounttransactionsR, returning a "accountTrans-+ actionsReport ...". Looking up the haddock for that we can see that /ac-+ counttransactions returns an AccountTransactionsReport, which consists of a+ report title and a list of AccountTransactionsReportItem (etc). - You can add a new transaction to the journal with a PUT request to- /add, if hledger-web was started with the add capability (enabled by- default). The payload must be the full, exact JSON representation of a- hledger transaction (partial data won't do). You can get sample JSON- from hledger-web's /transactions or /accounttransactions, or you can- export it with hledger-lib, eg like so:+ You can add a new transaction to the journal with a PUT request to /add, if+ hledger-web was started with the add capability (enabled by default). The+ payload must be the full, exact JSON representation of a hledger transac-+ tion (partial data won't do). You can get sample JSON from hledger-web's+ /transactions or /accounttransactions, or you can export it with+ hledger-lib, eg like so: - .../hledger$ stack ghci hledger-lib- >>> writeJsonFile "txn.json" (head $ jtxns samplejournal)- >>> :q+ .../hledger$ stack ghci hledger-lib+ >>> writeJsonFile "txn.json" (head $ jtxns samplejournal)+ >>> :q - Here's how it looks as of hledger-1.17 (remember, this JSON corresponds- to hledger's Transaction and related data types):+ Here's how it looks as of hledger-1.17 (remember, this JSON corresponds to+ hledger's Transaction and related data types): - {- "tcomment": "",- "tpostings": [- {- "pbalanceassertion": null,- "pstatus": "Unmarked",- "pamount": [- {- "aprice": null,- "acommodity": "$",- "aquantity": {- "floatingPoint": 1,- "decimalPlaces": 10,- "decimalMantissa": 10000000000- },- "aismultiplier": false,- "astyle": {- "ascommodityside": "L",- "asdigitgroups": null,- "ascommodityspaced": false,- "asprecision": 2,- "asdecimalpoint": "."- }- }- ],- "ptransaction_": "1",- "paccount": "assets:bank:checking",- "pdate": null,- "ptype": "RegularPosting",- "pcomment": "",- "pdate2": null,- "ptags": [],- "poriginal": null- },- {- "pbalanceassertion": null,- "pstatus": "Unmarked",- "pamount": [- {- "aprice": null,- "acommodity": "$",- "aquantity": {- "floatingPoint": -1,- "decimalPlaces": 10,- "decimalMantissa": -10000000000- },- "aismultiplier": false,- "astyle": {- "ascommodityside": "L",- "asdigitgroups": null,- "ascommodityspaced": false,- "asprecision": 2,- "asdecimalpoint": "."- }- }- ],- "ptransaction_": "1",- "paccount": "income:salary",- "pdate": null,- "ptype": "RegularPosting",- "pcomment": "",- "pdate2": null,- "ptags": [],- "poriginal": null- }- ],- "ttags": [],- "tsourcepos": {- "tag": "JournalSourcePos",- "contents": [- "",- [- 1,- 1- ]- ]- },- "tdate": "2008-01-01",- "tcode": "",- "tindex": 1,- "tprecedingcomment": "",- "tdate2": null,- "tdescription": "income",- "tstatus": "Unmarked"- }+ {+ "tcomment": "",+ "tpostings": [+ {+ "pbalanceassertion": null,+ "pstatus": "Unmarked",+ "pamount": [+ {+ "aprice": null,+ "acommodity": "$",+ "aquantity": {+ "floatingPoint": 1,+ "decimalPlaces": 10,+ "decimalMantissa": 10000000000+ },+ "aismultiplier": false,+ "astyle": {+ "ascommodityside": "L",+ "asdigitgroups": null,+ "ascommodityspaced": false,+ "asprecision": 2,+ "asdecimalpoint": "."+ }+ }+ ],+ "ptransaction_": "1",+ "paccount": "assets:bank:checking",+ "pdate": null,+ "ptype": "RegularPosting",+ "pcomment": "",+ "pdate2": null,+ "ptags": [],+ "poriginal": null+ },+ {+ "pbalanceassertion": null,+ "pstatus": "Unmarked",+ "pamount": [+ {+ "aprice": null,+ "acommodity": "$",+ "aquantity": {+ "floatingPoint": -1,+ "decimalPlaces": 10,+ "decimalMantissa": -10000000000+ },+ "aismultiplier": false,+ "astyle": {+ "ascommodityside": "L",+ "asdigitgroups": null,+ "ascommodityspaced": false,+ "asprecision": 2,+ "asdecimalpoint": "."+ }+ }+ ],+ "ptransaction_": "1",+ "paccount": "income:salary",+ "pdate": null,+ "ptype": "RegularPosting",+ "pcomment": "",+ "pdate2": null,+ "ptags": [],+ "poriginal": null+ }+ ],+ "ttags": [],+ "tsourcepos": {+ "tag": "JournalSourcePos",+ "contents": [+ "",+ [+ 1,+ 1+ ]+ ]+ },+ "tdate": "2008-01-01",+ "tcode": "",+ "tindex": 1,+ "tprecedingcomment": "",+ "tdate2": null,+ "tdescription": "income",+ "tstatus": "Unmarked"+ } - And here's how to test adding it with curl. This should add a new en-- try to your journal:+ And here's how to test adding it with curl. This should add a new entry to+ your journal: - $ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json+ $ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json DEBUG OUTPUT Debug output- You can add --debug[=N] to the command line to log debug output. N- ranges from 1 (least output, the default) to 9 (maximum output). Typi-- cally you would start with 1 and increase until you are seeing enough.- Debug output goes to stderr, interleaved with the requests logged on- stdout. To capture debug output in a log file instead, you can usually- redirect stderr, eg:- hledger-web --debug=3 2>hledger-web.log.+ You can add --debug[=N] to the command line to log debug output. N ranges+ from 1 (least output, the default) to 9 (maximum output). Typically you+ would start with 1 and increase until you are seeing enough. Debug output+ goes to stderr, interleaved with the requests logged on stdout. To capture+ debug output in a log file instead, you can usually redirect stderr, eg:+ hledger-web --debug=3 2>hledger-web.log. ENVIRONMENT- LEDGER_FILE The main journal file to use when not specified with- -f/--file. Default: $HOME/.hledger.journal.+ LEDGER_FILE The main journal file to use when not specified with -f/--file.+ Default: $HOME/.hledger.journal. BUGS- We welcome bug reports in the hledger issue tracker- (https://bugs.hledger.org), or on the hledger chat or mail list- (https://hledger.org/support).+ We welcome bug reports in the hledger issue tracker+ (https://bugs.hledger.org), or on the hledger chat or mail list+ (https://hledger.org/support). - Some known issues:+ Some known issues: - Does not work well on small screens, or in text-mode browsers.+ Does not work well on small screens, or in text-mode browsers. AUTHORS- Simon Michael <simon@joyful.com> and contributors.- See http://hledger.org/CREDITS.html+ Simon Michael <simon@joyful.com> and contributors.+ See http://hledger.org/CREDITS.html COPYRIGHT- Copyright 2007-2023 Simon Michael and contributors.+ Copyright 2007-2023 Simon Michael and contributors. LICENSE- Released under GNU GPL v3 or later.+ Released under GNU GPL v3 or later. SEE ALSO- hledger(1), hledger-ui(1), hledger-web(1), ledger(1)+ hledger(1), hledger-ui(1), hledger-web(1), ledger(1) -hledger-web-1.51.2 December 2025 HLEDGER-WEB(1)+hledger-web-1.52 March 2026 HLEDGER-WEB(1)