Hydration Tracker
A daily water intake tracker that helps you build and maintain healthy hydration habits. Log every drink, set personalized daily goals, check your progress throughout the day, and review weekly summaries — all from the command line with local-only data storage.
Commands
| Command | Description |
|---|
| INLINECODE0 | Log water intake in milliliters (default: 250ml). Shows running total and goal progress with celebration when goal is reached |
| INLINECODE1 |
Quick-log a cup of water (250ml) — shortcut for
drink 250 |
|
bottle | Quick-log a bottle of water (500ml) — shortcut for
drink 500 |
|
today | Display today's total intake vs. daily goal, with remaining amount or goal-reached indicator |
|
goal [ml] | Set your daily hydration goal in milliliters (default: 2000ml) |
|
check | Check if you're on track — compares current intake against expected intake based on time of day |
|
week | Show a 7-day hydration summary with daily breakdowns, weekly total, and daily average |
|
history [n] | Show hydration history for the last N days (default: 7, max: 30) |
|
stats | Display overall statistics — total days tracked, total intake, and average daily intake |
|
remind | Get a random hydration tip (e.g., "Drink a glass of water before each meal") |
|
info | Show version info (v1.0.0) |
|
help | Show all available commands with usage examples |
Data Storage
- - Data directory: INLINECODE14
- Intake data:
data.json — JSON object mapping dates (YYYY-MM-DD) to cumulative daily intake in ml - Goal config:
goal.json — stores your current daily goal (default: 2000ml) - Max history: 30 days of lookback for the
history command - All data is stored locally in JSON format; no external services, accounts, or network access required
Requirements
- - Bash 4+
- Python 3 (standard library only — used for JSON read/write)
- Standard POSIX utilities (
date, seq) - No API keys or external dependencies
When to Use
- 1. Building a daily hydration habit — log each drink throughout the day and let the progress tracker keep you motivated with goal-reached celebrations
- Checking mid-day progress — use
check to see if your intake is on track relative to the time of day, so you can catch up before evening - Reviewing weekly trends — run
week to see a 7-day summary with emoji indicators showing which days you hit your goal - Adjusting your hydration goal — use
goal to increase or decrease your daily target based on activity level, weather, or health needs - Getting gentle reminders — run
remind for evidence-based hydration tips to keep healthy habits top of mind
Examples
CODEBLOCK0
Example Output
CODEBLOCK1
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
饮水追踪器
一款每日饮水追踪工具,帮助你建立并维持健康的饮水习惯。记录每次饮水,设定个性化每日目标,全天查看进度,回顾每周总结——全部在命令行完成,数据仅存储在本地。
命令
| 命令 | 描述 |
|---|
| drink [毫升] | 记录饮水量(单位:毫升,默认:250ml)。显示累计总量和目标进度,达成目标时会有庆祝提示 |
| cup |
快速记录一杯水(250ml)—— drink 250 的快捷方式 |
| bottle | 快速记录一瓶水(500ml)—— drink 500 的快捷方式 |
| today | 显示今日总饮水量与每日目标对比,包含剩余量或目标达成指示 |
| goal [毫升] | 设置每日饮水目标(单位:毫升,默认:2000ml) |
| check | 检查当前进度——将当前饮水量与基于时间段的预期饮水量进行比较 |
| week | 显示7天饮水总结,包含每日明细、每周总量和每日平均值 |
| history [n] | 显示最近N天的饮水历史记录(默认:7天,最大:30天) |
| stats | 显示总体统计数据——追踪天数、总饮水量和日均饮水量 |
| remind | 获取随机饮水小贴士(例如:每餐前喝一杯水) |
| info | 显示版本信息(v1.0.0) |
| help | 显示所有可用命令及使用示例 |
数据存储
- - 数据目录: ~/.water_reminder/
- 饮水数据: data.json — JSON对象,将日期(YYYY-MM-DD)映射为每日累计饮水量(毫升)
- 目标配置: goal.json — 存储当前每日目标(默认:2000ml)
- 最大历史记录: history 命令可回溯最多30天
- 所有数据以JSON格式存储在本地;无需外部服务、账户或网络访问
系统要求
- - Bash 4+
- Python 3(仅使用标准库——用于JSON读写)
- 标准POSIX工具(date、seq)
- 无需API密钥或外部依赖
使用场景
- 1. 培养每日饮水习惯 — 全天记录每次饮水,让进度追踪器通过目标达成庆祝功能保持你的动力
- 检查中午进度 — 使用 check 查看当前饮水量是否与时间段匹配,以便在晚上前及时补充
- 回顾每周趋势 — 运行 week 查看7天总结,通过表情符号指示器显示哪些日子达成了目标
- 调整饮水目标 — 使用 goal 根据活动量、天气或健康需求增加或减少每日目标
- 获取温和提醒 — 运行 remind 获取基于证据的饮水小贴士,让健康习惯时刻铭记于心
示例
bash
记录300ml饮水
hydration-tracker drink 300
快速记录一杯水(250ml)
hydration-tracker cup
快速记录一瓶水(500ml)
hydration-tracker bottle
查看今日进度
hydration-tracker today
设置自定义每日目标为2500ml
hydration-tracker goal 2500
示例输出
$ hydration-tracker drink 300
已记录300ml。今日总量:1200ml / 2000ml。
快到了!继续加油!
$ hydration-tracker today
今日饮水量(2026-03-18):1200ml / 2000ml
剩余:800ml
$ hydration-tracker week
--- 每周饮水总结 ---
2026-03-18:(1200ml / 2000ml)💧
2026-03-17:(2100ml / 2000ml)🎉
2026-03-16:(1800ml / 2000ml)💧
...
每周总量:12300ml
日均:1757ml(目标:2000ml)
$ hydration-tracker remind
💧 饮水小贴士:每餐前喝一杯水。
由 BytesAgain 提供支持 | bytesagain.com | hello@bytesagain.com