https://github.com/lloydlobo/balance
CLI tool to balance your budget
https://github.com/lloydlobo/balance
accounting budget cli finance yaml-accounting
Last synced: about 1 month ago
JSON representation
CLI tool to balance your budget
- Host: GitHub
- URL: https://github.com/lloydlobo/balance
- Owner: lloydlobo
- License: apache-2.0
- Created: 2023-01-31T08:26:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-19T14:01:23.000Z (about 1 year ago)
- Last Synced: 2024-12-16T07:15:39.201Z (5 months ago)
- Topics: accounting, budget, cli, finance, yaml-accounting
- Language: Rust
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# balance
[](https://github.com/lloydlobo/balance/actions/workflows/CICD.yml)
> CLI tool to balance your budget

## Features
* Cross-platform
* Arbitrary shell commands are supported.## Usage
`balance --help` will provide a menu of all available commands and optional arguments.
### Transaction
```sh
$ balance tx -a 300 -A "expense:grocery"
transaction = {
date: None,
amount: 300,
account: "expense:grocery",
offset_account: None,
description: None,
}
$ balance tx -a 300 -A "expense:grocery" -d 20221231 -O "asset:cash_checking" -D "Weekly grocery"
transaction = {
date: Some(20221231),
amount: 300,
account: "expense:grocery",
offset_account: Some("asset:cash_checking"),
description: Some("Weekly grocery"),
}
```### Database
```sh
$ balance add balance.yml
&path = [ "balance.yml", ]
```### Demo with Docker
Run a docker container to demo the CLI without installing it:
```sh
docker run lloydlobo/balance
```## Setup
### API
Add `SECRET` to the `.env` file as `` without `<`/`>`.
```bashls
BALANCE_API_KEY=
```## Install
### From Cargo
TODO:
```sh
cargo install balance
```### Build from Source
Alternatively, clone this repo and do the following:
* If Rust is not installed on your machine, follow the instructions
on how to do that here:
* run cargo build --release to compile the binary
* copy the /target/release/balance binary to /usr/bin
or wherever your system maintains application binaries```sh
git clone https://github.com/lloydlobo/balance.git
cd balance
cargo build --release
cargo install --path .
```## Dev
### Build
#### Docker
```make
docker_image := "balance"
docker_container_name := 'balance1'
username := 'lloydlobo'docker build -t {{docker_image}} .
docker run -dp 8080:3030 --rm --name {{docker_container_name}} {{docker_image}}
docker run -it --rm --name {{docker_container_name}} --entrypoint bin/bash {{docker_image}}
docker stop {{docker_container_name}}
docker logs -f {{docker_container_name}}
```##### Publish with Docker
```make
docker tag {{docker_image}} {{username}}/{{docker_image}}
docker push {{username}}/{{docker_image}}
```### Test
```sh
CARGO_LOG=error cargo test
```## License
`balance` is dual-licensed under the terms of the MIT License and the Apache License 2.0.
See the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for details.