CLI Reference

healthsync parse

Parse an Apple Health export file into the SQLite database.

healthsync parse <file.zip|export.xml> [flags]
FlagShortDescriptionDefault
--verbose-vEnable verbose logging with progress ratefalse
--dbPath to SQLite database~/.healthsync/healthsync.db

Examples:

# Parse a zip export
healthsync parse export.zip

# Parse raw XML
healthsync parse export.xml

# Verbose mode with custom DB
healthsync parse export.zip -v --db ./test.db

Behavior:

  • Accepts .zip (auto-extracts export.xml) or raw .xml
  • Streams XML with constant memory (~10MB for 950MB files)
  • Uses INSERT OR IGNORE for deduplication — safe to re-run
  • Inserts in batches of 1000 rows per transaction

healthsync query

Query health data from the local database.

healthsync query <table> [flags]
FlagDescriptionDefault
--fromFilter records from this date (inclusive)
--toFilter records to this date (inclusive)
--limitMaximum records to return50
--formatOutput format: table, json, csvtable
--totalDeduplicated daily totals (steps, active-energy, basal-energy)false
--dbPath to SQLite database~/.healthsync/healthsync.db

Available tables:

CLI NameDB TableData
heart-rateheart_rateBPM
resting-heart-rateresting_heart_rateDaily RHR
hrvhrvHRV SDNN (ms)
heart-rate-recoveryheart_rate_recoveryPost-exercise HR recovery
respiratory-raterespiratory_rateBreaths/min
blood-pressureblood_pressureSystolic + diastolic (mmHg)
stepsstepsStep counts — --total supported
active-energyactive_energyActive kcal — --total supported
basal-energybasal_energyResting kcal — --total supported
exercise-timeexercise_timeExercise minutes
stand-timestand_timeStand minutes
flights-climbedflights_climbedFlights of stairs
distance-walking-runningdistance_walking_runningWalk/run distance
distance-cyclingdistance_cyclingCycling distance
body-massbody_massBody weight
bmibody_mass_indexBMI
heightheightHeight
walking-speedwalking_speedm/s
walking-step-lengthwalking_step_lengthm
walking-asymmetrywalking_asymmetry%
walking-double-supportwalking_double_support%
walking-steadinesswalking_steadinessScore
stair-ascent-speedstair_ascent_speedft/s
stair-descent-speedstair_descent_speedft/s
six-minute-walksix_minute_walkm
running-speedrunning_speedm/s
running-powerrunning_powerW
running-stride-lengthrunning_stride_lengthm
running-ground-contact-timerunning_ground_contact_timems
running-vertical-oscillationrunning_vertical_oscillationcm
spo2spo2Blood oxygen (0-1 fraction)
vo2maxvo2_maxVO2 Max (mL/min·kg)
sleepsleepSleep stages
workoutsworkoutsAll workout types
wrist-temperaturewrist_temperature°C deviation
time-in-daylighttime_in_daylightMinutes
dietary-waterdietary_watermL/L
physical-effortphysical_effortMET
walking-heart-ratewalking_heart_rateBPM while walking
mindful-sessionsmindful_sessionsMindfulness sessions
stand-hoursstand_hoursStand hour achievements

Examples:

# Table output (default)
healthsync query heart-rate --limit 10

# JSON output
healthsync query workouts --format json --limit 5

# CSV with date range
healthsync query steps --from 2024-01-01 --to 2024-12-31 --format csv

# No limit (return all)
healthsync query spo2 --limit 0

# Deduplicated daily step totals
healthsync query steps --total --from 2024-01-01

# Deduplicated daily active energy totals
healthsync query active-energy --total --from 2024-01-01

# Blood pressure history
healthsync query blood-pressure --from 2024-01-01 --format json

# Body weight trend
healthsync query body-mass --limit 30

healthsync server

Start an HTTP server for receiving health data uploads and serving queries.

healthsync server [flags]
FlagDescriptionDefault
--portPort to listen on8080
--hostHost to bind to0.0.0.0
--dbPath to SQLite database~/.healthsync/healthsync.db

Examples:

# Start with defaults
healthsync server

# Custom port and host
healthsync server --port 9090 --host 127.0.0.1

See the Server API page for endpoint documentation.


healthsync skills

Manage the healthsync AI agent skill — install, uninstall, or check status.

healthsync skills <subcommand> [flags]

The skill teaches AI coding agents (Claude Code, Codex CLI, OpenClaw, etc.) how to query your Apple Health data. It includes the database schema, CLI reference, and SQL query examples. Once installed, agents pick it up automatically on next session start.

healthsync skills install

healthsync skills install [--agent <target>]
FlagDescriptionDefault
--agentAgent target: claude, codex, openclaw, or allinteractive picker

Install destinations:

AgentDirectory
claude~/.claude/skills/healthsync/
codex~/.agents/skills/healthsync/
openclaw~/.openclaw/skills/healthsync/

Examples:

# Interactive picker (detects installed agents)
healthsync skills install

# Install for Claude Code specifically
healthsync skills install --agent claude

# Install for all supported agents
healthsync skills install --agent all

healthsync skills uninstall

healthsync skills uninstall [--agent <target>]

Removes the skill directory for the selected agent(s).

healthsync skills uninstall --agent claude

healthsync skills status

healthsync skills status

Shows whether the skill is installed for each supported agent, and whether the installed version matches the current binary.

healthsync skill (binary v0.5.0):
  ✓ claude       ~/.claude/skills/healthsync/ (installed v0.5.0)
  ✗ codex        ~/.agents/skills/healthsync/ (not installed)
  ✗ OpenClaw     ~/.openclaw/skills/healthsync/ (not installed)

healthsync version

Print version, commit hash, and build date.

healthsync version
healthsync v0.3.0 (commit bc829bc, built 2026-02-25T10:00:00Z)