关于 weather
weather 是用于查询当前天气和预报的技能,适合日常天气查询与旅行规划。它通过 wttr.in 提供多种文本和图像输出格式。
主要功能
- 01查询当前天气状况
- 02查看多日天气预报
- 03按地点获取天气
- 04输出文本、JSON 或 PNG
适用场景
- 01查看某城市当前气温
- 02查询今天或明天是否降雨
- 03规划旅行时查看天气
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ nkchivas/ openclaw-skill-weather --skill weather安装后在 Claude Code 中输入/weather确认已加载。
附带文件LICENSEpackage.json
详细介绍
天气技能
获取当前天气状况和天气预报。
适用场景
✅ 在以下情况下使用此技能:
- “天气怎么样?”
- “今天/明天会下雨吗?”
- “[城市]的气温”
- “本周天气预报”
- 旅行规划中的天气查询
不适用场景
❌ 在以下情况下不要使用此技能:
- 历史天气数据 → 使用天气档案/API
- 气候分析或趋势 → 使用专用数据源
- 超本地化微气候数据 → 使用本地传感器
- 恶劣天气预警 → 查看 NWS 官方来源
- 航空/海洋天气 → 使用专用服务(METAR 等)
地点
天气查询中始终要包含城市、地区或机场代码。
命令
当前天气
# One-line summary
curl "wttr.in/London?format=3"
# Detailed current conditions
curl "wttr.in/London?0"
# Specific city
curl "wttr.in/New+York?format=3"
天气预报
# 3-day forecast
curl "wttr.in/London"
# Week forecast
curl "wttr.in/London?format=v2"
# Specific day (0=today, 1=tomorrow, 2=day after)
curl "wttr.in/London?1"
格式选项
# One-liner
curl "wttr.in/London?format=%l:+%c+%t+%w"
# JSON output
curl "wttr.in/London?format=j1"
# PNG image
curl "wttr.in/London.png"
格式代码
%c— 天气状况表情符号%t— 气温%f— “体感温度”%w— 风%h— 湿度%p— 降水%l— 地点
快速回复
“天气怎么样?”
curl -s "wttr.in/London?format=%l:+%c+%t+(feels+like+%f),+%w+wind,+%h+humidity"
“会下雨吗?”
curl -s "wttr.in/London?format=%l:+%c+%p"
“周末天气预报”
curl "wttr.in/London?format=v2"
注意事项
- 无需 API 密钥(使用 wttr.in)
- 有请求速率限制;请勿频繁发送请求
- 适用于全球大多数城市
- 支持机场代码:
curl wttr.in/ORD
评论
支持 Markdown