whoo-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesewhoo CLI
whoo CLI
whoobash
bun add -g whoo # requires Bun 1.3+whoobash
bun add -g whoo # requires Bun 1.3+Prerequisites (one-time setup, done once by the user)
前置条件(一次性设置,用户仅需操作一次)
- Create a developer app at https://developer.whoop.com — note and
client_id.client_secret - Add redirect URI in the app settings:
http://127.0.0.1:8123/callback - Authenticate:
bash
whoo login # prompts for credentials, opens browser
whoo login --client-id <ID> --client-secret <SEC> # non-interactiveFor SSH or headless environments where is not reachable, use .
It prints the auth URL; complete login in any browser, then paste the full callback URL back:
http://127.0.0.1:8123--manualbash
whoo login --manual
whoo login --manual --client-id <ID> --client-secret <SEC>Tokens persist in the OS config directory and refresh automatically. Check auth state anytime:
bash
whoo status- 前往 https://developer.whoop.com 创建开发者应用,并记录和
client_id。client_secret - 在应用设置中添加重定向URI:
http://127.0.0.1:8123/callback - 身份验证:
bash
whoo login # 提示输入凭证,自动打开浏览器
whoo login --client-id <ID> --client-secret <SEC> # 非交互式验证对于无法访问的SSH或无头环境,请使用参数。
该命令会打印授权URL;在任意浏览器中完成登录后,将完整的回调URL粘贴回终端:
http://127.0.0.1:8123--manualbash
whoo login --manual
whoo login --manual --client-id <ID> --client-secret <SEC>令牌会持久存储在系统配置目录中,并自动刷新。可随时检查身份验证状态:
bash
whoo statusCommands
命令列表
| Command | Returns | Flags |
|---|---|---|
| Active cycle with nested recovery and sleep | |
| Recovery scores | |
| Sleep sessions | |
| Profile and body measurements | |
| Auth state (logged in / credential presence) | — |
| Clear stored credentials | — |
- — records to return (1–100, default 1)
--limit <n> - — raw JSON payload; use this for programmatic access
--json - — manual login for SSH/headless; paste callback URL instead of browser auto-redirect
--manual
| 命令 | 返回内容 | 可选参数 |
|---|---|---|
| 包含恢复和睡眠数据的当前周期信息 | |
| 恢复分数 | |
| 睡眠会话记录 | |
| 用户资料及身体测量数据 | |
| 身份验证状态(已登录/凭证是否存在) | — |
| 清除存储的凭证 | — |
- — 返回的记录数量(1–100,默认值为1)
--limit <n> - — 返回原始JSON数据;适用于程序化访问场景
--json - — 适用于SSH/无头环境的手动登录模式;需粘贴回调URL而非自动浏览器重定向
--manual
Common Workflows
常见工作流
Latest recovery snapshot:
bash
whoo recovery --json最新恢复数据快照:
bash
whoo recovery --jsonkey: recoveries[0].score.recovery_score (0–100 %)
关键字段: recoveries[0].score.recovery_score (0–100 %)
**Full today (cycle + recovery + sleep in one call):**
```bash
whoo overview --json
**当日完整数据(一次调用获取周期+恢复+睡眠数据):**
```bash
whoo overview --jsonkeys: cycles[0].cycle.score.strain, cycles[0].recovery.score, cycles[0].sleep.score
关键字段: cycles[0].cycle.score.strain, cycles[0].recovery.score, cycles[0].sleep.score
**7-day sleep trend:**
```bash
whoo sleep --limit 7 --json
**7天睡眠趋势:**
```bash
whoo sleep --limit 7 --jsoniterate: sleeps[].score.sleep_performance_percentage
遍历字段: sleeps[].score.sleep_performance_percentage
**30-day history:**
```bash
whoo overview --limit 30 --jsonUser profile and body stats:
bash
whoo user --json
**30天历史数据:**
```bash
whoo overview --limit 30 --json用户资料及身体统计数据:
bash
whoo user --jsonError Handling
错误处理
| Error message | Fix |
|---|---|
| Run |
| Persistent 401 after auto-refresh | Run |
| WHOOP hasn't scored yet — skip or surface to the user |
| Insufficient data for scoring — treat as null |
Always check before interpreting numeric metrics.
score_state === "SCORED"| 错误信息 | 解决方法 |
|---|---|
| 执行 |
| 自动刷新后仍持续返回401错误 | 重新执行 |
| WHOOP尚未完成数据评分 — 可跳过该数据或告知用户 |
| 数据不足无法生成评分 — 按空值处理 |
在解读数值指标前,请务必检查是否成立。
score_state === "SCORED"References
参考资料
- JSON output schemas (field names, types, units): read
references/schemas.md - Metric interpretation (healthy ranges, score zones, context): read
references/metrics.md
- JSON输出 Schema(字段名称、类型、单位):请查看
references/schemas.md - 指标解读(健康范围、分数区间、相关背景):请查看
references/metrics.md