healthkit-synciOS 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.
Install via ClawdBot CLI:
clawdbot install mneves75/healthkit-syncSecurely sync Apple HealthKit data from iPhone to Mac over local network using mTLS.
healthsync CLI commands# 1. Discover devices on local network
healthsync discover
# 2. On iOS app: tap "Share" to generate QR code, then "Copy"
# 3. Scan QR from clipboard (Universal Clipboard)
healthsync scan
# Alternative: scan from image file
healthsync scan --file ~/Desktop/qr.png
# Check connection status
healthsync status
# List enabled data types
healthsync types
# Fetch data as CSV (default)
healthsync fetch --start 2026-01-01T00:00:00Z --end 2026-12-31T23:59:59Z --types steps
# Fetch multiple types as JSON
healthsync fetch --start 2026-01-01T00:00:00Z --end 2026-12-31T23:59:59Z \
--types steps,heartRate,sleepAnalysis --format json | jq
# Pipe to file
healthsync fetch --start 2026-01-01T00:00:00Z --end 2026-12-31T23:59:59Z \
--types steps > steps.csv
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
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.
The CLI validates server certificates by SHA256 fingerprint (TOFU model):
Host validation restricts connections to:
localhost, *.local domains192.168., 10., 172.16-31.*::1, link-local: fe80::Tokens never stored in config file - always in Keychain with:
kSecAttrAccessibleWhenUnlocked protection classorg.mvneves.healthsync.clitoken-{host}ai-health-sync-ios-clawdbot/
āāā 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
"No devices found":
"Pairing code expired":
"Certificate mismatch":
~/.healthsync/config.json and re-pair"Connection refused":
healthsync status --dry-run to test without connectingGenerated Mar 1, 2026
Individuals can securely sync Apple Health data from their iPhone to a Mac for detailed analysis, such as tracking steps, heart rate, and sleep patterns over time. This enables users to create custom reports or visualizations to monitor fitness progress and health trends, leveraging local network syncing for privacy.
Researchers can use this skill to collect anonymized health data from participants' iPhones in studies, syncing metrics like heart rate variability or sleep analysis to a central Mac for analysis. The mTLS security ensures data integrity and confidentiality, suitable for small-scale trials or pilot projects.
Companies can implement this tool to allow employees to voluntarily sync health data from their iPhones to a secure Mac, aggregating metrics like steps or active energy for wellness challenges. The local-only network and certificate pinning provide robust security, minimizing data exposure risks.
App developers can use the healthsync CLI to test integration with Apple HealthKit by fetching sample data like workouts or blood oxygen levels from an iPhone simulator or device. This aids in debugging and validating data flows in health-focused iOS or macOS applications.
Healthcare providers can offer patients a way to back up their Apple Health data locally to a Mac during telehealth consultations, ensuring access to historical health records like weight or blood pressure. The secure syncing protects sensitive information while enabling offline data storage.
Offer the basic healthsync CLI for free, with advanced features like automated data fetching, extended audit logging, or cloud integration available via a subscription. Revenue is generated from monthly or annual licenses for power users or small businesses.
Sell customized versions of the skill with enhanced security compliance, support for HIPAA regulations, and dedicated technical support to hospitals or clinics. Revenue comes from one-time licensing fees or annual maintenance contracts tailored to organizational needs.
Provide consulting and development services to help other companies integrate the healthsync CLI into their health or fitness applications, offering customization, training, and ongoing support. Revenue is generated through project-based fees or retainer agreements.
š¬ Integration Tip
Ensure the healthsync CLI is installed and configured with proper permissions, and verify both devices are on the same local network for secure pairing and data syncing.
Plan, focus, and complete work with energy management, time blocking, and context-specific productivity systems.
Build habits with streaks, reminders, and progress visualization
Comprehensive AI-assisted therapeutic support framework with CBT, ACT, DBT, MI, session notes CLI, and crisis protocols.
Retrieve and summarize health, sleep, activity, readiness, and biometric data from the Oura Ring API via a command-line interface.
Load and analyze Strava activities, stats, and workouts using the Strava API
Talk to your Garmin data naturally - "what was my fastest speed snowboarding?", "how did I sleep last night?", "what was my heart rate at 3pm?". Access 20+ metrics (sleep stages, Body Battery, HRV, VO2 max, training readiness, body composition, SPO2), download FIT/GPX files for route analysis, query elevation/pace at any point, and generate interactive health dashboards. From casual "show me this week's workouts" to deep "analyze my recovery vs training load".