4cast is a simple CLI application written in Go that provides current weather information and hourly forecasts for a specified location. It fetches data from the WeatherAPI and displays it in a user-friendly format.
- Get the current temperature and weather conditions for any location.
- View hourly weather forecasts with temperature and chance of rain.
- Color-coded output for better readability:
- 🟢 Green for low chance of rain.
- 🔴 Red for high chance of rain.
- Clone the repository:
git clone https://github.com/ashish0kumar/4cast.git
cd 4cast
- Build the application:
go build -o 4cast
- Run the application:
./4cast [location]
Replace [location]
with the desired city name (e.g., Pune
). If no location is provided, it defaults to New_delhi
Configure Global CLI Access (Optional)
- Move the executable to a directory in your system’s PATH (e.g.,
/usr/local/bin
):
sudo mv 4cast /usr/local/bin/
- Once the executable is set up, you can run
4cast
from any directory:
4cast [location]
./4cast
Example Output
New Delhi, India
30°C, Clear
15:00 - 31°C, 10%, Clear
16:00 - 30°C, 20%, Partly Cloudy
17:00 - 29°C, 15%, Clear