Query health metrics from the Whoop API and generate interactive HTML charts.
read:recovery, read:cycles, read:workout, read:sleep, read:profile, read:body_measurementhttp://localhost:9876/callbackRun the OAuth login flow with your credentials:
python3 scripts/whoop_auth.py login \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRET
This opens a browser for Whoop authorization. Log in and approve access. Tokens are stored in ~/.clawdbot/whoop-tokens.json and auto-refresh.
Check status: python3 scripts/whoop_auth.py status
Use scripts/whoop_data.py to get JSON data:
# Sleep (last 7 days default)
python3 scripts/whoop_data.py sleep --days 14
# Recovery scores
python3 scripts/whoop_data.py recovery --days 30
# Strain/cycles
python3 scripts/whoop_data.py cycles --days 7
# Workouts
python3 scripts/whoop_data.py workouts --days 30
# Combined summary with averages
python3 scripts/whoop_data.py summary --days 7
# Custom date range
python3 scripts/whoop_data.py sleep --start 2026-01-01 --end 2026-01-15
# User profile / body measurements
python3 scripts/whoop_data.py profile
python3 scripts/whoop_data.py body
Output is JSON to stdout. Parse it to answer user questions.
Use scripts/whoop_chart.py for interactive HTML visualizations:
# Sleep analysis (performance + stages)
python3 scripts/whoop_chart.py sleep --days 30
# Recovery bars (color-coded green/yellow/red)
python3 scripts/whoop_chart.py recovery --days 30
# Strain & calories trend
python3 scripts/whoop_chart.py strain --days 90
# HRV & resting heart rate trend
python3 scripts/whoop_chart.py hrv --days 90
# Full dashboard (all 4 charts)
python3 scripts/whoop_chart.py dashboard --days 30
# Save to specific file
python3 scripts/whoop_chart.py dashboard --days 90 --output ~/Desktop/whoop.html
Charts open automatically in the default browser. They use Chart.js with dark theme, stat cards, and tooltips.
| User asks | Action |
|---|---|
| ----------- | -------- |
| "How did I sleep?" | whoop_data.py summary --days 7, report sleep performance + hours |
| "How's my recovery?" | whoop_data.py recovery --days 7, report scores + trend |
| "Show me a chart for the last month" | whoop_chart.py dashboard --days 30 |
| "Is my HRV improving?" | whoop_data.py recovery --days 30, analyze trend |
| "How much did I train this week?" | whoop_data.py workouts --days 7, list activities |
When the user asks about their health, trends, or wants insights, use references/health_analysis.md for:
python3 scripts/whoop_data.py summary --days Nreferences/health_analysis.md for interpretation frameworkreferences/api.md — endpoint details, response schemas, paginationreferences/health_analysis.md — science-backed health data interpretation guide共 1 个版本