This ruby script returns exchange rates for crypto currencies in the command line.
- Ruby.
- API key (free) from CoinAPI (unaffiliated).
Note that the first time you run the script, it will install the Lightly gem if it is not already installed. Lightly is used for caching the results for 15 minutes, in order to avoid exceeding your API quota.
The simplest way to install, is to run the installation script:
$ bash <(curl -Ls get.dannyb.co/crypto-cli/setup)
It will just download the crypto script to /usr/local/bin
.
If you prefer to install manually, download the crypto script to anywhere in your path and make it executable.
$ crypto
Usage:
crypto [<amount>] <from_currency> [to|in] [<to_currency>]
Examples:
crypto btc
crypto 0.5 eth
crypto 0.5 eth usd
crypto 0.5 eth to eur
crypto doge in usd
API calls are cached for 15 minutes in /tmp/coinapi
.
The CoinAPI code was adapted from the CoinAPI Ruby SDK