Welcome to the CLI Weather App! This application fetches weather data from the WeatherAPI and displays the current weather information along with the hourly forecast for a specified location.
- Displays current weather information (temperature, condition) for a given location.
- Shows the hourly forecast for the day including temperature, chance of rain, and weather condition.
- Go installed on your system. If not, you can download and install it from here.
- WeatherAPI key. You can sign up for a free key at WeatherAPI.
-
Clone the repository:
git clone https://github.com/praveen-rikhari/CLI-Weather-App-in-Golang.git
-
Navigate to the project directory:
cd CLI-Weather-App-in-Golang -
Install this dependency for loading environment variables from
.envfile.go get github.com/joho/godotenv
-
Install this dependency for colored output.
go get github.com/fatih/color
-
Create a
.envfile in the project root and add your WeatherAPI key:API_KEY="your_api_key_here" -
Build the project:
go build
-
To use this command anywhere from your terminal move
weatherfile (created after runninggo buildcommand) into your/usr/local/binfolder.mv weather /usr/local/binOR
sudo mv weather /usr/local/bin
To run the Weather App, use the following command any where in your terminal:
weather [location]replace [location] with the region for which you wanted the weather information.
If you'd like to contribute to this project, feel free to open issues or submit pull requests. Contributions are welcome!
