healthsync — Apple Health Data Query Skill
Installing healthsync
CODEBLOCK0
After installing the binary, parse your Apple Health export:
CODEBLOCK1
Install this skill into your agent:
CODEBLOCK2
Query Apple Health export data stored in a local SQLite database. This skill is read-only — never INSERT, UPDATE, DELETE, or DROP anything.
Important Constraints
- READ ONLY — You must NEVER write to the database. No INSERT, UPDATE, DELETE, DROP, ALTER, or any write operations. Two query methods : CLI (healthsync query) or direct SQLite (sqlite3 ~/.healthsync/healthsync.db)Prefer CLI for simple queries. Use direct SQLite for complex aggregations, joins, or custom SQL.
Database Location
Default: INLINECODE2
Quick Start
CODEBLOCK3
CLI Reference
healthsync query <table>
Flag Description Default INLINECODE4 Filter records from this date (inclusive) — INLINECODE5
Filter records to this date (inclusive) | — |
|
--limit | Maximum records to return | 50 |
|
--format | Output format:
table,
json,
csv | table |
|
--total | Deduplicated daily totals (steps, active-energy, basal-energy only) | false |
|
--db | Override database path |
~/.healthsync/healthsync.db |
Available Tables
Cardiac
CLI Name DB Table Notes INLINECODE14 INLINECODE15 BPM; high-frequency INLINECODE16
resting_heart_rate | Daily RHR |
|
hrv |
hrv | HRV SDNN (ms); nightly |
|
heart-rate-recovery |
heart_rate_recovery | Post-exercise HR recovery |
|
respiratory-rate |
respiratory_rate | Breaths/min |
|
blood-pressure |
blood_pressure | Paired systolic + diastolic (mmHg) |
Activity / Energy
CLI Name DB Table Notes INLINECODE26 INLINECODE27 Supports INLINECODE28 INLINECODE29
active_energy | kcal; supports
--total |
|
basal-energy |
basal_energy | kcal; supports
--total |
|
exercise-time |
exercise_time | Minutes |
|
stand-time |
stand_time | Minutes |
|
flights-climbed |
flights_climbed | Count |
|
distance-walking-running |
distance_walking_running | km/mi |
|
distance-cycling |
distance_cycling | km/mi |
Body
CLI Name DB Table Notes INLINECODE45 INLINECODE46 kg/lb INLINECODE47
body_mass_index | |
|
height |
height | m/ft |
Mobility / Walking
CLI Name DB Table Notes INLINECODE51 INLINECODE52 m/s INLINECODE53
walking_step_length | m |
|
walking-asymmetry |
walking_asymmetry | % |
|
walking-double-support |
walking_double_support | % |
|
walking-steadiness |
walking_steadiness | Score |
|
stair-ascent-speed |
stair_ascent_speed | ft/s |
|
stair-descent-speed |
stair_descent_speed | ft/s |
|
six-minute-walk |
six_minute_walk | m |
Running
CLI Name DB Table Notes INLINECODE67 INLINECODE68 m/s INLINECODE69
running_power | W |
|
running-stride-length |
running_stride_length | m |
|
running-ground-contact-time |
running_ground_contact_time | ms |
|
running-vertical-oscillation |
running_vertical_oscillation | cm |
Other
CLI Name DB Table Notes INLINECODE77 INLINECODE78 0-1 fraction (0.98 = 98%) INLINECODE79
vo2_max | mL/min·kg |
|
sleep |
sleep | Sleep stages (category, no unit) |
|
workouts |
workouts | duration, distance, energy |
|
wrist-temperature |
wrist_temperature | °C deviation |
|
time-in-daylight |
time_in_daylight | Minutes |
|
dietary-water |
dietary_water | mL/L |
|
physical-effort |
physical_effort | MET score |
|
walking-heart-rate |
walking_heart_rate | BPM while walking |
|
mindful-sessions |
mindful_sessions | Category; no unit column |
|
stand-hours |
stand_hours | Category; no unit column |
healthsync parse <file>
Parse an Apple Health export into the database. (Informational — do not run unless the user asks.)
Flag Description Default INLINECODE100 Verbose logging with progress rate false INLINECODE101
Override database path |
~/.healthsync/healthsync.db |
healthsync server
Start HTTP server for receiving uploads. (Informational — do not start unless the user asks.)
Endpoints:
- POST /api/upload — Upload .zip or .xml (multipart form, field: file). Returns 202, parses async. INLINECODE108 — Poll parse progress. INLINECODE109 — Query data as JSON.
Database Schema
Standard quantity tables
Schema: INLINECODE110
Applies to all tables except blood_pressure, sleep, mindful_sessions, stand_hours, and workouts.
CODEBLOCK4
blood_pressure (special — paired systolic + diastolic)
CODEBLOCK5
Category tables — no unit column
Applies to: sleep, mindful_sessions, INLINECODE118
CODEBLOCK6
workouts
CODEBLOCK7
Date Format
All dates stored as text: 2024-01-15 08:30:00 +0530. Filter with date prefix — 2024-01-01 works via SQLite string comparison.
Sleep Stage Values
Value Meaning INLINECODE121 In bed INLINECODE122
Core sleep |
|
HKCategoryValueSleepAnalysisAsleepDeep | Deep sleep |
|
HKCategoryValueSleepAnalysisAsleepREM | REM sleep |
|
HKCategoryValueSleepAnalysisAwake | Awake |
|
HKCategoryValueSleepAnalysisAsleepUnspecified | Unspecified |
Common Query Patterns
Daily step totals (deduped)
CODEBLOCK8
Daily active energy totals (deduped)
CODEBLOCK9
Average resting heart rate per week
CODEBLOCK10
HRV trend
CODEBLOCK11
Blood pressure history
CODEBLOCK12
Body weight trend
CODEBLOCK13
Sleep duration per night
CODEBLOCK14
Average heart rate per day
CODEBLOCK15
Workout summary
CODEBLOCK16
Weekly VO2 Max trend
CODEBLOCK17
Mindfulness minutes per week
CODEBLOCK18
Limitations
- Read-only — This skill must never write to the database No real-time data — Data is only as fresh as the last healthsync parse runDate filtering is string-based — Timezone offsets are part of the stored date stringSpO2 values are fractions — 0.98 means 98%, not 98Blood pressure is paired — systolic and diastolic are stored together in one row per measurementCategory tables have no unit column — sleep, mindful_sessions, stand_hours store text values, not numeric
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(start
date) as day, SUM(value) as total steps FROM steps GROUP BY day ORDER BY day DESC LIMIT 7
每周平均静息心率
sqlite3 ~/.healthsync/healthsync.db SELECT strftime(%Y-W%W, start
date) as week, ROUND(AVG(value),1) as avg rhr FROM resting
heart rate 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-rate heartrate 每分钟心跳数;高频数据 resting-heart-rate
restingheart_rate | 每日静息心率 |
| hrv | hrv | HRV SDNN(毫秒);夜间数据 |
| heart-rate-recovery | heartrate recovery | 运动后心率恢复 |
| respiratory-rate | respiratory_rate | 每分钟呼吸次数 |
| blood-pressure | blood_pressure | 成对收缩压+舒张压(mmHg) |
活动/能量
CLI名称 数据库表 说明 steps steps 支持--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 | distancewalking running | 公里/英里 |
| distance-cycling | distance_cycling | 公里/英里 |
身体数据
CLI名称 数据库表 说明 body-mass bodymass 公斤/磅 bmi
bodymass_index | |
| height | height | 米/英尺 |
活动能力/步行
CLI名称 数据库表 说明 walking-speed walkingspeed 米/秒 walking-step-length
walkingstep_length | 米 |
| walking-asymmetry | walking_asymmetry | 百分比 |
| walking-double-support | walkingdouble support | 百分比 |
| walking-steadiness | walking_steadiness | 评分 |
| stair-ascent-speed | stairascent speed | 英尺/秒 |
| stair-descent-speed | stairdescent speed | 英尺/秒 |
| six-minute-walk | sixminute walk | 米 |
跑步
CLI名称 数据库表 说明 running-speed runningspeed 米/秒 running-power
runningpower | 瓦特 |
| running-stride-length | runningstride length | 米 |
| running-ground-contact-time | runningground contact_time | 毫秒 |
| running-vertical-oscillation | runningvertical oscillation | 厘米 |
其他
CLI名称 数据库表 说明 spo2 spo2 0-1小数(0.98 = 98%) vo2max
vo2_max | 毫升/分钟·公斤 |
| sleep | sleep | 睡眠阶段(类别,无单位) |
| workouts | workouts | 时长、距离、能量 |
| wrist-temperature | wrist_temperature | 摄氏度偏差 |
| time-in-daylight | timein daylight | 分钟 |
| dietary-water | dietary_water | 毫升/升 |
| physical-effort | physical_effort | MET评分 |
| walking-heart-rate | walkingheart rate | 步行时每分钟心跳数 |
| 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, start date, enddate, value REAL, unit TEXT, created at
适用于除bloodpressure、sleep、mindful sessions、stand_hours和workouts之外的所有表。
sql
CREATE TABLE restingheart rate (
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
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.