Weather
Verified@steipete
npx machina-cli add skill @steipete/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.
Overview
Weather pulls current conditions and forecasts from two free services (wttr.in and Open-Meteo) with no API keys. It offers quick, human-friendly output via wttr.in and JSON suitable for apps via Open-Meteo. You can query by city or by coordinates, and choose formats as needed.
How This Skill Works
wttr.in is queried with curl using city names or encoded formats to return concise, readable weather text (e.g., curl -s "wttr.in/London?format=3" or curl -s "wttr.in/London?T"). Open-Meteo returns JSON when you supply latitude and longitude and enable current_weather=true; you first locate coordinates for a city, then query the API. The Open-Meteo response includes fields like temp, windspeed, and weathercode for programmatic use.
When to Use It
- You need a quick, human-friendly weather check in a shell without any keys (e.g., curl wttr.in/City).
- You’re building a small script or widget and want JSON data for integration (Open-Meteo with coordinates and current_weather=true).
- You want a compact single-line forecast for planning (wttr.in/City?format=3).
- You need today-only or current conditions using simple flags (?1 or ?0) for tailored output.
- You prefer saving a weather image, such as an ASCII-to-PNG representation (wttr.in/City.png).
Quick Start
- Step 1: Decide output: use wttr.in for human text or Open-Meteo for JSON.
- Step 2: Run a sample command, e.g., curl -s "wttr.in/London?format=3" or curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true".
- Step 3: If using JSON, parse fields like temp, windspeed, and weathercode to drive your app.
Best Practices
- Always URL-encode spaces in city names (e.g., wttr.in/New+York).
- Choose the output format that matches your use case: human-friendly text with wttr.in or JSON with Open-Meteo.
- Switch units with ?m (metric) or ?u (USCS) to match your locale.
- Use ?1 for today-only or ?0 for current-only when you need focused data.
- For automation, prefer Open-Meteo JSON and parse the fields you need (temp, windspeed, weathercode).
Example Use Cases
- curl -s "wttr.in/London?format=3" # London: ⛅️ +8°C
- curl -s "wttr.in/New+York" # NYC current conditions in text
- curl -s "wttr.in/London?T" # Full forecast for London
- curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true" # JSON current weather for London
- curl -s "wttr.in/Berlin.png" -o /tmp/weather.png # PNG weather image