Skip to content

feat(cli): add wrap command for a should-I-wrap-now advisor#283

Open
jongio wants to merge 1 commit into
mainfrom
idea/cli-wrap
Open

feat(cli): add wrap command for a should-I-wrap-now advisor#283
jongio wants to merge 1 commit into
mainfrom
idea/cli-wrap

Conversation

@jongio

@jongio jongio commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What

Adds a thermoworks wrap <serial> --target <F> command that advises whether to wrap the cook now (the Texas crutch). Wrapping in foil or butcher paper pushes meat through the stall faster and protects the bark, but wrap too early and the bark never sets.

The command reads the trailing probe history for a device and combines the current temperature, the wrap window, stall detection, and rate of climb into one call:

  • wrap-now: inside the wrap window and either stalled or barely climbing
  • hold: inside the window but still climbing well, so wrapping is optional
  • below-window: under the wrap temperature, let the bark set first
  • at-target: at or above the target, pull and rest instead
  • no-data: no readings yet

How

  • New pure SDK helper assessWrap in packages/sdk/src/wrap-advisor.ts. It reuses the existing detectStall and detectRapidChange detectors, so a wrap-now call lines up with an active stall. Side-effect free and unit tested.
  • New CLI command packages/cli/src/commands/wrap.ts reads client.getHistory(serial), converts readings to Fahrenheit, and prints a human summary or --json.
  • Readings come from the device history series, the same source as history and graph.

Flags

  • --target F (required): target internal temperature
  • --wrap-at F: temperature where the wrap window opens (default 160)
  • --limit N: look at only the most recent N readings
  • --json: machine-readable output

Tests

  • packages/sdk/tests/wrap-advisor.test.ts: all five call paths plus custom wrap window and slow-rate threshold.
  • packages/cli/tests/wrap.test.ts: arg parsing, formatting, Celsius conversion, limit, and the login/usage guards.
  • SDK 486 tests pass, CLI 892 tests pass, typecheck clean, pnpm lint clean.

Closes #282

Add a `wrap` command that reads the trailing probe history for a device
and calls whether to wrap the cook now (the Texas crutch). It combines
the current temperature, the wrap window, stall detection, and rate of
climb into one call: wrap-now, hold, below-window, at-target, or no-data.

The logic lives in a pure SDK helper `assessWrap` so it stays testable
and reuses the existing stall and rate-of-change detectors. Readings come
from the device history series, the same source as `history` and `graph`.

Closes #282

Co-authored-by: Copilot App <[email protected]>
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 13, 2026
@jongio jongio self-assigned this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: Add wrap command for a should-I-wrap-now advisor

1 participant