âĄī¸ Crypto CLI âĄī¸
Ever felt the pressing need to lookup crypto data right from your shell? Now you can!
Installation
Note: requires Python 3, pipx recommended
pipx install cryptocli
# alias to 'crypto' command
echo "alias crypto=cryptocli" >> ~/.bashrc
source ~/.bashrc
Build from source
Note: hatch is the build tool
git clone https://github.com/acrenwelge/cryptocli-python.git
python -m build
pipx install dist/*.whl
Usage
Please note: there is currently a rate limit of 50 calls / minute for the free API being used
crypto search bit
crypto --coin bitcoin
crypto price --coin bitcoin
crypto price -c bitcoin -c ethereum -c litecoin -cur USD -cur EUR
crypto history -c bitcoin -d 10 # past 10 days of bitcoin price
crypto history -c bitcoin -d 10 --graph # add a graph
crypto history -c bitcoin -w 5 # past 5 weeks of bitcoin price
crypto history -c bitcoin -m 3 # past 3 months of bitcoin price
crypto price -c bitcoin --date 2015-05-01
crypto price -c bitcoin --watch
crypto price -c bitcoin -w -i 10 -s 1 # interval of 10 seconds, stop after 1 minute
īŧ See price gains over time
crypto gains -c bitcoin 2020-01-01 2021-01-01
Config
The default coin and currency to use will be stored in $HOME/.crypto/defaults.properties
. If this file exists, these values will be used unless overridden with command line arguments. If no file exists and no command line arguments are provided, the program reverts to bitcoin and USD defaults, respectively.
crypto config -c bitcoin
crypto config -cur USD
crypto config # displays current defaults if no args set
Crypto coin must be its
id
. Currency must follow ISO 4217 AND be supported by the API used.
crypto list coins
crypto list currencies
Caching
A list of coins to search will be cached in $HOME/.crypto/coins.json
for quick searching and lookup. By default, a TTL value of 7 days will be used.
đ§
Complex Queries & Examples # find the number of cryptocurrencies with the word "chain" in their name
crypto list coins | grep chain | wc -l
# store the price of bitcoin for the last year
crypto history -c bitcoin -d 365 > btc-prices-last-year.txt
Built with...
- Python 3.9
- pycoingecko
- Coingecko API
- CurrencySymbols