← 返回 Skills 市场
yiweiweilai

get-city-weather

作者 yiweiweilai · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
87
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install get-city-weather
功能描述
获取指定城市的天气信息,包括温度、天气状况、风力、空气质量等。当用户询问天气、需要天气数据或提到城市天气时使用此技能。
使用说明 (SKILL.md)

\r \r

获取天气信息\r

\r

功能概述\r

\r 此技能用于获取中国各城市的实时天气信息,包括:\r

  • 当前温度和天气状况\r
  • 风向和风力\r
  • 空气质量指数(AQI)\r
  • 生活指数建议\r \r

使用方法\r

\r

1. 获取天气信息\r

\r 在技能目录下运行天气获取脚本:\r \r

python scripts/get_weather.py [城市名]\r
```\r
\r
Windows PowerShell 如遇控制台编码问题,可直接运行:\r
\r
```powershell\r
$env:PYTHONIOENCODING="utf-8"\r
python .\scripts\get_weather.py 深圳\r
```\r
\r
如果从其他目录调用,可先切换到技能目录,或使用相对路径:\r
\r
```powershell\r
python .\get-weather\scripts\get_weather.py 深圳\r
```\r
\r
示例:\r
```bash\r
python scripts/get_weather.py 北京\r
python scripts/get_weather.py 上海\r
```\r
\r
### 2. 查看天气报告\r
\r
脚本执行后会生成天气报告文件:\r
- 位置:`./get-weather/output/weather_report_[城市]_[日期].txt`\r
- 包含完整的天气信息和生活建议\r
\r
## 实现方式\r
\r
本技能通过聚合数据 `simpleWeather/query` 接口获取实时天气,并从环境变量或 `.env` 读取 API Key。脚本启动时会主动将 `stdout/stderr` 配置为 UTF-8,减少 Windows 控制台输出中文和 emoji 时的编码错误。\r
\r
## 配置说明\r
\r
### API 密钥配置(必填)\r
\r
脚本会按以下顺序读取 API Key:\r
\r
1. 环境变量 `JUHE_WEATHER_API_KEY`\r
2. 环境变量 `WEATHER_API_KEY`\r
3. 技能目录下的 `.env` 文件\r
\r
`.env` 示例:\r
\r
```env\r
JUHE_WEATHER_API_KEY=your_api_key_here\r
```\r
\r
PowerShell 示例:\r
\r
```powershell\r
$env:JUHE_WEATHER_API_KEY="your_api_key_here"\r
python .\scripts\get_weather.py 深圳\r
```\r
\r
接口信息:\r
\r
- 地址:`http://apis.juhe.cn/simpleWeather/query`\r
- 方法:`GET`\r
- 参数:`city`、`key`\r
\r
未配置 API Key 或接口请求失败时,脚本会直接报错退出。\r
\r
## 输出示例\r
\r
```\r
========================================\r
          北京市 今日天气报告\r
========================================\r
\r
📅 日期:2026年03月17日 星期二\r
\r
🌡️  温度:15°C ~ 22°C\r
    当前:18°C\r
\r
☁️  天气:多云\r
\r
💨 风力:东南风 3级\r
\r
🌫️ 空气质量:良 (AQI: 65)\r
\r
💡 生活指数:\r
    • 穿衣:建议穿薄外套\r
    • 运动:适宜户外运动\r
    • 洗车:适宜洗车\r
    • 感冒:较易发,注意防护\r
\r
========================================\r
```\r
\r
## 依赖要求\r
\r
- Python 3.6+\r
- requests\r
\r
安装依赖:\r
```bash\r
pip install requests\r
```\r
安全使用建议
This skill appears to do exactly what it says: call the Juhe weather API and write a local text report. Before installing, provide a valid JUHE_WEATHER_API_KEY (or WEATHER_API_KEY) via environment variables or the included .env file — the registry metadata omitted declaring this requirement. Ensure you trust the Juhe API endpoint, have network access to apis.juhe.cn, and are comfortable the skill will create files under the skill's output/ directory. Also install the Python requests package (pip install requests) in the environment that will run the script.
功能分析
Type: OpenClaw Skill Name: get-city-weather Version: 1.0.0 The skill is a standard weather information tool that fetches data from a legitimate third-party API (Juhe Data). The code in scripts/get_weather.py follows safe practices, such as reading API keys from environment variables or a local .env file and writing output to a dedicated directory, without any evidence of data exfiltration, unauthorized execution, or prompt injection.
能力评估
Purpose & Capability
Name/description (get-city-weather) align with the code and instructions: the script calls apis.juhe.cn/simpleWeather/query to obtain weather, formats a report and writes it to an output directory. No unrelated services or capabilities are requested.
Instruction Scope
SKILL.md instructs running the included Python script with a city argument, and describes reading an API key from environment or .env, producing a report file. The script only reads the skill's .env, standard environment variables, and writes to the skill's own output directory; it makes network requests only to the declared Juhe API endpoint.
Install Mechanism
There is no installer; this is instruction-plus-script. The only runtime dependency is Python (3.6+) and the requests package (pip-installable). No remote downloads or archive extraction are performed by the skill.
Credentials
The script requires an API key via JUHE_WEATHER_API_KEY or WEATHER_API_KEY (or .env). That credential is proportional to the stated purpose. However, the registry metadata lists no required environment variables — an inconsistency that could confuse deployers or lead to failures if the key is not supplied.
Persistence & Privilege
Skill is not always-enabled and does not request elevated persistence. It writes only to its own output/ directory and does not modify other skills or system-wide configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install get-city-weather
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /get-city-weather 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of the get-weather skill. - Provides real-time weather information for cities in China, including temperature, weather conditions, wind, air quality, and lifestyle suggestions. - Command-line script to fetch and save weather reports; supports Windows and Linux environments. - API key configuration via environment variables or .env file is required. - Output includes comprehensive weather details with daily recommendations. - Supports UTF-8 output to handle Chinese/emoji characters on Windows.
元数据
Slug get-city-weather
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

get-city-weather 是什么?

获取指定城市的天气信息,包括温度、天气状况、风力、空气质量等。当用户询问天气、需要天气数据或提到城市天气时使用此技能。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 87 次。

如何安装 get-city-weather?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install get-city-weather」即可一键安装,无需额外配置。

get-city-weather 是免费的吗?

是的,get-city-weather 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

get-city-weather 支持哪些平台?

get-city-weather 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 get-city-weather?

由 yiweiweilai(@yiweiweilai)开发并维护,当前版本 v1.0.0。

💬 留言讨论