HealthKit Sync CLI for Openclaw

A powerful CLI tool for securely syncing Apple HealthKit data from iOS devices to macOS via local network mTLS.

mneves75
v1.0.0
Jan 8, 2026
12
5k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install healthkit-sync

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install healthkit-sync using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is HealthKit Sync CLI?

The HealthKit Sync CLI is a specialized tool designed to bridge the gap between iOS health data and desktop analysis environments. By leveraging a secure mTLS (Mutual TLS) connection, it allows users to programmatically fetch comprehensive health metrics—including steps, heart rate, sleep analysis, and workouts—directly from an iPhone to a Mac. This Openclaw Skills integration ensures that health data remains private by restricting communication to the local network and employing certificate pinning for peer-to-peer verification.

The system utilizes a local-first architecture, ensuring that sensitive biometric data never touches the cloud. It is ideal for developers and data enthusiasts who want to own their health data and utilize it within custom workflows, research projects, or personal analytics dashboards.

HealthKit Sync CLI Use Cases

  • Automating the export of Apple Health data for personal data science and visualization projects.
  • Integrating iOS health metrics like heart rate and sleep patterns into desktop-based health dashboards.
  • Fetching specific health data types (e.g., blood oxygen, VO2 Max) in CSV or JSON formats for localized analysis.
  • Securely pairing macOS devices with iPhones using a Trust-on-First-Use (TOFU) security model for encrypted data transfer.

How HealthKit Sync CLI Works

  1. The user initiates a discovery phase where the CLI identifies the iOS device on the local network via mDNS.
  2. A secure pairing is established by scanning a QR code from the iOS app, which facilitates the exchange of mTLS fingerprints.
  3. The CLI stores the secure access token in the macOS Keychain, ensuring encrypted, persistent access without plain-text exposure.
  4. Users request specific health data types and date ranges through command-line arguments.
  5. The iOS app receives the request, fetches the data from HealthKit, and sends it back over the encrypted tunnel.
  6. The CLI receives the health samples and formats them into CSV or JSON for the user to process or pipe into other tools.

HealthKit Sync CLI Setup

To get started with this Openclaw Skills resource, ensure the healthsync CLI is installed and the iOS Health Sync app is active on your iPhone.

# 1. Discover the iOS device on your network
healthsync discover

# 2. Pair the device (ensure QR is in clipboard or specify a file)
healthsync scan

# 3. Verify the connection status
healthsync status

Configuration settings are stored at ~/.healthsync/config.json with a permission level of 0600 for security.

HealthKit Sync CLI Data Schema & Taxonomy

The skill organizes health data into several logical domains. Data can be exported as CSV (default) or JSON.

Category Metric Types
Activity steps, distanceWalkingRunning, activeEnergyBurned, workouts
Heart heartRate, restingHeartRate, HRV, walkingHeartRateAverage
Vitals bloodPressure, bloodOxygen, respiratoryRate, bodyTemperature
Sleep sleepAnalysis, sleepREM, sleepCore, sleepDeep
Body weight, height, bodyMassIndex, bodyFatPercentage

All data includes ISO 8601 timestamps and unit-specific values for precise tracking.

HealthKit Sync CLI Advanced Features

  • mTLS certificate pinning (TOFU model) to prevent Man-in-the-Middle (MITM) attacks.
  • Keychain integration utilizing kSecAttrAccessibleWhenUnlocked for industry-standard token protection.
  • Local-only network restriction, forcing traffic through private IPv4 ranges or IPv6 loopbacks.
  • Detailed audit logging using SwiftData on the iOS client to track data access history.
  • Support for universal clipboard and image-based QR scanning for seamless pairing workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*