A simple currency conversion tool for your CLI
bitcoinvert
helps you to quickly get conversions between Fiat and Bitcoin right from your CLI,
by leveraging the blockchain.info ticker API.
Table of Contents
- Download Linux binary from Releases
- unzip file:
tar -xvf bitcoinvert[...].tar.gz
- move file to executable path:
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoinvert
- Download MacOS binary from Releases
- unzip file
unzip bitcoinvert[...].zip
- move file to executable path:
sudo mv bitcoinvert /usr/local/bin
If you want, use an alias for bitcoinvert
, like bcv
:
echo "alias bcv='bitcoinvert'" >> ~/.bash_aliases
for bash
echo "alias bcv='bitcoinvert'" >> ~/.zshrc
for zsh
If you don't find a binary for your architecture, compile it yourself:
cargo build --release
You can then find the binary here:
target/release/bitcoinvert
Continue with step 3
from above.
bitcoinvert [OPTIONS] [AMOUNT] [INPUT_CURRENCY] [OUTPUT_CURRENCY]
bitcoinvert -c 1 BTC SAT
Returns: 100,000,000 SAT
If you want your result to be lean and ready to be piped into another command, use the -c
flag:
bitcoinvert -c 1 BTC SAT
This will remove the commas and the unit and simply return 100000000
.
If you want to get rid of the floating point and display rounded integers instead, use the -i
flag:
bitcoinvert -i 1234567 SAT USD
For very big or small numbers, it's easier to use SI suffixes than adding a lot of zeros.
bitcoinvert 1M SAT USD
=> convert 1,000,000 SAT to USD
bitcoinvert 1.23k SAT
=> convert 1,230 SAT
Find a list of possible suffixes here.
If you don't define the output currency, a table of various currencies will be displayed instead:
bitcoinvert -i 1 BTC
Returns:
unit | amount
------+-----------------
BTC | 1
SAT | 100,000,000
MSAT | 100,000,000,000
USD | 22,925
EUR | 21,114
GBP | 18,503
If the input currency is missing, bitcoinvert
will resort to a default instead (e.g. SAT
, configurable):
bitcoinvert 1337
If the amount is missing, bitcoinvert
will resort to a default value (e.g. 1 BTC
, configurable):
bitcoinvert
Run bitcoinvert --help
to get a concise manual.
The configuration of your defaults is stored in your config folder (~/.config/bitcoinvert/defaults.yaml
on Linux).
It defines what values bitcoinvert
will use if you don't specify them in the command line.
amount: 100000000.0
input_currency:
BitcoinUnit: SAT
output_currencies:
- BitcoinUnit: BTC
- BitcoinUnit: SAT
- BitcoinUnit: MSAT
- Fiat: USD
- Fiat: EUR
- Fiat: GBP
unit | description |
---|---|
BTC |
bitcoin |
MBTC |
milli-bitcoin |
BITS |
μBTC, micro-bitcoin |
SAT |
satoshi |
MSAT |
milli-satoshi |
unit | description |
---|---|
ARS |
Argentine peso |
AUD |
Australian dollar |
BRL |
Brazilian real |
CAD |
Canadian dollar |
CHF |
Swiss franc |
CLP |
Chilean peso |
CNY |
Chinese yuan (renminbi) |
CZK |
Czech koruna |
DKK |
Danish krone |
EUR |
Euro |
GBP |
Pound sterling |
HKD |
Hong Kong dollar |
HUF |
Hungarian forint |
INR |
Indian rupee |
ISK |
Icelandic króna |
JPY |
Japanese yen |
KRW |
South Korean won |
NZD |
New Zealand dollar |
PLN |
Polish złoty |
RON |
Romanian leu |
RUB |
Russian ruble |
SEK |
Swedish krona |
SGD |
Singapore dollar |
THB |
Thai baht |
TRY |
Turkish lira |
TWD |
New Taiwan dollar |
USD |
United States dollar |
Pull Requests are welcome!