Skip to main content 首页 创作者 thinkfleetai thinkfleet-engine healthkit-sync
healthkit-sync iOS HealthKit data sync CLI commands and patterns. Use when working with healthsync CLI, fetching Apple Health data (steps, heart rate, sleep, workouts), pairing iOS devices over local network, or understanding the iOS Health Sync project architecture including mTLS certificate pinning, Keychain storage, and audit logging.
跳到安装 Skills Marketplace 发现并探索由社区构建的 Agent Skills
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ThinkfleetAI/thinkfleet-engine --skill healthkit-sync命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
下载 Zip 下载中... name healthkit-sync description iOS HealthKit data sync CLI commands and patterns. Use when working with healthsync CLI, fetching Apple Health data (steps, heart rate, sleep, workouts), pairing iOS devices over local network, or understanding the iOS Health Sync project architecture including mTLS certificate pinning, Keychain storage, and audit logging. license Apache-2.0 compatibility macOS with healthsync CLI installed (~/.healthsync/config.json) metadata {"category":"development","platforms":"ios,macos","author":"mneves"}
HealthKit Sync CLI
Securely sync Apple HealthKit data from iPhone to Mac over local network using mTLS.
When to Use This Skill
User asks about syncing health data from iPhone
User mentions healthsync CLI commands
User wants to fetch steps, heart rate, sleep, or workout data
User needs to pair a Mac with an iOS device
User asks about the iOS Health Sync project architecture
User mentions certificate pinning or mTLS patterns
CLI Quick Reference
Pairing Flow (First Time)
healthsync discover
healthsync scan
healthsync scan --file ~/Desktop/qr.png
Fetching Health Data
healthsync status
healthsync types
healthsync fetch --start 2026-01-01T00:00:00Z --end 2026-12-31T23:59:59Z --types steps
healthsync fetch --start 2026-01-01T00:00:00Z --end 2026-12-31T23:59:59Z \
--types steps,heartRate,sleepAnalysis --format json | jq
healthsync fetch --start 2026-01-01T00:00:00Z --end 2026-12-31T23:59:59Z \
--types steps > steps.csv
Available Health Data Types Activity : steps, distanceWalkingRunning, distanceCycling, activeEnergyBurned, basalEnergyBurned, exerciseTime, standHours, flightsClimbed, workouts
Heart : heartRate, restingHeartRate, walkingHeartRateAverage, heartRateVariability
Vitals : bloodPressureSystolic, bloodPressureDiastolic, bloodOxygen, respiratoryRate, bodyTemperature, vo2Max
Sleep : sleepAnalysis, sleepInBed, sleepAsleep, sleepAwake, sleepREM, sleepCore, sleepDeep
Body : weight, height, bodyMassIndex, bodyFatPercentage, leanBodyMass
Configuration Config stored at ~/.healthsync/config.json (permissions: 0600):
{
"host" : "192.168.1.x" ,
"port" : 8443 ,
"fingerprint" : "sha256-certificate-fingerprint"
}
Token stored in macOS Keychain under service org.mvneves.healthsync.cli.
Security Architecture
Certificate Pinning The CLI validates server certificates by SHA256 fingerprint (TOFU model):
First pairing stores fingerprint from QR code
Subsequent connections verify fingerprint matches
Mismatch = connection rejected (MITM protection)
Local Network Only Host validation restricts connections to:
localhost, *.local domains
Private IPv4: 192.168.*, 10.*, 172.16-31.*
IPv6 loopback: ::1, link-local: fe80::
Keychain Storage Tokens never stored in config file - always in Keychain with:
kSecAttrAccessibleWhenUnlocked protection class
Service: org.mvneves.healthsync.cli
Account: token-{host}
Project Structure ai-health-sync-ios-thinkfleetbot/
├── iOS Health Sync App/ # Swift 6 iOS app
│ ├── Services/Security/ # CertificateService, KeychainStore, PairingService
│ ├── Services/HealthKit/ # HealthKitService, HealthSampleMapper
│ ├── Services/Network/ # NetworkServer (TLS), HTTPTypes
│ └── Services/Audit/ # AuditService (SwiftData)
└── macOS/HealthSyncCLI/ # Swift Package CLI
Troubleshooting
Ensure iOS app is running with sharing enabled
Both devices must be on same Wi-Fi network
Check firewall isn't blocking mDNS (port 5353)
Generate new QR code on iOS app (codes expire in 5 minutes)
Delete ~/.healthsync/config.json and re-pair
Server certificate may have been regenerated
iOS app server may not be running
Run healthsync status --dry-run to test without connecting
See Also