← 返回 Skills 市场
hefengweather
作者
aaronjager92
· GitHub ↗
· v1.0.0
· MIT-0
103
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install hefeng-weather
功能描述
查询指定城市的实时天气、逐小时、每日预报及分钟级降水,需配置和风天气API Key后使用。
使用说明 (SKILL.md)
和风天气查询技能
🤖 支持平台:飞书 / 微信(文字)
查询实时天气、逐小时预报、每日预报、分钟级降水等
⚠️ 首次使用必读
使用前必须配置和风天气 API Key,否则无法运行!
配置方式:
- 获取 Key:https://www.minimaxi.com/
- 设置环境变量:
export HEFENG_WEATHER_API_KEY="your-key"或创建配置文件:cp config.example.txt config.txt并填入 Key - 验证:
python3 scripts/weather_query.py "北京" --type now
详见下方「首次使用配置」章节。
功能
当用户询问天气时,自动调用和风天气 API:
- 解析用户需求(城市、时间范围)
- 调用对应的和风天气 API
- 格式化返回结果
触发方式
用户发送以下任一方式都会触发:
北京天气怎么样今天会下雨吗上海明天温度深圳空气质量广州逐小时预报天气查询 北京
首次使用配置
1. 获取和风天气 API Key
- 注册和风天气开放平台:https://id.qweather.com/
- 在控制台创建项目,获取 API Key
- 设置环境变量(推荐):
export HEFENG_WEATHER_API_KEY="your-api-key-here"
2. 配置文件方式(可选)
如果不想设置环境变量,可以创建配置文件:
cp config.example.txt config.txt
# 编辑 config.txt,填入你的 API Key
3. 验证
python3 scripts/weather_query.py "北京" --type now
使用方式
命令行参数
# 实时天气
python3 scripts/weather_query.py "北京" --type now
# 逐小时预报(24小时)
python3 scripts/weather_query.py "北京" --type hourly
# 每日预报(3天)
python3 scripts/weather_query.py "北京" --type daily
# 分钟级降水(未来2小时)
python3 scripts/weather_query.py "北京" --type minutely
返回格式
输出 JSON 格式,便于后续处理。
技术细节
API 端点
| 类型 | 端点 | 说明 |
|---|---|---|
| 实时天气 | /v7/weather/now |
温度/风力/湿度等 |
| 逐小时 | /v7/weather/24h |
未来24小时 |
| 每日预报 | /v7/weather/7d |
未来3-7天 |
| 分钟降水 | /v7/minutely/15m |
未来2小时 |
依赖
- Python 3.8+
requests库:pip install requests
文件结构
hefeng_weather/
├── SKILL.md # 本文件
├── config.example.txt # 配置示例
├── scripts/ # 脚本目录
│ └── weather_query.py # 主脚本
└── references/ # 参考文档
└── README.md # 详细说明
常见问题
Q: 提示"网络请求失败"
A: 检查 API Key 是否正确配置,网络是否畅通
Q: 提示"API返回错误"
A: 检查 API Key 是否有对应接口权限
Q: 提示"城市不存在"
A: 检查城市名称是否正确,可使用城市 ID(如北京=101010100)
城市 ID
常用城市 ID:
| 城市 | ID |
|---|---|
| 北京 | 101010100 |
| 上海 | 101020100 |
| 广州 | 101280101 |
| 深圳 | 101280601 |
| 成都 | 101270101 |
| 武汉 | 101200101 |
| 杭州 | 101210101 |
贡献
欢迎提交 Issue 和 PR!
安全使用建议
This skill is functionally a simple HeFeng (qweather) weather client and the code appears not to exfiltrate data beyond calls to devapi.qweather.com. However, the registry metadata neglects to declare the required HEFENG_WEATHER_API_KEY environment variable even though SKILL.md and the script require it. Before installing: (1) confirm you are comfortable providing your HeFeng API key to this skill and store the key securely (use environment variable rather than committing to files), (2) review the script yourself to verify only qweather endpoints are called, (3) prefer running the script locally first (python3 scripts/weather_query.py "城市" --type now) to observe behavior, and (4) ask the publisher/registry to update metadata to explicitly list HEFENG_WEATHER_API_KEY so automated permission systems can surface that requirement. If you need higher assurance, request a signed/verified package or a maintainer statement that no other network endpoints are used.
功能分析
Type: OpenClaw Skill
Name: hefeng-weather
Version: 1.0.0
The skill bundle is a legitimate weather query tool for the Hefeng (QWeather) API. The core logic in `scripts/weather_query.py` is transparent, using the standard `requests` library to fetch data from official API endpoints and formatting it for the user. There is no evidence of malicious execution, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
Name, description, SKILL.md and the Python script are coherent: they implement a HeFeng (qweather) weather query client and only call qweather endpoints. However the registry metadata declares no required env vars while the skill explicitly requires HEFENG_WEATHER_API_KEY — this mismatch is unexpected and should be corrected.
Instruction Scope
Runtime instructions and the script are narrowly scoped: read API key from env or local config file, call devapi.qweather.com endpoints, format and print JSON/text. The SKILL.md does not instruct reading unrelated system files or sending data to other endpoints.
Install Mechanism
Instruction-only skill with a small Python script and a single dependency (requests). No install spec or external downloads; nothing being extracted or executed from third-party URLs.
Credentials
The skill requires a single API key (HEFENG_WEATHER_API_KEY) to function, which is proportionate for a weather client. The concern is that the package/registry metadata did not declare this required environment variable — that omission could lead to unexpected permission/consent behaviour in automated installs.
Persistence & Privilege
No elevated privileges requested, not always-enabled, and the skill does not modify other skills or system-wide agent configs. It only reads a local config file or environment variable as described.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install hefeng-weather - 安装完成后,直接呼叫该 Skill 的名称或使用
/hefeng-weather触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
hengfeng-weather 1.0.0 初始发布:
- 新增基于和风天气 API 的天气查询功能,支持实时天气、逐小时、每日及分钟级降水预报。
- 支持飞书和微信平台的文本查询触发方式。
- 首次使用需配置和风天气 API Key,支持环境变量或配置文件方式。
- 命令行工具支持多种天气类型查询,结果以 JSON 格式返回。
- 附带详细的首次配置说明和常见问题解答。
元数据
常见问题
hefengweather 是什么?
查询指定城市的实时天气、逐小时、每日预报及分钟级降水,需配置和风天气API Key后使用。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 103 次。
如何安装 hefengweather?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install hefeng-weather」即可一键安装,无需额外配置。
hefengweather 是免费的吗?
是的,hefengweather 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
hefengweather 支持哪些平台?
hefengweather 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 hefengweather?
由 aaronjager92(@aaronjager92)开发并维护,当前版本 v1.0.0。
推荐 Skills