Skip to content

Add custom-food and log commands#4

Merged
milldr merged 6 commits intomainfrom
prd-add-log-commands
Feb 13, 2026
Merged

Add custom-food and log commands#4
milldr merged 6 commits intomainfrom
prd-add-log-commands

Conversation

@milldr
Copy link
Copy Markdown
Owner

@milldr milldr commented Feb 12, 2026

Summary

  • Adds crono add custom-food <name> command to create named custom foods in Cronometer with macros and auto-calculated calories
  • Adds crono log <name> command to search for any saved food by name and log it to the diary
  • Both commands use Kernel.sh browser automation with Playwright codegen
  • Calories are auto-calculated from macros (P×4 + C×4 + F×9) or set explicitly with -t/--total
  • add custom-food supports --log [meal] to create and log in one step
  • Graceful error handling for Cronometer login rate limiting
  • GWT constants documented as public artifacts in src/cronometer/auth.ts

New Commands

crono add custom-food <name>

crono add custom-food "Chicken Sandwich" -p 50 -c 100 -f 50
crono add custom-food "Chicken Sandwich" -p 50 -c 100 -f 50 -t 1000
crono add custom-food "Chicken Sandwich" -p 50 -c 100 -f 50 --log Dinner

crono log <name>

crono log "Chicken Sandwich" -m Dinner
crono log "Chicken Sandwich" -m Snacks -s 2

Files Changed

  • src/kernel/add-custom-food.ts — Playwright codegen for custom food creation
  • src/kernel/log-food.ts — Playwright codegen for food search + diary log
  • src/kernel/client.ts — New interfaces and KernelClient methods
  • src/kernel/login.ts — Rate limit detection on failed login
  • src/commands/add.tsadd custom-food command handler
  • src/commands/log.tslog command handler
  • src/index.ts — Command registration
  • src/cronometer/auth.ts — GWT constants comment
  • README.md — Documentation for new commands
  • CLAUDE.md — Build reminder for development

Test plan

  • Unit tests pass (165 tests across 18 files)
  • Lint and format checks pass
  • Live tested add custom-food with macros and auto-calculated calories
  • Live tested log with meal category
  • Verified food name, macros, and calories saved correctly in Cronometer

@milldr milldr force-pushed the prd-add-log-commands branch from c453020 to 8008936 Compare February 13, 2026 00:20
@milldr milldr merged commit 147a0ef into main Feb 13, 2026
3 checks passed
@milldr milldr deleted the prd-add-log-commands branch February 13, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant