← 返回 Skills 市场
rayleigh3105

Garmin Connect

作者 Rayleigh3105 · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
2343
总下载
5
收藏
7
当前安装
1
版本数
在 OpenClaw 中安装
/install garmin-connect
功能描述
Garmin Connect integration for Clawdbot: sync fitness data (steps, HR, calories, workouts, sleep) every 5 minutes using OAuth.
使用说明 (SKILL.md)

Garmin Connect Skill

Sync all your Garmin fitness data to Clawdbot:

  • 🚶 Daily Activity: Steps, heart rate, calories, active minutes, distance
  • 😴 Sleep: Duration, quality, deep/REM/light sleep breakdown
  • 🏋️ Workouts: Recent activities with distance, duration, calories, heart rate
  • ⏱️ Real-time sync: Every 5 minutes via cron

Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. OAuth Authentication (One-time)

python3 scripts/garmin-auth.py [email protected] your-password

This saves your OAuth session to ~/.garth/session.json — fully local and secure.

3. Test Sync

python3 scripts/garmin-sync.py

You should see JSON output with today's stats.

4. Set Up 5-Minute Cron

Add to your crontab:

*/5 * * * * /home/user/garmin-connect-clawdbot/scripts/garmin-cron.sh

Or manually:

*/5 * * * * python3 /home/user/garmin-connect-clawdbot/scripts/garmin-sync.py ~/.clawdbot/.garmin-cache.json

5. Use in Clawdbot

Import and use in your scripts:

from scripts.garmin_formatter import format_all, get_as_dict

# Get all formatted data
print(format_all())

# Or get raw dict
data = get_as_dict()
print(f"Steps today: {data['summary']['steps']}")

Features

✅ OAuth-based (secure, no password storage) ✅ All metrics: activity, sleep, workouts ✅ Local caching (fast access) ✅ Cron-friendly (5-minute intervals) ✅ Easy Clawdbot integration ✅ Multi-user support

Data Captured

Daily Activity (summary)

  • steps: Daily step count
  • heart_rate_resting: Resting heart rate (bpm)
  • calories: Total calories burned
  • active_minutes: Intensity minutes
  • distance_km: Distance traveled

Sleep (sleep)

  • duration_hours: Total sleep time
  • duration_minutes: Sleep in minutes
  • quality_percent: Sleep quality score (0-100)
  • deep_sleep_hours: Deep sleep duration
  • rem_sleep_hours: REM sleep duration
  • light_sleep_hours: Light sleep duration
  • awake_minutes: Time awake during sleep

Workouts (workouts)

For each recent workout:

  • type: Activity type (Running, Cycling, etc.)
  • name: Activity name
  • distance_km: Distance traveled
  • duration_minutes: Duration of activity
  • calories: Calories burned
  • heart_rate_avg: Average heart rate
  • heart_rate_max: Max heart rate

Cache Location

By default, data is cached at: ~/.clawdbot/.garmin-cache.json

Customize with:

python3 scripts/garmin-sync.py /custom/path/cache.json

Files

File Purpose
garmin-auth.py OAuth setup (run once)
garmin-sync.py Main sync logic (run every 5 min)
garmin-formatter.py Format data for display
garmin-cron.sh Cron wrapper script
requirements.txt Python dependencies

Troubleshooting

OAuth authentication fails

  • Check email/password
  • Disable 2FA on Garmin account (or use app password)
  • Garmin servers might be rate-limiting — wait 5 minutes

No data appears

  1. Sync your Garmin device with the Garmin Connect app
  2. Wait 2-3 minutes for data to sync
  3. Check that data appears in Garmin Connect web/app
  4. Then run garmin-sync.py again

Permission denied on cron

chmod +x scripts/garmin-cron.sh
chmod +x scripts/garmin-sync.py
chmod +x scripts/garmin-auth.py

Cache file not found

Run garmin-sync.py at least once to create cache:

python3 scripts/garmin-sync.py

Usage Examples

from scripts.garmin_formatter import format_all, get_as_dict

# Get formatted output
print(format_all())

# Get raw data
data = get_as_dict()
if data:
    print(f"Sleep: {data['sleep']['duration_hours']}h")
    print(f"Steps: {data['summary']['steps']:,}")

License

MIT — Use, fork, modify freely.


Made for Clawdbot | Available on ClawdHub

