pp-weather-goat

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Weather Goat — Printing Press CLI

Weather Goat — Printing Press CLI

Prerequisites: Install the CLI

前置条件:安装CLI

This skill drives the
weather-goat-pp-cli
binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
  1. Install via the Printing Press installer:
    bash
    npx -y @mvanhorn/printing-press install weather-goat --cli-only
  2. Verify:
    weather-goat-pp-cli --version
  3. Ensure
    $GOPATH/bin
    (or
    $HOME/go/bin
    ) is on
    $PATH
    .
If the
npx
install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.23+):
bash
go install github.com/mvanhorn/printing-press-library/library/other/weather-goat/cmd/weather-goat-pp-cli@latest
If
--version
reports "command not found" after install, the install step did not put the binary on
$PATH
. Do not proceed with skill commands until verification succeeds.
本Skill基于
weather-goat-pp-cli
二进制文件运行。在调用本Skill的任何命令前,必须确认CLI已安装。如果未安装,请先执行以下步骤:
  1. 通过Printing Press安装器安装:
    bash
    npx -y @mvanhorn/printing-press install weather-goat --cli-only
  2. 验证安装:
    weather-goat-pp-cli --version
  3. 确保
    $GOPATH/bin
    (或
    $HOME/go/bin
    )已添加到
    $PATH
    环境变量中。
如果
npx
安装失败(无Node环境、离线等),可改用直接Go安装方式(要求Go 1.23+版本):
bash
go install github.com/mvanhorn/printing-press-library/library/other/weather-goat/cmd/weather-goat-pp-cli@latest
如果执行
--version
时提示“command not found”,说明安装程序未将二进制文件添加到
$PATH
中。请在验证成功前不要执行Skill相关命令。

When to Use This CLI

何时使用本CLI

