A simple Currency Converter TUI (Terminal User Interface) application built with Go. This tool fetches real-time exchange rates and allows users to convert between multiple currencies using an interactive terminal form.
✅ Convert between multiple currencies (USD, EUR, GBP, JPY)
✅ Fetches real-time exchange rates via an API
✅ Interactive TUI using huh package
✅ Loads API keys securely from .env file
- Go 1.20 or later
- An API key from ExchangeRate-API
- Internet connection to fetch exchange rates
git clone https://github.com/your-username/currency-converter-tui.git
cd currency-converter-tuigo mod tidyCreate a .env file in the project root and add your API key:
EXCHANGE_API_KEY=your_api_key_here
go run main.go- Enter the amount to convert.
- Select the source currency (From Currency).
- Select the target currency (To Currency).
- The application will fetch exchange rates and display the converted amount.
Example output:
Enter amount: 100
From Currency: USD
To Currency: EUR
100.00 USD = 92.50 EUR
net/http- To make HTTP requests to the exchange rate APIgithub.com/charmbracelet/huh- For creating the terminal-based formencoding/json- To parse API responsesgithub.com/joho/godotenv- To load API keys from.env
✅ Support more currencies - Fetch supported currencies dynamically from the API
✅ Better error handling - Improve user feedback when API fails
