--- name: healthmd-cli description: Safely install and use the Health.md CLI and MCP server to query user-authorized health data, chart typed metrics, inspect sleep and workouts, export scoped Apple Health or Health Connect data, and recover durable jobs on macOS, Linux, or Windows. Use for consumer workflows, not Health.md development. compatibility: Requires matching `healthmd` and `healthmd-mcp` binaries plus an explicitly compatible Health.md mobile build. Direct typed queries and canonical extraction currently require iPhone; Android supports provider-native raw and generated-file exports. Live work requires Direct CLI Access and the selected phone to be available. --- # Health.md CLI Use the standalone `healthmd` command. Health.md for Mac is not required. ```text agent/user → healthmd on macOS, Linux, or Windows ← authenticated encrypted Manual IP or Tailscale connection → foreground Health.md mobile app → HealthKit or Health Connect → bounded typed results, canonical data, or generated files ``` The CLI listens on the computer; the phone connects to the displayed address. It cannot wake a phone, bypass app activity, permissions, protected-data controls, quotas, or OS background limits. Direct is the portable default. Do not add `--backend mac-app` or `--transport nearby`. ## Authorization and privacy first Treat the user's request as authority only for its stated device, operation, metrics/categories, dates, sources, detail, destination, and disclosure level. Ask before widening any of them. - Default to the smallest useful date and metric scope. - Get explicit approval before pairing, returning health values in chat, using `--all`, requesting lossless records, enabling `--allow-partial`, writing generated files, changing trust, or deleting state. - Use a user-approved private absolute path outside a repository for health artifacts. Do not assume a synced or shared folder is private. - Pairing QR images and fallback codes contain short-lived secrets. Render them only to the user; never transcribe, reconstruct, upload, or log them. - Local stdio means Health.md itself needs no health-data cloud. It does **not** guarantee local model inference: the MCP host or model provider may process returned values under its own policies. - Do not diagnose, recommend treatment, infer causation, or label a result healthy, harmful, better, or worse. Preserve exact metric IDs, statistics, units, dates/timezone, source, coverage, missingness, evidence, and limitations. - Never merge HealthKit HRV SDNN with Health Connect or WHOOP HRV RMSSD. ## Verify release compatibility The `0.1.0-alpha.3` package is an explicitly unqualified public preview. No public CLI/mobile pair is physically qualified yet. Its source snapshot contains these exact counterparts: | Mobile source | Protocol | Exact counterpart in the release snapshot | Portable operations | |---|---|---|---| | iPhone exports | v1 | iOS 3.2.1 (build 202608300209) | status, raw, extract, files, resume, cancel | | iPhone typed queries | v1 + query v3 | iOS 3.2.1 (build 202608300209) | the export operations plus fixed typed query tools | | Android exports | v2 | Android 1.8.1 (`versionCode 30`) | status, provider-native raw, files, resume, cancel | | Android typed queries | unavailable | not implemented | do not claim support | The unqualified protocol floors remain iOS 3.0.3 and Android 1.5.4 (`versionCode 25`), but protocol implementation is not release qualification. Check the exact package and mobile build before live work. Do not claim App Store or Play Store compatibility from a marketing version alone. Authoritative ledger: ## Install or verify ```bash healthmd --version healthmd --help ``` On macOS or Linux, install the matching preview binaries together: ```bash brew install CodyBontecou/tap/healthmd ``` For Windows or direct archive installation, use the exact `healthmd-cli/v` GitHub Release—not repository `/releases/latest`—and follow that release's checksum, Sigstore, and publisher-verification instructions. Do not mix `healthmd` and `healthmd-mcp` versions. Authorized preview testers may build the exact tag from source: ```bash git clone https://github.com/CodyBontecou/health-md.git cd health-md git checkout healthmd-cli/v0.1.0-alpha.3 cd apps/cli cargo install --locked --path crates/healthmd-cli ``` Do not use `apps/apple/scripts/healthmd`; it runs the legacy Swift compatibility client. Linux requires an unlocked freedesktop Secret Service provider such as GNOME Keyring or KWallet. The CLI never falls back to plaintext credentials. ## Bound unfamiliar commands On macOS/Linux use non-interactive execution and a hard process timeout: ```bash NO_COLOR=1 TERM=dumb timeout 15 healthmd --version