Reach for this when a user wants a weather lookup, storm or alert check, air-quality read, activity recommendation (bike, hike, walk, commute, drive) based on current conditions, or a "is today normal for this time of year" comparison. Particularly valuable as a morning-briefing source with
weather-goat-pp-cli
(no args → current + today's forecast + active alerts for your configured home location).
Don't reach for this when the user needs hyperlocal or commercial-grade meteorology (use a paid provider like Tomorrow.io or ECMWF), or for international severe-weather alerts (NWS is US-only).
当用户需要查询天气、风暴或预警信息、空气质量读数、基于当前天气的活动建议(骑行、徒步、步行、通勤、驾车),或者需要对比“今日天气是否符合当前季节常态”时,可使用本工具。尤其适合作为晨间简报工具,直接执行
weather-goat-pp-cli
(无参数)即可获取配置的家庭所在地的当前天气+今日预报+活跃预警信息。
以下情况不建议使用本工具:用户需要超本地化或商业级气象数据(请使用Tomorrow.io或ECMWF等付费服务商),或需要美国以外地区的恶劣天气预警(NWS仅覆盖美国)。

Unique Capabilities

独特功能

Activity verdicts — the differentiator

活动判定——核心差异化功能

  • go walk|bike|hike|commute|drive [location]
    — GO / CAUTION / STOP verdict for a specific activity, with reasoning.
    Turns "look at the weather" into "what should I do." Each activity has its own thresholds.
    • walk — preparation advice (umbrella? jacket? sunscreen? layers?)
    • bike — wind, rain, AQI, ice thresholds tuned for cycling
    • hike — lightning, hypothermia risk, altitude UV
    • commute — compares AM departure vs PM return weather (time-aware)
    • drive — visibility, ice, wind gusts, NWS warnings
  • go walk|bike|hike|commute|drive [location]
    ——针对特定活动给出GO/CAUTION/STOP判定,并附上理由。
    将“查看天气”转化为“我该怎么做”。每项活动都有专属阈值。
    • walk ——提供准备建议(是否需要雨伞?外套?防晒霜?分层穿搭?)
    • bike ——针对骑行场景优化的风速、降雨、AQI、结冰阈值
    • hike ——雷电、低体温风险、高海拔紫外线情况
    • commute ——对比早高峰出发与晚高峰返程的天气(时间感知型)
    • drive ——能见度、结冰、阵风、NWS预警情况

Severe weather intelligence

恶劣天气智能监测

  • alerts [location]
    — Active NWS warnings: tornado, storm, flood, heat. Structured output with severity and area polygons.
  • watch [location]
    — Poll NWS every 60 seconds during active severe weather. Prints new/updated alerts as they arrive. For running during a storm.
  • alerts [location]
    ——获取活跃的NWS预警:龙卷风、风暴、洪水、高温。输出包含严重程度和影响区域多边形的结构化数据。
  • watch [location]
    ——在恶劣天气活跃期间,每60秒轮询NWS。当有新预警或预警更新时自动打印信息。适合在风暴期间持续运行。

Context and comparison

情境与对比分析

  • normal [location]
    — Is today normal for this time of year? Compares today's high/low/precip against historical average for the same date.
  • compare <location1> <location2> [...]
    — Side-by-side forecast for 2+ locations. Useful for travel planning or "which city is the weather better this weekend."
  • morning-brief
    (or just
    weather-goat-pp-cli
    with no args, if
    config set-location
    was run) — Current conditions + today's forecast + active NWS alerts in one call. The daily-kickoff command.
  • normal [location]
    ——今日天气是否符合当前季节常态?将今日的最高/最低气温、降水量与历史同期平均值对比。
  • compare <location1> <location2> [...]
    ——同时展示2个及以上地点的预报。适用于旅行规划或对比“哪个城市本周末天气更好”。
  • morning-brief
    (或在执行
    config set-location
    后直接运行无参数的
    weather-goat-pp-cli
    )——一次调用即可获取当前天气+今日预报+活跃NWS预警。作为每日启动命令使用。

Air, UV, and pollen

空气、紫外线与花粉监测

  • breathe [location]
    — AQI + pollen + UV with an exercise recommendation.
  • air-quality [location]
    — Detailed AQI with PM2.5, ozone, etc.
  • weather_codes
    — Reference for Open-Meteo weather code mappings (internal but useful when working with
    --json
    output).
  • breathe [location]
    ——获取AQI+花粉+紫外线数据,并给出运动建议。
  • air-quality [location]
    ——获取包含PM2.5、臭氧等指标的详细AQI数据。
  • weather_codes
    ——Open-Meteo天气代码映射参考(内部工具,但在处理
    --json
    输出时很有用)。

Command Reference

命令参考

Core:
  • weather-goat-pp-cli
    — Morning brief (requires
    config set-location
    first, or pass
    [location]
    )
  • weather-goat-pp-cli forecast [location]
    — Multi-day forecast
  • weather-goat-pp-cli alerts [location]
    — Active NWS severe weather
  • weather-goat-pp-cli history [location]
    — Historical weather
Activity:
  • weather-goat-pp-cli go <activity> [location]
    walk
    ,
    bike
    ,
    hike
    ,
    commute
    ,
    drive
Air / environment:
  • weather-goat-pp-cli breathe [location]
    — AQI + pollen + UV brief
  • weather-goat-pp-cli air-quality [location]
    — Detailed AQI
Context:
  • weather-goat-pp-cli normal [location]
    — Today vs historical average
  • weather-goat-pp-cli compare <loc1> <loc2>
    — Side-by-side
  • weather-goat-pp-cli watch [location]
    — Live NWS monitoring loop
Config + utility:
  • weather-goat-pp-cli config set-location <place>
    — Set home location
  • weather-goat-pp-cli geocoding <name>
    — Resolve place names to coordinates
  • weather-goat-pp-cli doctor
    — Verify connectivity
核心命令:
  • weather-goat-pp-cli
    ——晨间简报(需先执行
    config set-location
    ,或传入
    [location]
    参数)
  • weather-goat-pp-cli forecast [location]
    ——多日天气预报
  • weather-goat-pp-cli alerts [location]
    ——活跃NWS恶劣天气预警
  • weather-goat-pp-cli history [location]
    ——历史天气数据
活动相关命令:
  • weather-goat-pp-cli go <activity> [location]
    ——支持
    walk
    bike
    hike
    commute
    drive
    活动类型
空气/环境相关命令:
  • weather-goat-pp-cli breathe [location]
    ——AQI+花粉+紫外线简报
  • weather-goat-pp-cli air-quality [location]
    ——详细AQI数据
情境分析命令:
  • weather-goat-pp-cli normal [location]
    ——今日与历史平均值对比
  • weather-goat-pp-cli compare <loc1> <loc2>
    ——多地点并排对比
  • weather-goat-pp-cli watch [location]
    ——NWS实时监测循环
配置与工具命令:
  • weather-goat-pp-cli config set-location <place>
    ——设置家庭所在地
  • weather-goat-pp-cli geocoding <name>
    ——将地点名称解析为坐标
  • weather-goat-pp-cli doctor
    ——验证网络连接

Recipes

使用示例

"Should I bike to work today?"

“我今天适合骑车上班吗?”

bash
weather-goat-pp-cli go bike --agent
Returns a structured GO/CAUTION/STOP verdict with reasoning — wind speed, precipitation, AQI, temperature, ice risk — weighted for cycling specifically.
bash
weather-goat-pp-cli go bike --agent
返回结构化的GO/CAUTION/STOP判定及理由——针对骑行场景加权计算风速、降水、AQI、气温、结冰风险等因素。

Morning briefing after setting home location

设置家庭所在地后的晨间简报

bash
weather-goat-pp-cli config set-location "Seattle, WA"
weather-goat-pp-cli --agent  # morning brief — no args
Once location is saved, the no-arg invocation returns current conditions + today's forecast + active NWS alerts. Run from a shell startup script or cron at 7am.
bash
weather-goat-pp-cli config set-location "Seattle, WA"
weather-goat-pp-cli --agent  # 晨间简报——无参数
设置地点后,无参数调用即可返回当前天气+今日预报+活跃NWS预警。可在Shell启动脚本或Cron中设置为早上7点自动运行。

Travel decision — which city is better this weekend?

旅行决策——哪个城市本周末天气更好?

bash
weather-goat-pp-cli compare "Portland, OR" "San Francisco, CA" --days 3 --agent
Side-by-side 3-day forecast for both. One glance picks the trip destination.
bash
weather-goat-pp-cli compare "Portland, OR" "San Francisco, CA" --days 3 --agent
展示两个城市的3天并排预报,一眼即可选定旅行目的地。

Watch for severe weather during a warning

预警期间监测恶劣天气

bash
weather-goat-pp-cli watch --agent &  # background poll every 60s
Runs indefinitely; prints JSON events to stdout when alerts change. Pipe into a logging tool or Slack webhook for alerting.
bash
weather-goat-pp-cli watch --agent &  # 后台每60秒轮询
持续运行;当预警变化时向stdout输出JSON事件。可将输出管道到日志工具或Slack webhook实现告警。

Is today unusually hot?

“今天是不是异常炎热?”

bash
weather-goat-pp-cli normal --agent
Returns today's high/low/precip alongside the 30-year historical average for the same calendar date. Easy "is this a heat wave" check.
bash
weather-goat-pp-cli normal --agent
返回今日最高/最低气温、降水量,以及对应日历日期的30年历史平均值。轻松判断是否为热浪天气。

Auth Setup

认证设置

None required. Open-Meteo is free and unlimited; NWS is free and US-public-data. The
auth
command exists for consistency but is a no-op.
Optional config:
  • WEATHER_GOAT_CONFIG
    — override config file path
  • Home location persisted to
    ~/.config/weather-goat-pp-cli/config.toml
    via
    config set-location
无需认证。Open-Meteo免费且无使用限制;NWS为美国公共数据,免费使用。
auth
命令仅为保持一致性而存在,实际无操作。
可选配置:
  • WEATHER_GOAT_CONFIG
    ——覆盖配置文件路径
  • 家庭所在地通过
    config set-location
    持久化到
    ~/.config/weather-goat-pp-cli/config.toml

Agent Mode

Agent模式

Add
--agent
to any command. Expands to
--json --compact --no-input --no-color --yes
. Use
--days N
for forecast range on relevant commands,
--no-cache
to bypass the 15-minute GET cache.
在任何命令后添加
--agent
参数。该参数等价于
--json --compact --no-input --no-color --yes
。在相关命令中使用
--days N
指定预报范围,使用
--no-cache
绕过15分钟GET缓存。

Filtering output

输出过滤

--select
accepts dotted paths to descend into nested responses; arrays traverse element-wise:
bash
weather-goat-pp-cli <command> --agent --select id,name
weather-goat-pp-cli <command> --agent --select items.id,items.owner.name
Use this to narrow huge payloads to the fields you actually need — critical for deeply nested API responses.
--select
接受点路径以遍历嵌套响应;数组将逐个元素遍历:
bash
weather-goat-pp-cli <command> --agent --select id,name
weather-goat-pp-cli <command> --agent --select items.id,items.owner.name
使用该参数可将庞大的响应缩小到实际需要的字段——对于深度嵌套的API响应至关重要。

Exit Codes

退出码

CodeMeaning
0Success
2Usage error
3Location not found (geocoding failed)
5API error (Open-Meteo or NWS issue)
7Rate limited (very rare; Open-Meteo is unlimited)
代码含义
0成功
2使用错误
3地点未找到(地理编码失败)
5API错误(Open-Meteo或NWS故障)
7速率限制(非常罕见;Open-Meteo无限制)

Installation

安装方式

bash
go install github.com/mvanhorn/printing-press-library/library/other/weather-goat/cmd/weather-goat-pp-cli@latest
weather-goat-pp-cli config set-location "Your City, ST"
weather-goat-pp-cli doctor
bash
go install github.com/mvanhorn/printing-press-library/library/other/weather-goat/cmd/weather-goat-pp-cli@latest
weather-goat-pp-cli config set-location "Your City, ST"
weather-goat-pp-cli doctor

MCP Server

MCP服务器

bash
go install github.com/mvanhorn/printing-press-library/library/other/weather-goat/cmd/weather-goat-pp-mcp@latest
claude mcp add weather-goat-pp-mcp -- weather-goat-pp-mcp
bash
go install github.com/mvanhorn/printing-press-library/library/other/weather-goat/cmd/weather-goat-pp-mcp@latest
claude mcp add weather-goat-pp-mcp -- weather-goat-pp-mcp

Argument Parsing

参数解析规则

Given
$ARGUMENTS
:
  1. Empty,
    help
    , or
    --help
    → run
    weather-goat-pp-cli --help
  2. install
    → CLI;
    install mcp
    → MCP
  3. Activity queries ("should I bike/walk/hike...")
    go <activity> [location] --agent
  4. Severe weather ("any tornado warnings", "storms coming")
    alerts [location] --agent
  5. Comparison ("better weather in X or Y")
    compare <loc1> <loc2> --agent
  6. Anything else
    forecast [location]
    (or morning brief if no location passed and home is configured)
<!-- pr-218-features -->
针对
$ARGUMENTS
  1. 为空、
    help
    --help
    → 执行
    weather-goat-pp-cli --help
  2. install
    → 安装CLI;
    install mcp
    → 安装MCP
  3. 活动查询(“我适合骑车/步行/徒步吗...”) → 执行
    go <activity> [location] --agent
  4. 恶劣天气查询(“有龙卷风预警吗”“风暴要来吗”) → 执行
    alerts [location] --agent
  5. 对比查询(“X和Y哪个地方天气更好”) → 执行
    compare <loc1> <loc2> --agent
  6. 其他情况 → 执行
    forecast [location]
    (如果未传入地点且已配置家庭所在地,则执行晨间简报)
<!-- pr-218-features -->

Agent Workflow Features

Agent工作流功能

This CLI exposes three shared agent-workflow capabilities patched in from cli-printing-press PR #218.
本CLI提供三个从cli-printing-press PR #218移植的通用Agent工作流功能。

Named profiles

命名配置文件

Persist a set of flags under a name and reuse them across invocations.
bash
undefined
将一组标志持久化为名称,并在多次调用中复用。
bash
undefined

Save the current non-default flags as a named profile

将当前非默认标志保存为命名配置文件

weather-goat-pp-cli profile save <name>
weather-goat-pp-cli profile save <name>

Use a profile — overlays its values onto any flag you don't set explicitly

使用配置文件——其值将覆盖未显式设置的标志

weather-goat-pp-cli --profile <name> <command>
weather-goat-pp-cli --profile <name> <command>

List / inspect / remove

列出/查看/删除

weather-goat-pp-cli profile list weather-goat-pp-cli profile show <name> weather-goat-pp-cli profile delete <name> --yes

Flag precedence: explicit flag > env var > profile > default.
weather-goat-pp-cli profile list weather-goat-pp-cli profile show <name> weather-goat-pp-cli profile delete <name> --yes

标志优先级:显式标志 > 环境变量 > 配置文件 > 默认值。

--deliver

--deliver

Route command output to a sink other than stdout. Useful when an agent needs to hand a result to a file, a webhook, or another process without plumbing.
bash
weather-goat-pp-cli <command> --deliver file:/path/to/out.json
weather-goat-pp-cli <command> --deliver webhook:https://hooks.example/in
File sinks write atomically (tmp + rename). Webhook sinks POST
application/json
(or
application/x-ndjson
when
--compact
is set). Unknown schemes produce a structured refusal listing the supported set.
将命令输出路由到stdout以外的目标。当Agent需要将结果传递到文件、webhook或其他进程时非常有用,无需额外管道配置。
bash
weather-goat-pp-cli <command> --deliver file:/path/to/out.json
weather-goat-pp-cli <command> --deliver webhook:https://hooks.example/in
文件目标采用原子写入(先写入临时文件再重命名)。Webhook目标以
application/json
格式POST(当设置
--compact
时为
application/x-ndjson
格式)。未知协议会返回结构化拒绝信息,并列出支持的协议类型。

feedback

feedback

Record in-band feedback about this CLI from the agent side of the loop. Local-only by default; safe to call without configuration.
bash
weather-goat-pp-cli feedback "what surprised you or tripped you up"
weather-goat-pp-cli feedback list         # show local entries
weather-goat-pp-cli feedback clear --yes  # wipe
Entries append to
~/.weather-goat-pp-cli/feedback.jsonl
as JSON lines. When
WEATHER_GOAT_FEEDBACK_ENDPOINT
is set and either
--send
is passed or
WEATHER_GOAT_FEEDBACK_AUTO_SEND=true
, the entry is also POSTed upstream (non-blocking — local write always succeeds).
从Agent侧记录关于本CLI的即时反馈。默认仅本地存储;无需配置即可安全调用。
bash
weather-goat-pp-cli feedback "what surprised you or tripped you up"
weather-goat-pp-cli feedback list         # 显示本地记录
weather-goat-pp-cli feedback clear --yes  # 清空记录
记录以JSON行格式追加到
~/.weather-goat-pp-cli/feedback.jsonl
。当设置
WEATHER_GOAT_FEEDBACK_ENDPOINT
且传入
--send
参数或设置
WEATHER_GOAT_FEEDBACK_AUTO_SEND=true
时,记录还会被POST到上游服务器(非阻塞——本地写入始终成功)。