开发与测试
garmin-connect
Garmin Connect CLI for activities, health, body composition, workouts, devices, gear, goals, and more.
bpauli · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add bpauli/gccli --skill garmin-connect技能说明
name: garmin-connect description: Garmin Connect CLI for activities, health, body composition, workouts, devices, gear, goals, and more. homepage: https://github.com/bpauli/gccli metadata: {"clawdbot":{"emoji":"⌚","os":["darwin","linux"],"requires":{"bins":["gccli"]},"install":[{"id":"homebrew","kind":"brew","formula":"bpauli/tap/gccli","bins":["gccli"],"label":"Homebrew (recommended)"},{"id":"source","kind":"source","url":"https://github.com/bpauli/gccli","bins":["gccli"],"label":"Build from source (Go 1.24+)"}]}}
gccli
Use gccli for Garmin Connect health, fitness, and activity data. Requires Garmin SSO authentication.
Setup (once)
gccli auth login you@example.com(opens browser for Garmin SSO)- Headless:
gccli auth login you@example.com --headless(with--mfa-code <code>for MFA) - Set default account:
export GCCLI_ACCOUNT=you@example.com - Verify:
gccli auth status
Output
- Default: human-friendly tables. Use
--json/-jfor JSON,--plainfor TSV. - Data goes to stdout, messages/errors to stderr.
- Always use
--jsonwhen parsing output programmatically. - Tables show distance, speed, pace and elevation in the user's Garmin unit system (
metric,statute_us, orstatute_uk, which is miles with elevation in metres). Override with--units <system>orGCCLI_UNITS. JSON is never converted (meters, m/s).
Date shortcuts
today,yesterday,3d(N days ago),YYYY-MM-DD(specific date).- Use
--start/--endflags for date ranges.
Common commands
- Auth status:
gccli auth status - Auth token (for scripting):
gccli auth token - Export credentials:
gccli auth export(pipe to file or copy to another machine) - Import credentials:
gccli auth import <token>(fromauth exportoutput) - Remove credentials:
gccli auth remove - List activities:
gccli activities list --limit 20 - List activities by type:
gccli activities list --type running - Activity count:
gccli activities count - Search activities:
gccli activities search --start-date 2024-01-01 --end-date 2024-12-31 - Activity summary:
gccli activity summary <id> - Activity details:
gccli activity details <id> - Activity splits:
gccli activity splits <id> - Activity weather:
gccli activity weather <id> - Activity HR zones:
gccli activity hr-zones <id> - Activity power zones:
gccli activity power-zones <id> - Activity exercise sets (show):
gccli activity exercise-sets <id> - Set exercise sets:
gccli activity exercise-sets set <id> -e "CATEGORY/NAME:reps@weightkg[:dSECS][:rSECS]" [-e ...] - Activity gear:
gccli activity gear <id> - Download activity (FIT):
gccli activity download <id> --format fit - Download activity (GPX):
gccli activity download <id> --format gpx --output track.gpx - Upload activity:
gccli activity upload ./activity.fit - Create manual activity:
gccli activity create --name "Morning Run" --type running --date 2024-06-15T07:30:00 --duration 1800 --distance 5000 - Rename activity:
gccli activity rename <id> "New Name" - Retype activity:
gccli activity retype <id> running - Delete activity:
gccli activity delete <id> --force - Activity types:
gccli activities types - Health summary:
gccli health summary [date] - Steps chart:
gccli health steps [date] - Daily steps range:
gccli health steps daily --start 2024-01-01 --end 2024-01-31 - Weekly steps:
gccli health steps weekly --weeks 4 - Heart rate:
gccli health hr [date] - Resting HR:
gccli health rhr [date] - Floors climbed:
gccli health floors [date] - Sleep:
gccli health sleep [date] - Respiration:
gccli health respiration [date] - SpO2:
gccli health spo2 [date] - HRV:
gccli health hrv [date] - Stress:
gccli health stress [date] - Weekly stress:
gccli health stress weekly --weeks 4 - Body battery:
gccli health body-battery [date] - Body battery range:
gccli health body-battery range --start 2024-01-01 --end 2024-01-07 - Training readiness:
gccli health training-readiness [date] - Training status:
gccli health training-status [date] - Fitness age:
gccli health fitness-age [date] - VO2max / max metrics:
gccli health max-metrics [date] - Lactate threshold:
gccli health lactate-threshold - Cycling FTP:
gccli health cycling-ftp - Race predictions:
gccli health race-predictions [date] - Race predictions range:
gccli health race-predictions range --start 2024-01-01 --end 2024-06-30 - Endurance score:
gccli health endurance-score [date] - Hill score:
gccli health hill-score [date] - Intensity minutes:
gccli health intensity-minutes [date] - Weekly intensity minutes:
gccli health intensity-minutes weekly --start 2024-01-01 --end 2024-01-31 - Wellness events:
gccli health events [date] - Body composition:
gccli body composition [date] - Body composition range:
gccli body composition --start 2024-01-01 --end 2024-01-31 - Weigh-ins:
gccli body weigh-ins --start 2024-01-01 --end 2024-01-31 - Add weight:
gccli body add-weight 75.5 --unit kg - Add composition:
gccli body add-composition 75.5 --body-fat 15.2 --muscle-mass 35.0 - Blood pressure:
gccli body blood-pressure --start 2024-01-01 --end 2024-01-31 - Add blood pressure:
gccli body add-blood-pressure --systolic 120 --diastolic 80 --pulse 65 - List workouts:
gccli workouts list --limit 20 - Workout detail:
gccli workouts detail <id> - Download workout (FIT):
gccli workouts download <id> --output workout.fit - Upload workout (JSON):
gccli workouts upload ./workout.json - Update workout (JSON):
gccli workouts update <id> ./workout.json— replaces the workout in place, keeping its ID and any existing schedule - Schedule workout:
gccli workouts schedule add <id> 2024-06-20 - List scheduled workouts:
gccli workouts schedule list 2024-06-20 - List scheduled workouts in range:
gccli workouts schedule list --start 2024-06-01 --end 2024-06-30 - Remove scheduled workout:
gccli workouts schedule remove <schedule-id>(use--forceto skip confirmation) - Delet