feat: add tempest-cli skill — hyper-local weather from Tempest station #3

Merged
magnus merged 1 commit from feat/tempest-cli-skill into main 2026-05-21 22:38:54 -04:00
Contributor

Summary

CLI wrapper for the WeatherFlow Tempest API: current conditions, forecast, historical observations, and real-time UDP broadcasts. Demonstrates all cli-builder patterns in a working, testable project.

Files

tempest-cli/
├── SKILL.md                              # 161 lines — trigger surface, commands, gotchas
├── scripts/
│   └── tempest-cli                       # 696 lines — the Python CLI binary
└── references/
    └── tempest-api-field-layouts.md       # 128 lines — obs_st/obs_air/obs_sky field maps

Commands

  • current — latest observations (auto-selects sensor, skips hub)
  • forecast — current + daily + hourly (with --days N)
  • stations — list stations and attached devices
  • obs — historical observations (--days N)
  • udp listen — real-time broadcasts from hub on same LAN

Features

  • All cli-builder patterns demonstrated in real code
  • Metric-native API handling with unit conversion
  • Multi-sensor selection (ST > SKY > AIR, filters HB hub)
  • UDP protocol decoding: obs_st, rapid_wind, evt_strike, evt_precip
  • Field trap documentation (epoch ints, missing local_time, nested forecast)
  • Zero internal references — publish-ready

Setup

pip install requests
export TEMPEST_TOKEN="your-token"
./scripts/tempest-cli current

Token is free from weatherflow.com (Account → API Tokens).

Signed-off-by: Jasper magnus@groktop.us

## Summary CLI wrapper for the WeatherFlow Tempest API: current conditions, forecast, historical observations, and real-time UDP broadcasts. Demonstrates all cli-builder patterns in a working, testable project. ## Files ``` tempest-cli/ ├── SKILL.md # 161 lines — trigger surface, commands, gotchas ├── scripts/ │ └── tempest-cli # 696 lines — the Python CLI binary └── references/ └── tempest-api-field-layouts.md # 128 lines — obs_st/obs_air/obs_sky field maps ``` ## Commands - `current` — latest observations (auto-selects sensor, skips hub) - `forecast` — current + daily + hourly (with --days N) - `stations` — list stations and attached devices - `obs` — historical observations (--days N) - `udp listen` — real-time broadcasts from hub on same LAN ## Features - All cli-builder patterns demonstrated in real code - Metric-native API handling with unit conversion - Multi-sensor selection (ST > SKY > AIR, filters HB hub) - UDP protocol decoding: obs_st, rapid_wind, evt_strike, evt_precip - Field trap documentation (epoch ints, missing local_time, nested forecast) - Zero internal references — publish-ready ## Setup ```bash pip install requests export TEMPEST_TOKEN="your-token" ./scripts/tempest-cli current ``` Token is free from weatherflow.com (Account → API Tokens). Signed-off-by: Jasper <magnus@groktop.us>
CLI wrapper for the WeatherFlow Tempest API: current conditions,
forecast, historical observations, and real-time UDP broadcasts.
Demonstrates all cli-builder patterns in a working, testable project:

- Non-interactive with --json, --dry-run, --quiet, --verbose
- Lazy auth (--help and --dry-run work without a token)
- Multi-device filtering (auto-skips HB hub, prefers ST > SKY > AIR)
- Dual-output via emit() helper
- Structured logging with log/warn/die
- Stderr hygiene and import-time warning suppression
- Idempotent operations
- Global flags in any position (pre-parsed from argv)

Includes the Python CLI script (scripts/tempest-cli) and full API
field layout reference (references/tempest-api-field-layouts.md).

Signed-off-by: Jasper <magnus@groktop.us>
magnus merged commit f6cba81763 into main 2026-05-21 22:38:54 -04:00
jasper left a comment

Code Review: tempest-cli

Overall, this is a well-structured CLI that follows cli-builder patterns. Clean error handling, proper unit conversions, good use of argparse. A few issues to address before merging.

Issues found:

Bug: OBS_SKY_FIELDS missing 3 fields

OBS_SKY_FIELDS defines 14 fields but references/tempest-api-field-layouts.md documents 17. Missing: nc_rain, local_day_nc_rain, precip_analysis_type. The decode_obs function for obs_sky will silently drop these values.

Missing feature: ~/.tempest.env fallback

SKILL.md says "falls back to reading ~/.tempest.env if the env var is not set" but the code only does os.getenv("TEMPEST_TOKEN", ""). No .tempest.env file reading is implemented.

Doc: SKILL.md obs_st table truncated

SKILL.md shows indices 0-18 for obs_st but the code defines 22 fields (indices 19-21 for nc_rain_accumulation, local_day_nc_rain_accumulation, precip_analysis_type are in both the code and reference doc). The SKILL.md should either show the complete table or note that the last 3 indices are covered in the reference doc.

Reviewed-by: Jasper (automated review)

## Code Review: tempest-cli Overall, this is a well-structured CLI that follows cli-builder patterns. Clean error handling, proper unit conversions, good use of argparse. A few issues to address before merging. **Issues found:** ### Bug: OBS_SKY_FIELDS missing 3 fields `OBS_SKY_FIELDS` defines 14 fields but `references/tempest-api-field-layouts.md` documents 17. Missing: `nc_rain`, `local_day_nc_rain`, `precip_analysis_type`. The `decode_obs` function for `obs_sky` will silently drop these values. ### Missing feature: ~/.tempest.env fallback SKILL.md says "falls back to reading `~/.tempest.env` if the env var is not set" but the code only does `os.getenv("TEMPEST_TOKEN", "")`. No `.tempest.env` file reading is implemented. ### Doc: SKILL.md obs_st table truncated SKILL.md shows indices 0-18 for obs_st but the code defines 22 fields (indices 19-21 for nc_rain_accumulation, local_day_nc_rain_accumulation, precip_analysis_type are in both the code and reference doc). The SKILL.md should either show the complete table or note that the last 3 indices are covered in the reference doc. Reviewed-by: Jasper (automated review)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
magnus/agent-skills!3
No description provided.