Get current weather, hourly and daily forecasts for any city or coordinates worldwide. Use when the user asks about weather, temperature, rain, snow, wind, sunrise/sunset, UV, humidity, pressure, or wants to know if they need an umbrella.
Fetch current weather and forecasts via the free Open-Meteo API. No API key required. Supports any location worldwide.
CLI: bash {baseDir}/scripts/weather.sh [options]
# Current weather (city name alone is enough)
bash {baseDir}/scripts/weather.sh --current --city=Berlin
bash {baseDir}/scripts/weather.sh --current --city=London
# Exact coordinates for precision if available
bash {baseDir}/scripts/weather.sh --current --lat=48.8566 --lon=2.3522
# Disambiguate with --country (any format: code, full name, partial)
bash {baseDir}/scripts/weather.sh --current --city=Portland --country=US
# Forecast (daily + hourly)
bash {baseDir}/scripts/weather.sh --forecast-days=3 --city=Paris
# Both current + forecast
bash {baseDir}/scripts/weather.sh --current --forecast-days=2 --city=Rome
# Custom params — fetch only precipitation data
bash {baseDir}/scripts/weather.sh --forecast-days=2 --city=Vienna \
--hourly-params=precipitation,precipitation_probability,weather_code
Location (required — pick one):
--city=NAME — city name; auto-geocoded, usually sufficient on its own--country=… — optional country hint, any format works (GB, France, Ger). Only needed to disambiguate (e.g. Portland US vs UK). Do not look up the "correct" code — pass whatever you have or omit entirely.--lat=FLOAT --lon=FLOAT — direct coordinates, skips geocodingMode (at least one required):
--current — fetch current conditions--forecast — fetch hourly + daily forecast--forecast-days=N — forecast length 1–16 days (default: 7; implies --forecast)Param overrides (comma-separated variable names):
--current-params=… — override current weather variables--hourly-params=… — override hourly forecast variables--daily-params=… — override daily forecast variablesOutput:
--human — emoji-rich formatted output for humans (default is porcelain, optimized for agents)--porcelain — it's the default; saves tokens.--forecast-days=1 or --forecast-days=2 when the user only asks about today/tomorrow — don't waste tokens on a full 7-day fetch.--hourly-params or --daily-params to fetch only what's needed.Override defaults via --current-params, --hourly-params, --daily-params.
temperature_2m (default) — air temperature at 2m, °Capparent_temperature (default) — feels-like temperature, °Crelative_humidity_2m (default) — relative humidity at 2m, %precipitation (default) — total precipitation (rain + showers + snow), mmprecipitation_probability (default, hourly only) — probability of precipitation, %weather_code (default) — weather condition, auto-resolved to text in outputwind_speed_10m (default) — wind speed at 10m, km/hwind_gusts_10m — wind gust speed at 10m, km/hwind_direction_10m — wind direction, °cloud_cover (default, current only) — total cloud cover, %is_day (default, current only) — daytime flag, 0/1pressure_msl — sea-level atmospheric pressure, hPasurface_pressure — surface pressure, hPavisibility — visibility distance, mrain — rain only (no showers/snow), mmshowers — shower rain only, mmsnowfall — snowfall amount, cmsnow_depth — snow depth on the ground, mdew_point_2m — dew point temperature at 2m, °Cuv_index (hourly only) — UV indextemperature_2m_max (default) — daily max temperature, °Ctemperature_2m_min (default) — daily min temperature, °Cprecipitation_sum (default) — total daily precipitation, mmprecipitation_probability_max (default) — max precipitation probability, %weather_code (default) — dominant weather condition for the daywind_speed_10m_max (default) — max wind speed, km/hwind_gusts_10m_max — max wind gust speed, km/hwind_direction_10m_dominant — dominant wind direction, °sunrise — sunrise time, ISO 8601sunset — sunset time, ISO 8601daylight_duration — daylight duration, secondssunshine_duration — sunshine duration, secondsprecipitation_hours — hours with precipitationrain_sum — total daily rain, mmshowers_sum — total daily showers, mmsnowfall_sum — total daily snowfall, cmuv_index_max — max UV indexapparent_temperature_max — daily max feels-like, °Capparent_temperature_min — daily min feels-like, °CUser: "What's the weather like?"
--current.bash {baseDir}/scripts/weather.sh --current --city=Berlin
User: "When will the rain stop?"
--forecast-days=2 with only rain-related params.bash {baseDir}/scripts/weather.sh --forecast-days=2 --city=Berlin \
--hourly-params=precipitation,precipitation_probability,weather_code
User: "Do I need an umbrella?"
bash {baseDir}/scripts/weather.sh --forecast-days=1 --city=Berlin \
--hourly-params=precipitation,precipitation_probability,weather_code
User: "What's the weather this weekend in Rome?"
--forecast with --daily-params only.--forecast-days to cover the weekend, then pick Saturday/Sunday from the daily output.bash {baseDir}/scripts/weather.sh --forecast-days=7 --city=Rome \
--daily-params=temperature_2m_max,temperature_2m_min,weather_code,precipitation_sum,precipitation_probability_max
User: "What's the temperature outside?"
--current with narrowed params.bash {baseDir}/scripts/weather.sh --current --city=Berlin \
--current-params=temperature_2m,apparent_temperature