返回顶部
h

healthsync健康同步

Queries Apple Health data stored in a local SQLite database. Use this skill to read heart rate, steps, SpO2, VO2 Max, sleep, workouts, resting heart rate, HRV, blood pressure, active/basal energy, body metrics, mobility, running metrics, mindful sessions, wrist temperature, and more. Can query via the healthsync CLI or directly via SQLite. Read-only — never write to the database.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
406
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

healthsync

healthsync — Apple健康数据查询技能

安装healthsync

bash

macOS和Linux(推荐)


curl -fsSL https://healthsync.sidv.dev/install | bash

或通过Go安装

go install github.com/BRO3886/healthsync@latest

安装二进制文件后,解析您的Apple健康数据导出文件:

bash

从健康App导出 → 个人资料图片 → 导出所有健康数据


healthsync parse ~/Downloads/export.zip

将此技能安装到您的代理中:

bash

Claude Code或Codex


healthsync skills install

OpenClaw

healthsync skills install --agent openclaw

查询存储在本地SQLite数据库中的Apple健康数据导出。此技能为只读——绝不执行INSERT、UPDATE、DELETE或DROP操作。

重要约束

  • - 只读——您绝不能写入数据库。不得执行INSERT、UPDATE、DELETE、DROP、ALTER或任何写入操作。
  • 两种查询方式:CLI(healthsync query)或直接SQLite(sqlite3 ~/.healthsync/healthsync.db)
  • 简单查询优先使用CLI。复杂聚合、连接或自定义SQL请使用直接SQLite。

数据库位置

默认路径:~/.healthsync/healthsync.db

快速入门

bash

最近心率读数


healthsync query heart-rate --limit 10

指定日期范围内的步数

healthsync query steps --from 2024-01-01 --to 2024-06-30 --limit 100

去重后的每日步数总计

healthsync query steps --total --from 2024-01-01

去重后的每日活动能量总计

healthsync query active-energy --total --from 2024-01-01

以JSON格式查看锻炼数据

healthsync query workouts --format json --limit 20

以CSV格式查看睡眠数据

healthsync query sleep --format csv --limit 50

静息心率趋势

healthsync query resting-heart-rate --limit 30

HRV读数

healthsync query hrv --limit 30

血压数据

healthsync query blood-pressure --limit 20

体重趋势

healthsync query body-mass --limit 30

直接使用SQLite进行聚合查询

sqlite3 ~/.healthsync/healthsync.db SELECT date(startdate) as day, SUM(value) as totalsteps FROM steps GROUP BY day ORDER BY day DESC LIMIT 7

每周平均静息心率

sqlite3 ~/.healthsync/healthsync.db SELECT strftime(%Y-W%W, startdate) as week, ROUND(AVG(value),1) as avgrhr FROM restingheartrate GROUP BY week ORDER BY week DESC LIMIT 12

CLI参考

healthsync query
标志描述默认值
--from从该日期开始筛选记录(包含)
--to
筛选记录至该日期(包含) | — | | --limit | 返回的最大记录数 | 50 | | --format | 输出格式:table、json、csv | table | | --total | 去重后的每日总计(仅限步数、活动能量、基础能量) | false | | --db | 覆盖数据库路径 | ~/.healthsync/healthsync.db |

可用数据表

心脏相关

CLI名称数据库表说明
heart-rateheartrate每分钟心跳数;高频数据
resting-heart-rate
restingheart_rate | 每日静息心率 |
| hrv | hrv | HRV SDNN(毫秒);夜间数据 |
| heart-rate-recovery | heartraterecovery | 运动后心率恢复 |
| respiratory-rate | respiratory_rate | 每分钟呼吸次数 |
| blood-pressure | blood_pressure | 成对收缩压+舒张压(mmHg) |

活动/能量

