← 返回
数据分析

Sleep Tracker

睡眠改善工具。睡眠分析、改善建议、作息规划、睡眠环境优化、小睡指南、睡眠日记。Sleep tracker with analysis, improvement tips, schedule planning, environment optimization, nap guide.
睡眠改善工具。睡眠分析、改善建议、作息规划、睡眠环境优化、小睡指南、睡眠日记。Sleep tracker with analysis, improvement tips, schedule planning, environment optimization, nap guide.
bytesagain1
数据分析 clawhub v2.0.1 3 版本 100000 Key: 无需
★ 0
Stars
📥 981
下载
💾 8
安装
3
版本
#latest#productivity

概述

sleep-tracker

Health and wellness tracker for logging daily activities, tracking streaks, viewing statistics, setting reminders and goals, and getting health tips. A versatile CLI tool for building and maintaining healthy habits.

Commands

CommandDescription
----------------------
sleep-tracker log Log a new entry with today's date
sleep-tracker todayShow all entries logged today
sleep-tracker streakCheck your current streak of consecutive days
sleep-tracker statsShow total number of entries in the data log
sleep-tracker reminder [time]Set a reminder for a task (default time: 8:00)
sleep-tracker tipsGet health tips (hydration, movement, sleep)
sleep-tracker goal [frequency]Set a goal with optional frequency (default: daily)
sleep-tracker historyView the last 14 entries from the data log
sleep-tracker exportExport all data to stdout
sleep-tracker resetReset tracker (requires --confirm flag to actually clear data)
sleep-tracker helpShow help message with all available commands
sleep-tracker versionShow version number

How It Works

sleep-tracker manages a simple text-based data log (data.log) where each entry is automatically stamped with the current date. It provides a lightweight way to track health activities, build streaks, and review your history.

Daily Workflow

  1. Log activities: Record what you did — exercise, meals, sleep times, etc.
  2. Check today: Review everything logged today with sleep-tracker today
  3. Track progress: Use streak to see consecutive days and stats for totals
  4. Set goals and reminders: Keep yourself accountable with goal and reminder
  5. Review history: Look at the last 2 weeks with history

Data Storage

All data is stored in $SLEEP_TRACKER_DIR or defaults to ~/.local/share/sleep-tracker/. The directory contains:

  • data.log — main data file with date-stamped entries
  • history.log — timestamped log of all commands executed for auditing

The tool automatically creates the data directory on first run. You can override the storage location by setting the SLEEP_TRACKER_DIR environment variable.

Requirements

  • Shell: Bash 4+
  • No external dependencies — uses only standard Unix utilities (date, grep, wc, tail, cat)
  • Works on: Linux, macOS, any POSIX-compatible system

When to Use

  1. Daily health logging — Run sleep-tracker log "8h sleep, felt rested" each morning to build a habit history
  2. Tracking exercise streaks — Log workouts daily and check sleep-tracker streak to stay motivated with consecutive-day tracking
  3. Setting health reminders — Use sleep-tracker reminder "drink water" 14:00 to record reminder notes for key health tasks
  4. Reviewing weekly patterns — Run sleep-tracker history to see the last 14 entries and spot trends in your health data
  5. Exporting data for analysis — Use sleep-tracker export > health-data.txt to get all records into a file for spreadsheet analysis or sharing with a health professional

Examples

# Log a sleep entry
sleep-tracker log "Slept 7.5 hours, quality 4/5"

# Log exercise
sleep-tracker log "30 min jog, 5km"

# Log meals
sleep-tracker log "Healthy breakfast: oatmeal, fruit, coffee"

# Check what you logged today
sleep-tracker today

# View your streak
sleep-tracker streak

# Get overall statistics
sleep-tracker stats

# Set a daily water reminder
sleep-tracker reminder "drink 2L water" 10:00

# Set a fitness goal
sleep-tracker goal "run 5km" weekly

# Get health tips
sleep-tracker tips

# View the last 14 entries
sleep-tracker history

# Export all data to a file
sleep-tracker export > my-health-log.txt

# Reset (dry run — shows instructions)
sleep-tracker reset

Health Tips (Built-in)

The tips command provides three core health reminders:

  1. Stay hydrated — drink water throughout the day
  2. Move every hour — take short breaks from sitting
  3. Sleep 7-8 hours — prioritize consistent rest

Configuration

Set the SLEEP_TRACKER_DIR environment variable to change the data directory:

export SLEEP_TRACKER_DIR="$HOME/my-health-data"

Default location: ~/.local/share/sleep-tracker/

Output

All output goes to stdout in plain text. Use shell redirection to save results:

sleep-tracker history > weekly-review.txt
sleep-tracker export | grep "2024-03"

Powered by BytesAgain | bytesagain.com | hello@bytesagain.com

版本历史

共 3 个版本

  • v2.0.1 当前
    2026-03-29 09:41 安全 安全
  • v1.0.7
    2026-03-18 19:31
  • v1.0.0
    2026-03-14 03:53

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Cad

bytesagain1
CAD参考工具
★ 0 📥 2,727
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 367 📥 140,189
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 64,987