Skip to content

feat(cli): add timeline command for annotated cook milestones#285

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

feat(cli): add timeline command for annotated cook milestones#285
jongio wants to merge 1 commit into
mainfrom
idea/cli-timeline

Conversation

@jongio

@jongio jongio commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Adds a timeline command that turns a saved cook into an annotated timeline. It reads an archive, picks a probe channel, and marks the milestones worth knowing about: the start, the low point, the longest stall, the first crossing of a target temperature, the peak, and the end. Each line shows elapsed clock time, the temperature, and a short label, so you can read the shape of a cook at a glance instead of scrubbing through every reading.

What is new

  • SDK: buildCookTimeline(readings, options) in packages/sdk/src/timeline.ts. Pure and side-effect free. Stall detection runs in linear time using a sliding window with monotonic min/max deques. Non-anchor milestones that land on the first or last reading fold into the start and end lines, and when two milestones share a reading the more specific one wins (target over stall over peak over low).
  • CLI: thermoworks timeline <SERIAL> [--archive ID] [--channel N] [--target F] [--json]. Defaults to the latest archive. Converts Celsius readings to Fahrenheit before analysis.
  • Docs: entries in packages/cli/README.md and docs/cli-reference.md.
  • Tests: SDK unit tests for the milestone logic and CLI tests for parsing, formatting, and the handler paths.

Example

Timeline for Brisket 2026 - Meat 1 (182 readings)
  0:00   38F  start   Cook started at 38F
  3:12  151F  stall   Stall began near 152F, held 78m
  9:41  203F  target  Hit target 203F
 10:15  204F  peak    Peaked at 204F
 10:32  201F  end     Cook ended at 201F
  Min 38F, max 204F over 632m.

Verification

  • pnpm --dir packages/sdk typecheck && test (488 tests)
  • pnpm --dir packages/cli typecheck && test (891 tests)
  • pnpm lint

Closes #284

Add a `timeline` command that condenses a saved cook into the moments
that matter: the start, the low point, the longest stall, the first
target crossing, the peak, and the end. Each line shows elapsed clock
time, temperature, and a short label so you can read the shape of a cook
without scrubbing every reading.

Adds a pure SDK helper `buildCookTimeline` (linear-time stall detection
via a sliding window with monotonic min/max deques) plus unit tests, the
CLI command with parsing/formatting tests, and reference docs.

Closes #284

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 timeline command for an annotated cook timeline from an archive

1 participant