CLI名称数据库表说明
stepssteps支持--total
active-energy
active_energy | 千卡;支持--total |
| basal-energy | basal_energy | 千卡;支持--total |
| exercise-time | exercise_time | 分钟 |
| stand-time | stand_time | 分钟 |
| flights-climbed | flights_climbed | 次数 |
| distance-walking-running | distancewalkingrunning | 公里/英里 |
| distance-cycling | distance_cycling | 公里/英里 |

身体数据

CLI名称数据库表说明
body-massbodymass公斤/磅
bmi
bodymass_index | |
| height | height | 米/英尺 |

活动能力/步行

CLI名称数据库表说明
walking-speedwalkingspeed米/秒
walking-step-length
walkingstep_length | 米 |
| walking-asymmetry | walking_asymmetry | 百分比 |
| walking-double-support | walkingdoublesupport | 百分比 |
| walking-steadiness | walking_steadiness | 评分 |
| stair-ascent-speed | stairascentspeed | 英尺/秒 |
| stair-descent-speed | stairdescentspeed | 英尺/秒 |
| six-minute-walk | sixminutewalk | 米 |

跑步

CLI名称数据库表说明
running-speedrunningspeed米/秒
running-power
runningpower | 瓦特 |
| running-stride-length | runningstridelength | 米 |
| running-ground-contact-time | runninggroundcontact_time | 毫秒 |
| running-vertical-oscillation | runningverticaloscillation | 厘米 |

其他

CLI名称数据库表说明
spo2spo20-1小数(0.98 = 98%)
vo2max
vo2_max | 毫升/分钟·公斤 |
| sleep | sleep | 睡眠阶段(类别,无单位) |
| workouts | workouts | 时长、距离、能量 |
| wrist-temperature | wrist_temperature | 摄氏度偏差 |
| time-in-daylight | timeindaylight | 分钟 |
| dietary-water | dietary_water | 毫升/升 |
| physical-effort | physical_effort | MET评分 |
| walking-heart-rate | walkingheartrate | 步行时每分钟心跳数 |
| mindful-sessions | mindful_sessions | 类别;无单位列 |
| stand-hours | stand_hours | 类别;无单位列 |

healthsync parse

将Apple健康数据导出解析到数据库中。(仅供参考——除非用户要求,否则不要运行。)

标志描述默认值
-v详细日志记录,显示进度速率false
--db
覆盖数据库路径 | ~/.healthsync/healthsync.db |

healthsync server

启动HTTP服务器以接收上传文件。(仅供参考——除非用户要求,否则不要启动。)

端点:

  • - POST /api/upload — 上传.zip或.xml文件(多部分表单,字段名:file)。返回202,异步解析。
  • GET /api/upload/status — 轮询解析进度。
  • GET /api/health/{table}?from=&to=&limit= — 以JSON格式查询数据。

数据库模式

标准数量表

模式:id, sourcename, startdate, enddate, value REAL, unit TEXT, createdat

适用于除bloodpressure、sleep、mindfulsessions、stand_hours和workouts之外的所有表。

sql
CREATE TABLE restingheartrate (
id INTEGER PRIMARY KEY AUTOINCREMENT,
source_name TEXT

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 healthsync-1776289835 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 healthsync-1776289835 技能

通过命令行安装

skillhub install healthsync-1776289835

下载

⬇ 下载 healthsync v1.0.0(免费)

文件大小: 5.98 KB | 发布时间: 2026-4-16 17:45

v1.0.0 最新 2026-4-16 17:45
healthsync 1.0.0 — Initial Release

- Query Apple Health data from a local SQLite database using the healthsync CLI or direct SQLite.
- Supports read-only access to heart rate, steps, SpO2, VO2 Max, sleep, workouts, energy, body metrics, mobility, running metrics, mindful sessions, wrist temperature, and more.
- CLI offers easy commands for filtering, date ranges, and multiple formats (table, JSON, CSV).
- Database schema and all available tables and data types documented in detail.
- Strictly enforces read-only access; no write, update, or delete operations allowed.
- Installation and quick start instructions included for users on macOS and Linux.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部