← Back to Skills Marketplace
yiweiweilai

get-city-weather

by yiweiweilai · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
87
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install get-city-weather
Description
获取指定城市的天气信息,包括温度、天气状况、风力、空气质量等。当用户询问天气、需要天气数据或提到城市天气时使用此技能。
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install get-city-weather
  3. After installation, invoke the skill by name or use /get-city-weather
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug get-city-weather
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is get-city-weather?

获取指定城市的天气信息,包括温度、天气状况、风力、空气质量等。当用户询问天气、需要天气数据或提到城市天气时使用此技能。 It is an AI Agent Skill for Claude Code / OpenClaw, with 87 downloads so far.

How do I install get-city-weather?

Run "/install get-city-weather" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is get-city-weather free?

Yes, get-city-weather is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does get-city-weather support?

get-city-weather is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created get-city-weather?

It is built and maintained by yiweiweilai (@yiweiweilai); the current version is v1.0.0.

💬 Comments