A command-line tool written in Rust to converts user amounts between different curriencies using real-time exchange rate data from ExchangeRate-API
- Rust
- ExchangeRate-API
- Reqwest
- Serde
- Clap
- Dotenv
- Docker
- GitHub Actions
- Clone the repository
- Add .env file in the root directory of the project with like in .env.example
- Get your API key from ExchangeRate-API
- Add your API key to the .env file
- You can also change cache file path in .env file
- Run
cargo build --releasein the root directory of the project - The binary will be located at
target/release/rustcurr - Run
./rustcurr --helpto see the available commands
- Run
./rustcurr -b <from_currency> -t <from_currency> -a <amount>to convert an amount from one currency to another - Run
./rustcurr -b <from_currency> --listto list all available currencies and their exchange rates from your specified base currency - Run
./rustcurr -ito run the interactive mode - Run
./rustcurr --helpto see the available commands
- Run
docker build -t rustcurr .in the root directory of the project - Run
docker run -it --rm rustcurrto run the binary - In the container type
echo "API_KEY=<your_api_key> CACHE_FILE_PATH=cache.json" > .envto create .env file - Run
cargo testto run the tests - Run
./target/release/rustcurr --helpto see the available commands - As an alternative, you can uncomment the last lines in the Dockerfile to run directly app from /usr/local/bin
This project is licensed under the MIT License - see the LICENSE file for details