Use the hevy CLI to interact with Hevy fitness app data. Requires HEVY_API_KEY env var to be set.
# Verify access
hevy workouts count
# List recent workouts
hevy workouts list --page-size 10
# Raw JSON output for any command
hevy -j workouts list
hevy workouts list --page 1 --page-size 10
hevy workouts get <workout-id>
# Find the exercise template ID first
hevy exercises list --page-size 100
# Then get history for that exercise
hevy exercises history <template-id>
hevy exercises history <template-id> --start-date 2025-01-01 --end-date 2025-02-01
hevy workouts create \
--title "Push Day" \
--start-time 2025-01-15T08:00:00Z \
--end-time 2025-01-15T09:00:00Z \
--exercises-json '[{"exercise_template_id":"79D0BB3A","sets":[{"type":"normal","weight_kg":60,"reps":8}]}]'
For complex exercises, use a file: --exercises-json @exercises.json
hevy routines list
hevy routines create --title "Upper Body" --exercises-json @routine.json
hevy routines update <routine-id> --title "Updated Name"
hevy folders list
hevy folders create --name "Hypertrophy Block"
--page and --page-size for pagination.-j flag before the subcommand for JSON output: hevy -j workouts list.--exercises-json accepting inline JSON or @filepath.normal, warmup, failure, dropset.-j) to get exact IDs for subsequent commands.See references/commands.md for complete command syntax, all flag options, enum values for exercise types/equipment/muscle groups, and the exercises JSON schema.
共 1 个版本