安全使用建议
This skill appears to do what it says (sync Garmin data), but there are several red flags you should consider before installing: - Do NOT run the auth script with your password on the command line if you can avoid it (they show python3 scripts/garmin-auth.py <email> <password>) — that exposes credentials in shell history and process lists. Prefer a browser-based OAuth flow (garth-cli) if available. - The SKILL.md claims 'OAuth-based (secure, no password storage)' but other parts instruct using username/password and even recommend disabling 2FA — never disable 2FA for convenience. This contradiction is a security concern. - requirements.txt is incomplete (the code imports 'garth' but it's not listed). Verify and install dependencies explicitly, and inspect the 'garth' and 'garminconnect' packages before trusting them. - The code contains developer hard-coded paths and sample emails (e.g., /home/mamotec, [email protected]). Review and edit scripts to use Path.home() and your own account details before running. - The session file (~/.garth/session.json) and the cache (~/.clawdbot/.garmin-cache.json) store tokens/data locally; ensure those files have proper filesystem permissions and are kept private. If you want to proceed safely: review the garth package source (or use an officially supported Garmin OAuth flow), avoid passing passwords on command lines, restore 2FA on your account, and run the code in an isolated environment (VM or container) until you're comfortable. If you need, ask the author to remove hard-coded paths and provide a documented, browser-based OAuth installer that does not recommend disabling 2FA.
功能分析
Type: OpenClaw Skill Name: garmin-connect Version: 1.0.0 The OpenClaw AgentSkills skill bundle for Garmin Connect appears benign. Its primary function is to sync fitness data locally using OAuth. While `scripts/garmin-auth.py` takes the user's password as a command-line argument for initial OAuth setup (a known security risk as it can appear in process history), this is explicitly documented in `SKILL.md` and `README.md` as a one-time step to obtain an OAuth token, not to store the password itself. Minor issues include hardcoded developer paths in `scripts/garmin-cron.sh` and `scripts/garmin-auth-oauth.py`, and a developer's email used as an example in print statements within `scripts/garmin-auth-oauth.py` and `scripts/garmin-sync-oauth.py`, but these do not indicate malicious intent or significant security vulnerabilities. All network and file access is aligned with the stated purpose of syncing and caching Garmin data.
能力评估
Purpose & Capability
The code and SKILL.md implement Garmin data sync using a local OAuth session and cache files ( ~/.garth/session.json and ~/.clawdbot/.garmin-cache.json ), which is coherent with the stated purpose. However the package imports 'garth' (an OAuth helper) but requirements.txt does not list it; some scripts reference 'garminconnect' and 'garth-cli' in different places. The presence of username/password-based auth and guidance to disable 2FA contradict the declared 'OAuth-based (secure, no password storage)' claim.
Instruction Scope
Instructions include running garmin-auth.py with an email and plaintext password on the command line (exposes credentials via shell history) and suggest disabling 2FA — both are insecure and inconsistent with an OAuth-first design. Several scripts contain hard-coded example paths (/home/mamotec/.garth/session.json) and example email addresses, indicating leftover developer artifacts. The instructions also tell you to save the OAuth session locally (expected) and to add a cron job (expected).
Install Mechanism
No install spec (instruction-only) — lower risk overall — but requirements.txt omits the 'garth' dependency used extensively in the code and README suggests installing 'garth' or 'garth-cli' separately. This mismatch can cause confusing manual steps and leaves dependency provenance unclear; user must pip-install additional packages by hand.
Credentials
The skill declares no required environment variables (correct), and stores tokens locally under the user's home directory (reasonable). However the instructions request direct credentials via CLI and recommend disabling 2FA, which is disproportionate and unsafe relative to the purported OAuth approach. The session file (~/.garth/session.json) contains the token and should be protected.
Persistence & Privilege
The skill does not request elevated privileges or auto-install itself. It writes cache/session files under the user's home directory and requires the user to add a cron entry manually — expected for a sync tool. always:false and normal autonomy settings are appropriate.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install garmin-connect
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /garmin-connect 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Garmin Connect Skill 1.0.0 – initial release - Integrates Garmin Connect with Clawdbot for seamless fitness data sync. - Syncs daily activity, sleep, and workout metrics every 5 minutes via OAuth. - Features easy setup, local caching, cron support, and multi-user capability. - Provides scripts and Python API for accessing and formatting fitness data. - Detailed documentation for installation, usage, and troubleshooting included.
元数据
Slug garmin-connect
版本 1.0.0
许可证
累计安装 8
当前安装数 7
历史版本数 1
常见问题

Garmin Connect 是什么?

Garmin Connect integration for Clawdbot: sync fitness data (steps, HR, calories, workouts, sleep) every 5 minutes using OAuth. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2343 次。

如何安装 Garmin Connect?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install garmin-connect」即可一键安装,无需额外配置。

Garmin Connect 是免费的吗?

是的,Garmin Connect 完全免费(开源免费),可自由下载、安装和使用。

Garmin Connect 支持哪些平台?

Garmin Connect 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Garmin Connect?

由 Rayleigh3105(@rayleigh3105)开发并维护,当前版本 v1.0.0。

💬 留言讨论