介绍
# whoopskill
使用 `whoopskill` 获取 WHOOP 健康指标(睡眠、恢复、HRV、负荷、锻炼)。
安装:`npm install -g whoopskill` | [GitHub](https://github.com/koala73/whoopskill)
快速入门 - `whoopskill summary` — 单行显示:Recovery: 52% | HRV: 39ms | Sleep: 40% | Strain: 6.7 - `whoopskill summary --color` — 带有 🟢🟡🔴 状态指示器的彩色摘要 - `whoopskill trends` — 7 天趋势,包含平均值和方向箭头 - `whoopskill trends --days 30 --pretty` — 30 天趋势分析 - `whoopskill insights --pretty` — AI 风格的健康建议 - `whoopskill --pretty` — 带有表情符号的人类可读输出 - `whoopskill recovery` — 恢复评分、HRV、静息心率 - `whoopskill sleep` — 睡眠表现、睡眠阶段 - `whoopskill workout` — 带负荷的锻炼记录 - `whoopskill --date 2025-01-03` — 特定日期
分析命令 - `summary` — 快速健康快照(添加 `--color` 以显示状态指示器) - `trends` — 多日平均值,带趋势箭头 (↑↓→) - `insights` — 基于您的数据的个性化建议
数据类型 - `profile` — 用户信息(姓名、邮箱) - `body` — 身高、体重、最大心率 - `sleep` — 睡眠阶段、睡眠效率、呼吸频率 - `recovery` — 恢复百分比、HRV、静息心率、血氧、皮肤温度 - `workout` — 负荷、心率区间、卡路里 - `cycle` — 每日负荷、卡路里
组合类型 - `whoopskill --sleep --recovery --body`
身份验证 - `whoopskill auth login` — OAuth 流程(打开浏览器) - `whoopskill auth status` — 检查令牌状态 - `whoopskill auth logout` — 清除令牌
注意事项 - 输出为 JSON 到 stdout(使用 `--pretty` 以获得可读格式) - 令牌存储在 `~/.whoop-cli/tokens.json` 中(自动刷新) - 使用 WHOOP API v2 - 日期遵循 WHOOP 日界线(凌晨 4 点截止) - 用户少于 10 人的 WHOOP 应用无需审核(即时使用)
示例:`whoopskill summary --color` ``` 📅 2026-01-25 🟢 Recovery: 85% | HRV: 39ms | RHR: 63bpm 🟡 Sleep: 79% | 6.9h | Efficiency: 97% 🔴 Strain: 0.1 (optimal: ~14) | 579 cal ```
示例:`whoopskill trends` ``` 📊 7-Day Trends
💚 Recovery: 62.1% avg (34-86) → 💓 HRV: 33.8ms avg (26-42) → ❤️ RHR: 63.8bpm avg (60-68) → 😴 Sleep: 75.4% avg (69-79) → 🛏️ Hours: 6.5h avg (5.7-7.8) ↓ 🔥 Strain: 5.9 avg (0.1-9.0) ↓ ```
示例:`whoopskill insights` ``` 💡 Insights & Recommendations
✅ Green Recovery Recovery at 85% — body is primed for high strain. → Great day for intense training or competition.
✅ HRV Above Baseline Today's HRV (39ms) is 21% above your 7-day average. → Excellent recovery. Good day for peak performance.
⚠️ Mild Sleep Debt You have 2.0 hours of sleep debt. → Consider an earlier bedtime tonight.
✅ Strain Capacity Available Current strain: 0.1. Optimal target: ~14. → Room for 13.9 more strain today. ```
示例:`whoopskill --sleep --recovery` (JSON) ```json { "date": "2026-01-05", "fetched_at": "2026-01-05T13:49:22.782Z", "body": { "height_meter": 1.83, "weight_kilogram": 82.5, "max_heart_rate": 182 }, "sleep": [ { "id": "4c311bd4-370f-49ff-b58c-0578d543e9d2", "cycle_id": 1236731435, "user_id": 245199, "created_at": "2026-01-05T00:23:34.264Z", "updated_at": "2026-01-05T02:23:54.686Z", "start": "2026-01-04T19:51:57.280Z", "end": "2026-01-05T01:30:48.660Z", "timezone_offset": "+04:00", "nap": false, "score_state": "SCORED", "score": { "stage_summary": { "total_in_bed_time_milli": 20331380, "total_awake_time_milli": 4416000, "total_light_sleep_time_milli": 6968320, "total_slow_wave_sleep_time_milli": 4953060, "total_rem_sleep_time_milli": 3994000, "sleep_cycle_count": 4, "disturbance_count": 4 }, "sleep_needed": { "baseline_milli": 26783239, "need_from_sleep_debt_milli": 6637715, "need_from_recent_strain_milli": 148919 }, "respiratory_rate": 14.12, "sleep_performance_percentage": 40, "sleep_consistency_percentage": 60, "sleep_efficiency_percentage": 78.28 } } ], "workout": [ { "id": "4279883e-3d23-45cd-848c-3afa28dca3f8", "user_id": 245199, "start": "2026-01-05T03:14:13.417Z", "end": "2026-01-05T04:06:45.532Z", "sport_name": "hiit", "score_state": "SCORED", "score": { "strain": 6.19, "average_heart_rate": 108, "max_heart_rate": 144, "kilojoule": 819.38, "zone_durations": { "zone_zero_milli": 167000, "zone_one_milli": 1420000, "zone_two_milli": 1234980, "zone_three_milli": 330000, "zone_four_milli": 0, "zone_five_milli": 0 } } } ], "profile": { "user_id": 245199, "email": "[email protected]", "first_name": "John", "last_name": "Doe" }, "recovery": [ { "cycle_id": 1236731435, "sleep_id": "4c311bd4-370f-49ff-b58c-0578d543e9d2", "user_id": 245199, "score_state": "SCORED", "score": { "recovery_score": 52, "resting_heart_rate": 60, "hrv_rmssd_milli": 38.87, "spo2_percentage": 96.4, "skin_temp_celsius": 33.19 } } ], "cycle": [ { "id": 1236731435, "user_id": 245199, "start": "2026-01-04T19:51:57.280Z", "end": null, "score_state": "SCORED", "score": { "strain": 6.66, "kilojoule": 6172.94, "average_heart_rate": 71, "max_heart_rate": 144 } } ] } ```