codybontecou/health-md/v2
Claude Code and agent skill by codybontecou/health-md
- community
Checking that the SKILL.md file is still in the repository.
Install and operate the standalone Health.md CLI and portable healthmd-mcp server on macOS, Linux, or Windows. Use when a user wants to pair an iPhone, configure Codex/Claude MCP, check direct readiness, query or chart typed health data, export Apple Health data, extract canonical JSON, manage durable jobs, automate safe runs, or troubleshoot machine-readable errors. This skill is for users, not Health.md developers.
Install
npx vskill@latest install codybontecou/health-md/v2SKILL.md
Health.md CLI User Guide
The standalone CLI connects directly to iPhone. The Health.md macOS app is not required.
The CLI listens on the computer; iPhone connects to the address entered in Direct CLI Access. HealthKit reads always happen on iPhone. The CLI cannot wake iOS reliably or bypass app activity, protected-data, permission, local-network, or quota controls.
Direct is the portable default. Do not add --backend mac-app: that adapter is reserved but unimplemented. The portable client supports Manual IP, including Tailscale addresses. Nearby is unsupported.
No public CLI/mobile pair is qualified yet. The source snapshot tagged for the 0.1.0-alpha.2 preview contains iOS 3.2.1 (build 202608300209) and Android 1.8.1 (versionCode 30) as its exact mobile counterparts. The unqualified compatibility floors remain iOS 3.0.3 for v1 exports and v3 typed queries and Android 1.5.4 (versionCode 25) for v2 exports. Android typed queries are not implemented. Treat protocol implementation and those floors as distinct from release qualification; do not claim store-build compatibility until the checked-in ledger names an exact tested pair.
Bounded commands
On macOS/Linux, run the unfamiliar CLI non-interactively:
On Windows, use the automation host's process timeout. Pairing needs enough time for the user to scan the QR with Health.md's in-app Direct CLI scanner or enter the fallback code on iPhone.
Install or verify
The checksummed 0.1.0-alpha.2 public preview is available from the project Homebrew/Linuxbrew tap. It remains an explicitly unqualified preview: publishing the CLI does not qualify a portable CLI/mobile pair, and users must use the exact matching mobile build named by release evidence.
The formula installs healthmd and the matching healthmd-mcp compatibility launcher together. Do not mix versions. Authorized preview testers who cannot use Homebrew may build the exact release tag from source:
Do not install the old helper from the Mac app or use the monorepo's apps/apple/scripts/healthmd wrapper for portable operation; those target the 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.
Pair once
While it waits:
- In foreground Health.md, open Sync → Direct CLI Access, tap Scan Pairing QR, and scan the displayed image. That in-app scan starts pairing automatically; do not ask for a second Pair tap or open the QR as a custom URL.
- Keep Health.md foregrounded until stdout returns
healthmd.direct_pairing_resultwithstatus: successfor the intended iPhone. - If in-app scanning is unavailable, open Sync → Direct CLI Access, enable Manual IP, and enter the printed LAN/Tailscale address, port, and six-digit code.
The default port is 17647. If another port is saved on iPhone, pass it globally on every network command:
Pairing is one-time. Leave Direct CLI Access enabled and Health.md open for later commands. Use --device DEVICE_UUID when multiple iPhones are trusted.
Local trust commands do not contact iPhone:
Use healthmd direct reset-trust --confirm only to recover unusable local trust. It removes every local pairing; forget the paired CLI on each iPhone too.
Check readiness
Read the JSON:
backend == "direct"andmac_app == "bypassed": standalone path is active.iphone.connected == true: the intended iPhone authenticated.iphone.app_active == true: new work can begin.iphone.protected_data_available == true: protected export data is accessible.iphone.can_trigger_raw_exports == true: raw and extract are ready.iphone.can_trigger_exports == true: generated files are ready.iphone.active_job_id: another job may already own the service.direct_cli.paired == true: direct trust exists.
The direct status destination is intentionally unselected. File mode uses the explicit --destination; it never uses a Mac app bookmark.
Strict raw export
Choose exactly one range: --yesterday, --last N, --from/--to, or --all.
Without --output, validated health JSON streams to stdout. Prefer a protected output file. Strict raw returns healthmd.raw_result v1 with public schema-v7 healthmd.health_data documents and temporarily requests lossless records without changing saved iPhone settings.
Complete-empty is success. Missing, failed, cancelled, unsupported, skipped, or partial capture yields partial_success and a nonzero exit unless --allow-partial is explicit. That flag changes only exit status; diagnostics remain.
Canonical extraction
Use extract for selected health objects:
Extraction requires --metric, --category, a category-implying --object, or --all-metrics. Repeatable --object and --field /JSON/POINTER narrow output. Summary is default; archive/record selectors imply lossless. The canonical source is currently apple_health only.
JSON returns canonical documents or honest projections plus a receipt. JSONL writes its receipt to stderr, or OUTPUT.receipt.json with --output. Never interpret omitted fields as zero. Incomplete extraction emits no retained data unless --allow-partial is explicit.
Production-generated files
On macOS, Linux, or Windows, use an existing absolute non-symlink destination:
The iPhone uses production JSON/CSV/Markdown/ZIP/data-dictionary/roll-up/individual-record/Daily Note/provider exporters. The CLI validates manifests, digests, paths, symlinks, destination identity, and restart-safe overwrite/append/Markdown merge commits.
Default requested-date jobs keep saved formats, subfolder, templates, filenames, write mode, and Daily Note behavior while suppressing roll-ups and summary-only mode. Metric/category/detail selectors replace only that job's acquisition scope. --use-iphone-settings mirrors all saved behavior and cannot combine with selectors.
--profile PROFILE_ID runs a saved iPhone export profile by its stable UUID: the profile's frozen settings and destination replace both live settings and per-job selectors. It cannot combine with --use-iphone-settings or metric/category selectors; an unknown UUID fails with a typed profile_not_found error and never falls back to live settings. Read the UUID from the app's Export tab profile picker (healthmd profiles list is planned, not shipped):
The equivalent MCP generated-file export arguments are settings_policy: "profile" plus profile_reference: { "profileID": UUID } under the same scope-exclusivity rules.
Protocol v1 treats the destination as an opaque immutable label on iPhone. The receiving host validates and durably binds the native absolute path before sending the request.
Codex and Claude MCP
For Codex, run healthmd setup codex. It safely preserves unrelated Codex settings, configures the absolute healthmd executable with arguments mcp serve, applies approval prompts to export mutations, and opens iPhone pairing when needed. Pairing and MCP deliberately use the same installed executable identity so native credentials never require a second Keychain ACL. healthmd-mcp remains a compatibility launcher that delegates to the sibling healthmd. Do not run MCP serve mode as an interactive shell command.
The complete server exposes 19 fixed tools for local pairing, direct readiness, Apple metric catalog, bounded typed queries, charts, sleep, workouts, comparison, coverage, evidence, and durable generated-file exports. Every query runs against the paired foreground iPhone; Health.md for Mac is not involved. Export, resume, and cancel calls require explicit user approval and an export needs an existing destination.
For a local host that should receive no pairing or filesystem-export authority, pair first with healthmd direct pair, then configure its absolute healthmd executable with arguments mcp serve-read-only. This cloud-free stdio entry exposes only the 13 readiness/query tools, omits the pairing resource, and rejects guessed pairing/export-job calls. Keep using healthmd mcp serve when in-host QR pairing or generated-file export tools are intentionally required.
MCP Apps hosts negotiate io.modelcontextprotocol/ui and text/html;profile=mcp-app for self-contained query views and the local-only inline pairing QR card. Text/image hosts retain authoritative JSON and native PNG fallbacks; they may place pairing images inside a collapsible tool result. Call healthmd_doctor first. Use all_pages: true for bounded automatic cursor traversal, or continue opaque cursors manually.
Use the fixed typed operation directly for analysis: healthmd_sleep_sessions for sleep, healthmd_workouts for workouts, and healthmd_metric_chart for metric series. tools/list supplies complete nested selectors and examples. The shell can run the identical operation as healthmd query TOOL_NAME --arguments 'JSON_OBJECT'; its canonical payload matches MCP before the MCP content envelope is added. Never substitute healthmd extract, which returns a different canonical source-data projection. healthmd mcp schema TOOL_NAME prints the generated shared schema without credentials, a listener, or iPhone access.
Durable jobs
Jobs persist for seven days. Timeout, Ctrl-C, process exit, network loss, or exhausted iOS background time does not cancel them.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingapps/website/docs-src/public/agents/skills/healthmd-cli/v2/SKILL.md
Popularity
- Repository stars
- 230
- Repository forks
- 18
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/codybontecou/health-md/v2)