Skip to content

feat(cli): add portions command to plan how much meat to buy#299

Closed
jongio wants to merge 1 commit into
mainfrom
idea/cli-portions
Closed

feat(cli): add portions command to plan how much meat to buy#299
jongio wants to merge 1 commit into
mainfrom
idea/cli-portions

Conversation

@jongio

@jongio jongio commented Jul 19, 2026

Copy link
Copy Markdown
Owner

What

Add a portions command that turns a guest count into how much raw meat to buy.

Cuts lose weight to trim and rendering, so buying by cooked serving size under-buys. This divides the cooked weight you want to serve by the cut's yield, then rounds up to the next quarter pound so you land on a number the counter can actually weigh out.

npx thermoworks portions brisket --guests 12
npx thermoworks portions "pork butt" --guests 20 --appetite hearty
npx thermoworks portions salmon --guests 8 --per-person 5 --json
npx thermoworks portions --list

How

  • SDK packages/sdk/src/portions.ts: pure calculatePortions(meat, guests, options) plus listAppetites and listPortionYields. It reuses the shared meat registry (resolveMeatProfile) so aliases like pork butt and babyback resolve, and keeps its own per-cut cook yields for the ten built-in profiles. Appetite presets are light, standard, and hearty at 4, 6, and 8 cooked ounces. No network, no clock, no files.
  • CLI packages/cli/src/commands/portions.ts: portions <meat> --guests N [--appetite ...] [--per-person OZ] [--list] [--json]. Unknown cuts, bad guest counts, and conflicting flags exit non-zero.

Testing

  • SDK: 14 tests for yield math, appetite scaling, quarter-pound rounding, alias resolution, and validation.
  • CLI: 22 tests for arg parsing, formatting, JSON output, --list, and the error paths.
  • Full suites green (SDK 562, CLI 1216), pnpm lint clean, typecheck clean.

Yields are working averages meant to keep you from under-buying, not to hit an exact plate weight.

Closes #295

Turn a guest count into a raw-weight shopping number. Cuts lose weight
to trim and rendering, so this divides the cooked weight you want to
serve by the cut's yield and rounds up to the next quarter pound.

SDK: new portions module with calculatePortions, listAppetites, and
listPortionYields. Pure and offline, reusing the shared meat registry
for cut lookup (aliases included). Per-cut yields cover the ten built-in
profiles; appetite presets are light/standard/hearty at 4/6/8 cooked oz.

CLI: new `thermoworks portions <meat> --guests N` command with
--appetite, --per-person, --list, and --json. Unknown cuts and bad
counts exit non-zero.

Tests cover yield math, rounding, aliases, validation, and the CLI
parse/format/handler paths. README and cli-reference updated.

Closes #295

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ecabbd71-7dd2-42f1-a014-ab6df3686eee
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 19, 2026
@jongio jongio self-assigned this Jul 19, 2026
@jongio

jongio commented Jul 20, 2026

Copy link
Copy Markdown
Owner Author

Closing. Keeping the thermoworks CLI focused on device and temperature features: probes, alarms, device health, and live and archived readings. A portions calculator doesn't read device data, so it's out of scope here.

@jongio jongio closed this Jul 20, 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.

Add a portions command to plan how much raw meat to buy for a headcount

1 participant