bmi-cli
Version, currently 0.2.11 version
- 0.2.1latestOct 10, 2019
github.com/konstantine-v/bmi-calc
Calculate BMI in the CLI, using Crystal Lang
Installation
# Add this to your shard.yml
dependencies:
bmi-cli:
github: konstantine-v/bmi-calc
version: ~> 0.2.1Then run:
shards installshard.yml
- Crystal
0.31.1- License
- MIT
- Author
- Konstantine <@MaterialFuture>
- Target
bmi-clifrom src/bmi-cli.cr
Dependencies
Runtime Dependencies
- admiral*github: jwaldrip/admiral.cr
README
BMI Calculator
A simple CLI tool to calculate your BMI, written in Crystal Lang.
Requires Admiral Shard
Please Note - This only works with Imperial Units as of currently, the idea is to have this working with Metric units much like the earlier version of this.
Installation / Development
- Install using
shards install crystal build src/bmi-cli.crmv bmi-cli bin/ && mv bmi-cli.dwarf bin/
Usage
Run bin/bmi-cli --help to see help screen with all info on it.
You can use the tool by running a command from the binary you created (and moved). This will work like any old binary.
./bmi-cli - This will pass in all the defaults through so you can see how it works
You can pass in your own flags to input your own data
./bmi-cli imperial --height=6.5 --weight=190 --name=Jimbob
This should output something like...
Hey JimBob!
Calculating BMI...
Your BMI is: 20.798816568047336
You're considered: Normal
There's also defaults set so that if a field is missing it'll have something to pass through Right now the defaults are;
units->"Imperial"height->5.11weight->180To see all defaults runbin/bmi-cli --help.
You can change the output to fit whatever project, like a csv file for example: ./bmi-cli --height=6.5 --weight=190 >> log.csv
Development/Contributing
If you want to contribute, just make a pull request and I'll merge it in if it's relivant. I'd recommend just forking though. Feel free to extend this project however you wish
- Fork it (https://github.com/your-github-user/bmi-cli/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- @MaterialFuture - Creator and Maintainer
Notes
Please Note - This only works with Imperial Units as of currently, the idea is to have this working with Metric units much like the earlier version of this.
This is still a work in progress, the BMI calculation will include; a different more modern equation, include age, and have option to output from the flags (if that's reasonable).
I'm also going to have you be able to specify how you want your files to be output so you get the data how you want.
Tests will also need to be written just for debugging (and practice for myself)
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.1- Tagged
- Oct 10, 2019
- Commit
0daa1cdeb30d- Crystal
0.31.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/konstantine-v/bmi-calc
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1