My own Go implementation of Ledger-CLI for three basic commands: register, balance and print. This project is being done as part of my SWE Internship at Encora.
- You need to have a running version of Go in your computer
- Download or clone the code from here:
git clone https://github.com/davidcardd1/ledgerCLI-implementation- Install the CLI in your computer:
go build .
go install .- You might need to change the path of installation in your computer. First check where the CLI is installing with:
go list -f '{{.Target}}'- then export that path to the executable:
export PATH=$PATH:/path/to/your/install/directory- If this was the case, run (again)
go install . - Now you can start using the app like any other CLI tool. (no need to use "./" before commands)
- In the terminal run:
ledgerCLI-implementation -f `FILE` [flags] <command> [arguments ...]-
Three commands are currently working:
balance(bal),register(reg) andprint -
Three flags are currently working:
- --sort EXPR (-S). Which can sort by:
date(d),amount(a) orpayee(p) - --file FILE (-f). Reads given ledger file. It defaults to "index.ledger"
- --price-db FILE. Uses given file to read commodity prices
- --sort EXPR (-S). Which can sort by:
See Ledger's full app and extensive documentation here: Ledger Reference