Health data bridge for OpenClaw (Garmin and friends)
Project description
clawhealth
Languages: English | Chinese
clawhealth is an OpenClaw-first Garmin Connect sync tool. It logs in (MFA
supported), syncs health data into a local SQLite DB, and provides JSON-friendly
commands that OpenClaw agents can call.
The primary deliverable of this repo is the OpenClaw skill at skills/clawhealth-garmin/.
Unlike markdown-based Garmin skills, ClawHealth provides structured SQLite + JSON outputs for reliable agent workflows and long-term analysis.
What It Can Do
- Login with Garmin username/password (MFA supported)
- Sync daily health summaries into SQLite (steps, sleep total, stress, body battery, SpO2, respiration, weight)
- Fetch sleep stages + sleep score (
garmin sleep-dump) - Fetch HRV (
garmin hrv-dump) and training readiness/status/endurance/fitness age (garmin training-metrics) - Fetch body composition metrics (
garmin body-composition) - Fetch activity lists and full activity details (
garmin activities,garmin activity-details) - Fetch menstrual day view and calendar range if supported by garminconnect and enabled on the account (experimental)
- Produce JSON outputs for agent workflows
- Store raw JSON payloads in SQLite for full-fidelity access
Notes:
- Some metrics depend on your Garmin device and account settings (e.g., sleep stages, body composition, menstrual data).
- Menstrual endpoints require garminconnect support; if missing, the command returns
UNSUPPORTED_ENDPOINT.
Security model
- This skill runs entirely in your local OpenClaw environment.
- Garmin credentials and session data never leave your machine.
- No data is sent to the skill author or any third-party service.
- Prefer using a password file instead of inline passwords.
- Do not commit
.env, password files, or local databases.
Example JSON Output
{
"ok": true,
"date": "2026-03-16",
"sleep_total_min": 410,
"sleep_score": 78,
"rhr_bpm": 58,
"hrv_last_night_avg": 42,
"training_readiness_score": 65,
"training_status_feedback": "Maintaining",
"endurance_overall_score": 72,
"mapping_version": "uhm_v1"
}
Designed for direct agent consumption (stable JSON schema).
Command Overview
Core:
daily-summarygarmin trend-summary
Advanced:
garmin training-metricsgarmin sleep-dumpgarmin body-compositiongarmin activitiesgarmin activity-detailsgarmin hrv-dumpgarmin menstrualgarmin menstrual-calendar
Minimal Workflow Example
clawhealth daily-summary --json- feed into agent
- generate daily health report
OpenClaw (Primary)
Step 1: Install the skill
OpenClaw loads skills from <workspace>/skills (highest precedence) and
~/.openclaw/skills (shared/local). Install this skill by physically placing it under your OpenClaw workspace:
git clone https://github.com/ernestyu/clawhealth.git /home/node/.openclaw/workspace/clawhealth_temp
mv /home/node/.openclaw/workspace/clawhealth_temp/skills/clawhealth-garmin /home/node/.openclaw/workspace/skills/
rm -rf /home/node/.openclaw/workspace/clawhealth_temp
After install, the skill directory is:
<skillDir>=~/.openclaw/workspace/skills/clawhealth-garmin
Step 2: Dependencies on first run
Native OpenClaw (non-Docker):
run_clawhealth.pytries to auto-bootstrap Python deps into<skillDir>/.venvon the first Garmin command.- Disable auto-bootstrap with
CLAWHEALTH_AUTO_BOOTSTRAP=0.
Docker OpenClaw:
- Recommended: use
ernestyu/openclaw-patched(deps preinstalled). - If you stay on the official image, run
python ~/.openclaw/workspace/skills/clawhealth-garmin/bootstrap_deps.pyinside the container (or setCLAWHEALTH_AUTO_BOOTSTRAP_IN_DOCKER=1to allow auto-bootstrap).
Step 3: Configure username + password
You have two ways to configure credentials:
- Let OpenClaw write the files for you:
Create
<skillDir>/.envand a password file under<skillDir>/(see<skillDir>/ENV.example). - Configure from a terminal (example for a running container):
docker exec -it openclaw bash -c '
cd ~/.openclaw/workspace/skills/clawhealth-garmin &&
printf "CLAWHEALTH_GARMIN_USERNAME=you@example.com\nCLAWHEALTH_GARMIN_PASSWORD_FILE=./garmin_pass.txt\n" > .env &&
printf "YOUR_GARMIN_PASSWORD" > garmin_pass.txt &&
chmod 600 .env garmin_pass.txt &&
echo "Configuration completed. Return to your chat UI and trigger login."
'
Notes:
- Relative paths in env vars (like
./garmin_pass.txt) are resolved relative to the skill directory byrun_clawhealth.py. - Keep
.envand password files out of git and protect file permissions.
Step 4: Login (MFA) and sync
Login step 1 (triggers MFA, requires username + password source):
cd ~/.openclaw/workspace/skills/clawhealth-garmin
python run_clawhealth.py garmin login --username you@example.com --json
Login step 2 (submit MFA code):
python run_clawhealth.py garmin login --mfa-code 123456 --json
Sync and query:
python run_clawhealth.py garmin sync --since 2026-03-01 --until 2026-03-03 --json
python run_clawhealth.py daily-summary --date 2026-03-03 --json
Optional: Advanced endpoints
Menstrual endpoints are experimental and require garminconnect support.
python run_clawhealth.py garmin sleep-dump --date 2026-03-03 --json
python run_clawhealth.py garmin body-composition --date 2026-03-03 --json
python run_clawhealth.py garmin activities --since 2026-03-01 --until 2026-03-03 --json
python run_clawhealth.py garmin activity-details --activity-id 123456789 --json
python run_clawhealth.py garmin menstrual --date 2026-03-03 --json
python run_clawhealth.py garmin menstrual-calendar --since 2026-03-01 --until 2026-03-31 --json
Not Using OpenClaw (Secondary)
If you want to run the CLI directly:
python -m pip install -e .
clawhealth --help
Roadmap
See ROADMAP.md.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clawhealth-0.1.0.tar.gz.
File metadata
- Download URL: clawhealth-0.1.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3831ab84278177c3bf2c777cc9373bb6145d86e7f78df1422a44add054f06f0a
|
|
| MD5 |
947bd8135bf05e92f4d12d2df80bbc67
|
|
| BLAKE2b-256 |
a42885d8c6caf501f25ca9c8ed30ba7a8c356e2cfd5574d2f972705fcc0b0da8
|
File details
Details for the file clawhealth-0.1.0-py3-none-any.whl.
File metadata
- Download URL: clawhealth-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
867e78c8493484f10c320559b2710446790a2ebdc02f474d3fb5390b92188b66
|
|
| MD5 |
297506c643e05c7ad1dcf6ae10170e0e
|
|
| BLAKE2b-256 |
eae17d72b2fab648223f5d1888508deb046473944169a34328ff1ef2f8256b30
|