中国天气

v1.0.1

获取中国城市天气信息,支持当前天气、未来预报、生活指数。当用户问中国城市的天气、温度、下雨、穿衣建议时使用。支持城市名或城市代码查询。Use when user asks about weather in Chinese cities like '北京天气'、'上海明天会下雨吗'、'广州这周天气怎么样'。

0· 401·2 current·2 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match what the files do: the script queries wttr.in for current weather, tomorrow, week, indices, and provides optional instructions for a QWeather API key. No unrelated credentials, binaries, or installs are requested.
Instruction Scope
SKILL.md instructs running the included shell script and optionally setting QWEATHER_KEY. This stays within the weather domain. Minor mismatch: SKILL.md and doc mention using QWeather for more precise data, but the script's alert path does not actually call the QWeather API even if QWEATHER_KEY is set (it only prints placeholders).
Install Mechanism
No install spec; the skill is instruction-only plus an executable shell script. No downloading of external code or archive extraction is performed by the skill itself.
Credentials
No required environment variables or secrets. One optional variable (QWEATHER_KEY) is documented and only referenced for alert functionality; its optional use is proportional to the stated purpose.
Persistence & Privilege
Skill is not always-on and does not modify other skills or system-wide settings. It writes short-term cache files under /tmp only, which is in-scope for its functionality.
Assessment
This skill appears to do what it says: it calls wttr.in to fetch weather and caches responses in /tmp. Before installing, be aware: (1) it makes outbound HTTP requests to wttr.in (so network access is required and queries include city names), (2) it creates cache files under /tmp (default permissions apply; this is not unusual but may collide with other users/processes), (3) there's a minor bug where the cache key sanitization can produce an empty key for non-ASCII city names (leading to cache collisions), and (4) the QWEATHER_KEY path is advertised but not actually implemented in the script's alert retrieval. If you want to use QWeather, inspect/modify the script to implement the API call. If you are comfortable with those points, the skill is coherent with its description and does not request excessive privileges or secrets.

Like a lobster shell, security has layers — review code before you run it.

latestvk9782ppedfdmkkgzbp4k9dv5w182d681
401downloads
0stars
2versions
Updated 1mo ago
v1.0.1
MIT-0

中国天气

获取中国城市的实时天气和预报信息。

快速使用

# 当前天气
~/.openclaw/workspace/skills/china-weather/scripts/weather.sh 上海

# 明天天气
~/.openclaw/workspace/skills/china-weather/scripts/weather.sh 北京 tomorrow

# 一周预报
~/.openclaw/workspace/skills/china-weather/scripts/weather.sh 广州 week

# 生活指数(穿衣、出行建议)
~/.openclaw/workspace/skills/china-weather/scripts/weather.sh 深圳 indices

支持的城市

  • 直辖市:北京、上海、天津、重庆
  • 省会城市:广州、杭州、成都、武汉、西安等
  • 其他城市:支持大部分中国城市(使用城市名或区县名)

命令参数

参数说明示例
城市名查询当前天气weather.sh 上海
tomorrow明天天气weather.sh 北京 tomorrow
week一周预报weather.sh 广州 week
indices生活指数weather.sh 深圳 indices
alert气象预警weather.sh 成都 alert

生活指数说明

  • 🧥 穿衣指数 - 穿衣建议
  • ☂️ 雨伞指数 - 是否需要带伞
  • 🚗 洗车指数 - 是否适合洗车
  • 🏃 运动指数 - 是否适合户外运动
  • 🌞 紫外线指数 - 防晒建议
  • 😷 空气污染扩散指数 - 空气质量

数据来源

  • 默认使用 wttr.in(免费,无需 API key)
  • 如需更精准数据,可配置和风天气 API key

配置 API key(可选)

如需使用和风天气 API 获取更精准数据:

  1. 注册和风天气开发者账号:https://dev.qweather.com
  2. 获取免费 API key
  3. 配置环境变量:
export QWEATHER_KEY="your-api-key"

示例输出

当前天气:

上海 🌤️  18°C
体感 16°C | 湿度 65% | 东北风 3级
空气质量:良 (AQI 58)

一周预报:

上海 未来7天天气:
周一 🌤️  12-18°C
周二 ☀️  14-20°C
周三 🌧️  10-15°C (有雨)
...

Comments

Loading comments...