weather
npx machina-cli add skill zebbern/icron/weather --openclawWeather
Two free services, no API keys needed.
wttr.in (primary)
Quick one-liner:
curl -s "wttr.in/London?format=3"
# Output: London: ⛅️ +8°C
Compact format:
curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"
# Output: London: ⛅️ +8°C 71% ↙5km/h
Full forecast:
curl -s "wttr.in/London?T"
Format codes: %c condition · %t temp · %h humidity · %w wind · %l location · %m moon
Tips:
- URL-encode spaces:
wttr.in/New+York - Airport codes:
wttr.in/JFK - Units:
?m(metric)?u(USCS) - Today only:
?1· Current only:?0 - PNG:
curl -s "wttr.in/Berlin.png" -o /tmp/weather.png
Open-Meteo (fallback, JSON)
Free, no key, good for programmatic use:
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true"
Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode.
Source
git clone https://github.com/zebbern/icron/blob/main/icron/skills/weather/SKILL.mdView on GitHub Overview
Weather provides current conditions and forecasts using two free services, wttr.in and Open-Meteo, with no API keys required. It supports quick one-liner outputs, compact formats, full forecasts, and JSON for programmatic use. This makes it easy to integrate weather data into scripts, dashboards, or reports without setup hassles.
How This Skill Works
The skill queries wttr.in for human-friendly text outputs and Open-Meteo for JSON data. It relies on curl to fetch data without keys and exposes format options (like %c, %t, %h, %w) for customizing the display. If you need machine-parseable data, Open-Meteo provides a straightforward JSON endpoint after you locate the city coordinates.
When to Use It
- Check current conditions for a city (e.g., London) quickly.
- Display compact forecasts in dashboards or CLI displays.
- Get a full forecast for planning using the /T or related format options.
- Developers fetch JSON data from Open-Meteo for apps or automation.
- Generate a weather image (PNG) for embedding in reports or slides.
Quick Start
- Step 1: Pick a city (e.g., London).
- Step 2: Run a quick curl for a human-friendly snapshot: curl -s "wttr.in/London?format=3".
- Step 3: For automation, fetch JSON from Open-Meteo or use the PNG image for visuals.
Best Practices
- Use wttr.in for quick, human-friendly weather snapshots.
- Customize output with format codes like %c, %t, %h, %w, and %l.
- Switch between metric and US units with ?m or ?u.
- Limit output to today or current conditions with ?1 or ?0.
- Fallback to Open-Meteo when you need structured JSON for automation.
Example Use Cases
- curl -s "wttr.in/London?format=3" → London: ⛅️ +8°C
- curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w" → London: ⛅️ +8°C 71% ↙5km/h
- curl -s "wttr.in/London?T"
- curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true"
- curl -s "wttr.in/Berlin.png" -o /tmp/weather.png