Oura Ring Skill
Query Oura Ring health data via the Oura API v2. Requires a personal access token at ~/.config/oura/credentials.json.
Setup
CODEBLOCK0
Get your token at https://cloud.ouraring.com/personal-access-tokens
Commands
All commands use: INLINECODE1
status
Connection test + personal info (age, email, biological sex).
briefing
Today's combined readiness + sleep + activity summary. Best for morning check-ins.
sleep [YYYY-MM-DD]
Detailed sleep data: duration, stages, efficiency, HRV, temperature. Defaults to last night.
readiness [YYYY-MM-DD]
Readiness score with all contributors (HRV balance, body temp, recovery, sleep, activity). Defaults to today.
activity [YYYY-MM-DD]
Activity details: steps, calories, active time, movement breakdown. Defaults to today.
heartrate [hours]
Recent heart rate statistics (min, max, avg, latest). Default: last 4 hours.
trends [days]
Multi-day trend view of readiness, sleep, and activity scores. Default: 7 days.
Health Alerts
Standalone alert checker for heartbeats/crons:
CODEBLOCK1
Outputs one line per alert. Empty output = nothing notable. Exit code 0 always.
Checks:
- - Readiness < 70
- Sleep < 6 hours
- HRV trending down 3+ days
- Resting HR spike > 5bpm above 7-day average
- Body temperature deviation > 0.5°C
- Recovery index < 30
Output Format
All output is human-readable text with emoji indicators:
- - 🟢 Good (score ≥ 85)
- 🟡 Fair (score 70–84)
- 🔴 Needs attention (score < 70)
Error Handling
- - Exit code 0: success
- Exit code 1: error (message on stderr)
- Common errors: missing credentials file, invalid token, no data for date
技能名称: oura-ring
Oura Ring 技能
通过 Oura API v2 查询 Oura Ring 健康数据。需要在 ~/.config/oura/credentials.json 中配置个人访问令牌。
设置
json
// ~/.config/oura/credentials.json
{personalaccesstoken: 你的令牌, base_url: https://api.ouraring.com/v2}
在 https://cloud.ouraring.com/personal-access-tokens 获取你的令牌。
命令
所有命令使用:/opt/homebrew/bin/python3.11 <技能目录>/scripts/oura_api.py <命令> [参数]
status
连接测试 + 个人信息(年龄、邮箱、生理性别)。
briefing
今日综合准备度 + 睡眠 + 活动摘要。最适合早晨查看。
sleep [YYYY-MM-DD]
详细睡眠数据:时长、阶段、效率、心率变异性、体温。默认为昨晚。
readiness [YYYY-MM-DD]
准备度评分及所有影响因素(心率变异性平衡、体温、恢复、睡眠、活动)。默认为今天。
activity [YYYY-MM-DD]
活动详情:步数、卡路里、活跃时间、运动分解。默认为今天。
heartrate [小时数]
近期心率统计(最低、最高、平均、最新)。默认:最近4小时。
trends [天数]
多日趋势视图,展示准备度、睡眠和活动评分。默认:7天。
健康警报
用于心跳/定时任务的独立警报检查器:
/opt/homebrew/bin/python3.11 <技能目录>/scripts/health_alerts.py
每条警报输出一行。无输出 = 无异常。始终返回退出码0。
检查项:
- - 准备度 < 70
- 睡眠 < 6小时
- 心率变异性连续3天以上下降趋势
- 静息心率较7天平均值飙升超过5bpm
- 体温偏差 > 0.5°C
- 恢复指数 < 30
输出格式
所有输出均为人类可读文本,并带有表情符号指示:
- - 🟢 良好(评分 ≥ 85)
- 🟡 一般(评分 70–84)
- 🔴 需要注意(评分 < 70)
错误处理
- - 退出码 0:成功
- 退出码 1:错误(信息输出到标准错误流)
- 常见错误:缺少凭证文件、无效令牌、日期无数据