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.
- License 许可
- Apache-2.0
- 最近更新
- 2026-03-07
- Stars
- ★ 674
- Forks
- 102
01 前言 Front Matter
- name
- healthkit-sync
- license
- Apache-2.0
- metadata
- { "author": "mneves", "category": "development", "platforms": "ios,macos" }
- 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.
- compatibility
- macOS with healthsync CLI installed (~/.healthsync/config.json)
02 资源文件 23
- 资产文件assets/project_manifest_template.json723 B
- 资产文件assets/python_compatibility_r2026a.json786 B
- 资产文件assets/reproducibility_manifest_template.json787 B
- 参考文档references/ARCHITECTURE.md6.3 KB
- 参考文档references/CLI-REFERENCE.md3.9 KB
- 参考文档references/data-import-export.md9.5 KB
- 参考文档references/executing-scripts.md10.2 KB
- 参考文档references/graphics-visualization.md7.3 KB
- 参考文档references/mathematics.md8.4 KB
- 参考文档references/matrices-arrays.md8.3 KB
- 参考文档references/octave-compatibility.md8.3 KB
- 参考文档references/programming.md10.6 KB
- 参考文档references/python-integration.md10.7 KB
- 参考文档references/SECURITY.md4.8 KB
- 脚本scripts/_common.py8.6 KB
- 脚本scripts/generate_function_scaffold.py4.8 KB
- 脚本scripts/inventory_mat_file.py12.2 KB
- 脚本scripts/plan_batch_command.py9.6 KB
- 脚本scripts/plan_python_compatibility.py6.4 KB
- 脚本scripts/reproducibility_report.py7.8 KB
- 脚本scripts/scan_m_code.py13.6 KB
- 脚本scripts/validate_project_manifest.py12.0 KB
- 参考文档TESTING.md5.7 KB
03 SKILL.md 正文
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
healthsyncCLI 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)
# 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
Fetching Health Data
# 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
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,*.localdomains- 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:
kSecAttrAccessibleWhenUnlockedprotection class- Service:
org.mvneves.healthsync.cli - Account:
token-{host}
Project Structure
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
Troubleshooting
"No devices found":
- 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)
"Pairing code expired":
- Generate new QR code on iOS app (codes expire in 5 minutes)
"Certificate mismatch":
- Delete
~/.healthsync/config.jsonand re-pair - Server certificate may have been regenerated
"Connection refused":
- iOS app server may not be running
- Run
healthsync status --dry-runto test without connecting
See Also
- CLI Reference - Detailed command documentation
- Security Patterns - mTLS and certificate pinning patterns
- Architecture - iOS app architecture details
04 同仓库更多 Skills
x-trends
Fetches current top trending topics on X (Twitter) for any country using public aggregators.
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
topydo
Manage todo.txt tasks using topydo CLI. Add, list, complete, prioritize, tag, and organize tasks with dependencies, due dates, recurrence, and projects. Use for any task management, todo lists, or when the user mentions tasks, todos, or todo.txt. Requires Python 3 and pip. Works on macOS, Linux, and Windows.
openclaw-feeds
RSS news aggregator. Fetches headlines from curated feeds across three categories: news, games, and finance. Use when the user asks about current news, headlines, what's happening, what's going on, or says "what's up in news", "what's up in finance", "what's up in games", or the German equivalents "was geht mit nachrichten", "was geht mit money", "was geht mit gaming". Also activates for requests like "give me a news rundown", "latest headlines", "market news", "gaming news", "tech news", "finance roundup", or "briefing". Returns structured JSON from public RSS feeds — no API keys, no web search needed.
octolens
Query and analyze brand mentions from Octolens API. Use when the user wants to fetch mentions, track keywords, filter by source platforms (Twitter, Reddit, GitHub, LinkedIn, etc.), sentiment analysis, or analyze social media engagement. Supports complex filtering with AND/OR logic, date ranges, follower counts, and bookmarks.
lmstudio-subagents
Reduces token usage from paid providers by offloading work to local LM Studio models. Use when: (1) Cutting costs—use local models for summarization, extraction, classification, rewriting, first-pass review, brainstorming when quality suffices, (2) Avoiding paid API calls for high-volume or repetitive tasks, (3) No extra model configuration—JIT loading and REST API work with existing LM Studio setup, (4) Local-only or privacy-sensitive work. Requires LM Studio 0.4+ with server (default :1234). No CLI required.