A simple command-line weather application written in Rust that fetches real-time weather data from the OpenWeatherMap API.
- Real-time weather information for any city worldwide
- Displays temperature, humidity, pressure, and wind speed
- Color-coded output based on weather conditions
- Temperature-based emoji indicators
- Interactive CLI with continuous search capability
- Rust (latest stable version)
- OpenWeatherMap API key
- Clone the repository:
git clone https://github.com/alihamzza04/weather_CLi.git
cd weather_CLi- Build the project:
cargo build --release- Run the application:
cargo runOr run the binary directly:
./target/release/weather_cli- Start the application
- Enter the city name when prompted
- Enter the country code (e.g., US, UK, PK, IN)
- View the weather information displayed with color coding
- Press
yto search for another city or any other key to exit
Welcome to the Weather CLI
Please Enter the name of the City You want to search for:
Lahore
Please Enter the country code (e.g., US, UK, PK):
PK
Weather in Lahore: smoke 🌤️
> Temperature: 22.0°C,
> Humidity: 64.0%,
> Pressure: 1008.0 hPa,
> Wind Speed: 1.0 m/s,
Do You want to search for another city? (y/n)
reqwest- HTTP client for fetching weather dataserde- JSON deserializationcolored- Terminal color output
The application uses OpenWeatherMap API. You'll need to obtain an API key from OpenWeatherMap and replace the key in the source code.
MIT