拍照、文字或拍营养标签都能记录一餐,输出区间形式的热量与宏量营养素估算,并带安全护栏。
记忆
Calorie Tracker
试用Log and track daily calorie intake, macronutrients, body weight, and waist measurements locally in a SQLite database. Provides granular statistics, weekly averages, and future calorie budgets.
它能做什么
Log and track daily calorie intake, macronutrients, body weight, and waist measurements locally in a SQLite database. Provides granular statistics, weekly averages, and future calorie budgets.
技能文档
Local Calorie Tracker Skill
Track daily calorie intake, macronutrients, body weight, and waist measurements locally using a SQLite database.
Installation & Setup
This is a standalone, skill-first OpenClaw skill. It runs out-of-the-box using standard Python libraries.
The default SQLite database file is named health_data.db and is resolved relative to the current working directory (Cwd) of the running agent. To override the database path, pass the --database PATH option to any command.
Operational Instructions for the Agent
- No Compensatory Entries: If a food entry was logged incorrectly (e.g. wrong calorie or protein count), do not log a new positive or negative "balancing" or "corrective" entry. Instead, identify the incorrect entry's ID using the
listorstats daycommand, and run theupdateordeletecommand to fix it. - No Bogus Logs: Every logged entry's description must contain only the actual name of the food or drink consumed. Do not store summaries, calorie calculations, or meta-data in the food description (e.g., do not name an entry "1875 kcal, 72g protein" to force-balance a day).
- Standardized Meal Types: Every logged food entry must have a valid
--mealtype. Allowed types are:breakfast,lunch,dinner,snack,fika,drink,dessert,evening, andother. Valid meal types are loaded and validated dynamically from the database.
Day Completeness Quality Levels
When marking a day as complete using the complete command, use one of the following completeness quality levels:
full: Default. All meals and drinks consumed for the target day were fully tracked.partial: Some meals are missing, or the day relies heavily on rough estimates.minimal: Only sporadic entries were logged; most of the day's intake is unknown.
Interpreting Weekly Averages & Budgets
When reviewing weekly averages using the stats week command, averages and budgets are tailored dynamically to today's completion status by default (--include-today auto):
- If Today is Incomplete: The command excludes today's data from the active average display, showing the Monday-to-Yesterday Average and the Daily Budget Starting Today (including a dynamic helper showing remaining calories for today).
- If Today is Complete: The command includes today's data, showing the Monday-to-Today Average and the Daily Budget Starting Tomorrow.
- Customizing Scope: You can use the
--include-todayflag to force a specific behavior:--include-today yes: Forces inclusion of today (shows Mon-Today average and Starting Tomorrow budget).--include-today no: Forces exclusion of today (shows Mon-Yesterday average and Starting Today budget).--include-today both: Shows both sets of averages and budgets.
CLI Reference
All commands support the following global flags (which must be placed before the subcommand):
--database PATH: Path to SQLite database file (defaulting to./health_data.db).--today YYYY-MM-DD: Simulates today's date context for the entire command run (overrides the system clock date, affecting default logging dates, lookbacks, weekly budgets, and rolling averages).
1. Configuration & Logging
-
Configure Daily Goal & Height:
python3 scripts/tracker.py goal CALORIES [PROTEIN] [--height HEIGHT_CM]Sets target calories, optional protein goals (in grams), and optional height in cm (used dynamically by SQLite views to compute BMI and Waist-to-Height Ratio). Example:
python3 scripts/tracker.py goal 1800 120 --height 180.0 -
Log Food Entry:
python3 scripts/tracker.py add "food description" CALORIES [protein] [carbs] [fat] --meal TYPE [--date YYYY-MM-DD]Example:
python3 scripts/tracker.py add "Oatmeal with blueberries" 350 12 --meal breakfast -
List Entries by ID:
python3 scripts/tracker.py list [DATE] [--no-group]Lists all entries for
DATE(defaults to today). By default, entries are grouped by meal type (combining descriptions and summing calories/protein). Pass--no-groupto disable grouping and display raw individual entries with their database IDs and timestamps (essential for updates/deletions). -
Update Food Entry:
python3 scripts/tracker.py update ID [--name NAME] [--cal CALORIES] [--p PROTEIN] [--c CARBS] [--f FAT] [--meal TYPE]Modifies an existing entry by ID. Only the specified flags are updated.
-
Delete Food Entry:
python3 scripts/tracker.py delete IDPermanently deletes a specific entry.
-
Mark Day as Complete:
python3 scripts/tracker.py complete DATE [--completeness QUALITY] [--notes NOTES]Sets the completeness status (
full(default),partial, orminimal) and markscompleted=1in the database. -
Check Day Completion:
python3 scripts/tracker.py check-complete [DATE]Exits with code
0if the date is fully completed (completeness == 'full'andcompleted == 1), otherwise exits with1. -
Log Body Weight (Shortcut):
python3 scripts/tracker.py weight KG [DATE] [--notes NOTES]Logs weight for the specified date (defaults to today). Weight is a first-class measurement type (
weight), so this delegates tomeasure weight— there is a single source of truth for all body data. -
Log Waist Circumference (Shortcut):
python3 scripts/tracker.py waist CM [DATE] [--notes NOTES]Logs waist circumference with optional notes (delegates to
measure waist). -
Log Custom Body Measurement:
python3 scripts/tracker.py measure TYPE VALUE [DATE] [--notes NOTES]Logs a measurement value for a defined measurement type (e.g. waist, hips, neck, weight, or custom defined types) with optional notes. This is the canonical way body data is stored — short commands like
weightandwaistare conveniences delegating here. (Note: Default typeswaist,hips, andneckare pre-seeded automatically. The keywaistis specifically used to compute Waist-to-Height Ratio (WHtR) and power thewaistshortcut.) Example:python3 scripts/tracker.py measure hip_upper 92.5 --notes "Upper hip line, morning" -
Define Custom Measurement Type:
python3 scripts/tracker.py measure-type define KEY DISPLAY_NAME UNIT [--desc DESCRIPTION]Defines a custom measurement point with display name, unit, and optional description. Example:
python3 scripts/tracker.py measure-type define hip_upper "Hip (Upper)" cm --desc "Upper hip line" -
List Defined Measurement Types:
python3 scripts/tracker.py measure-type listLists all defined measurement types, units, and descriptions.
-
Delete Custom Measurement Type:
python3 scripts/tracker.py measure-type delete KEYDeletes the type definition and all associated logs. Default types (
waist,hips,neck) cannot be deleted.
2. Statistics & Reports
-
Show Daily Breakdown:
python3 scripts/tracker.py stats day [DATE] [--no-group]Prints the chronological list of entries, meal-type breakdowns, and progress compared to daily goals. Defaults to today's date (or simulated
--todaydate) ifDATEis omitted. By default, the daily breakdown list is grouped by meal type (combining descriptions and summing calories/protein). Pass--no-groupto disable grouping and display raw individual entries with their database IDs and timestamps. -
Show Weekly Summary:
python3 scripts/tracker.py stats week [DATE] [--weeks N] [--compact] [--include-today {auto,yes,no,both}]Summarizes the Mon-Sun week containing
DATE(or N preceding weeks). Defaults to today's date (or simulated--todaydate) ifDATEis omitted. If--compactis passed, it outputs a single-line summary of metrics for each week. Displays weekly averages and future daily budgets tailored dynamically to today's completion status (customizable via--include-today), along with a daily breakdown table. -
Show Macronutrient Trends:
python3 scripts/tracker.py stats trend [--days N]Displays 7-day, 30-day, and 90-day rolling averages of calorie and protein intake (resolved dynamically from rolling trends view) up to today.
-
Show Weight logs:
python3 scripts/tracker.py stats weight [-N ENTRIES] [--days DAYS]Displays logged weights, BMI (computed from the stored height), and weight changes up to today. Reads from the
weightmeasurement type. Defaults to showing the last 5 entries (-N 5). Supports a positive integer or"all"for-N, and an integer number of days for--days. -
Show Waist logs (Shortcut):
python3 scripts/tracker.py stats waist [-N ENTRIES] [--days DAYS]Displays logged waist measurements, WHtR, and waist changes. Defaults to showing the last 5 entries (
-N 5). -
Show Custom Measurement logs:
python3 scripts/tracker.py stats measure TYPE [-N ENTRIES] [--days DAYS]Displays logs, unit, and calculated changes for any defined measurement type. If
TYPEiswaist, also prints WHtR. Example:python3 scripts/tracker.py stats measure chest -N 10
相关技能
Use only when the user explicitly asks for nutrition or diet-related help: calorie and macro estimation, TDEE/BMR and target intake calculations, meal planni...
以最后一次进食为起点记录间歇性与长时断食,估算当前阶段,并在 24 小时后给出电解质与复食建议。
Smart water intake tracking based on body weight, weather, and activity level. Calculates personalized hydration targets, adjusts for caffeine and alcohol consumption, tracks streaks with gamification, generates hourly drinking schedule, and provides hydration education with urine color chart reference.
Calculate exact daily calorie needs and food portions for dogs and cats from species, breed, weight, age, activity level, and body condition. Compares feeding costs across food types, generates feeding schedules for multi-pet households, and flags weight-loss plans. Use when the user asks how much to feed their dog or cat, whether their pet is overweight, or how to switch foods safely.
随口一句话就记入每日饮水量,按体重、活动和场景给出个性化补水目标。