Skip to content

nsampre/hevycli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hevy CLI

A command-line interface for the Hevy fitness tracking app. Manage your workouts, routines, and exercises directly from the terminal.

TLDR

# Install
$> go install github.com/nsampre/hevycli@latest

# Configure with your API key from https://hevy.com/settings?developer
$> hevycli config set-api-key <your-api-key-uuid>

# View your workout history
$> hevycli workouts list

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  ID                  β”‚        TITLE         β”‚       DATE       β”‚ EXERCISES β”‚ DURATION β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ f75e9c13-32d7-407d-9715-011f5d5698fa β”‚ Morning workout β˜€οΈ    β”‚ 2025-06-19 04:21 β”‚ 5         β”‚ 38m      β”‚
β”‚ 9544ef0f-ccfb-4943-afb8-0ebf677c2e26 β”‚ Morning workout β˜€οΈ    β”‚ 2025-06-18 05:35 β”‚ 6         β”‚ 48m      β”‚
β”‚ a856d5f3-6210-4522-8f9d-167d98254e43 β”‚ Morning workout β˜€οΈ    β”‚ 2025-06-13 05:00 β”‚ 6         β”‚ 54m      β”‚
β”‚ 34a12b2b-bb18-496c-bab5-37c49b474fcd β”‚ Morning workout β˜€οΈ    β”‚ 2025-06-10 06:23 β”‚ 5         β”‚ 45m      β”‚
β”‚ 1682b279-6b4f-4b38-b8f0-37760deaf184 β”‚ Afternoon workout πŸ’ͺ β”‚ 2025-06-07 13:31 β”‚ 5         β”‚ 37m      β”‚
β”‚ 5c101486-c9fb-41c2-ba53-21e2a0f4b2cd β”‚ Morning workout β˜€οΈ    β”‚ 2025-06-05 04:53 β”‚ 6         β”‚ 35m      β”‚
β”‚ ba663cbc-107f-4b9c-9871-b39102d2660c β”‚ Morning workout β˜€οΈ    β”‚ 2025-06-03 05:08 β”‚ 5         β”‚ 33m      β”‚
β”‚ 78f694da-7e2d-4d0b-85f1-c2058f37ce85 β”‚ Morning workout β˜€οΈ    β”‚ 2025-05-27 05:03 β”‚ 4         β”‚ 32m      β”‚
β”‚ 8cea716c-2d37-4d4e-99c7-cf5e633d9dc2 β”‚ Morning workout β˜€οΈ    β”‚ 2025-05-26 05:25 β”‚ 4         β”‚ 44m      β”‚
β”‚ 98965cac-d64f-47e8-abae-53fe4edf50ab β”‚ Morning workout β˜€οΈ    β”‚ 2025-05-23 04:29 β”‚ 5         β”‚ 36m      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

$> hevycli workouts get f75e9c13-32d7-407d-9715-011f5d5698fa

Workout: Morning workout β˜€οΈ
ID: f75e9c13-32d7-407d-9715-011f5d5698fa
Short ID:
Date: 2025-06-19 04:21
Duration: 38 minutes

Exercises (5):

1. Hip Abduction (Machine)
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚ SET β”‚  TYPE  β”‚ WEIGHT  ( KG ) β”‚ REPS β”‚ DISTANCE  ( M ) β”‚ DURATION  ( S ) β”‚ RPE β”‚
β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
β”‚ 1   β”‚ normal β”‚ 85.0           β”‚ 10   β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 2   β”‚ normal β”‚ 90.0           β”‚ 10   β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 3   β”‚ normal β”‚ 95.0           β”‚ 12   β”‚ -               β”‚ -               β”‚ -   β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜

2. Hip Adduction (Machine)
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚ SET β”‚  TYPE  β”‚ WEIGHT  ( KG ) β”‚ REPS β”‚ DISTANCE  ( M ) β”‚ DURATION  ( S ) β”‚ RPE β”‚
β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
β”‚ 1   β”‚ normal β”‚ 95.0           β”‚ 10   β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 2   β”‚ normal β”‚ 95.0           β”‚ 10   β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 3   β”‚ normal β”‚ 95.0           β”‚ 10   β”‚ -               β”‚ -               β”‚ -   β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜

3. Leg Press Horizontal (Machine)
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚ SET β”‚  TYPE  β”‚ WEIGHT  ( KG ) β”‚ REPS β”‚ DISTANCE  ( M ) β”‚ DURATION  ( S ) β”‚ RPE β”‚
β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
β”‚ 1   β”‚ normal β”‚ 181.0          β”‚ 8    β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 2   β”‚ normal β”‚ 181.0          β”‚ 8    β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 3   β”‚ normal β”‚ 181.0          β”‚ 8    β”‚ -               β”‚ -               β”‚ -   β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜

4. Bulgarian Split Squat
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚ SET β”‚  TYPE  β”‚ WEIGHT  ( KG ) β”‚ REPS β”‚ DISTANCE  ( M ) β”‚ DURATION  ( S ) β”‚ RPE β”‚
β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
β”‚ 1   β”‚ normal β”‚ 30.0           β”‚ 16   β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 2   β”‚ normal β”‚ 30.0           β”‚ 16   β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 3   β”‚ normal β”‚ 30.0           β”‚ 16   β”‚ -               β”‚ -               β”‚ -   β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜

5. Sumo Squat (Dumbbell)
β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”
β”‚ SET β”‚  TYPE  β”‚ WEIGHT  ( KG ) β”‚ REPS β”‚ DISTANCE  ( M ) β”‚ DURATION  ( S ) β”‚ RPE β”‚
β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
β”‚ 1   β”‚ normal β”‚ 15.0           β”‚ 12   β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 2   β”‚ normal β”‚ 15.0           β”‚ 12   β”‚ -               β”‚ -               β”‚ -   β”‚
β”‚ 3   β”‚ normal β”‚ 15.0           β”‚ 12   β”‚ -               β”‚ -               β”‚ -   β”‚
β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜
# Get detailed workout information (supports short IDs)
hevycli workouts get 437d04ad

# View total workout count
hevycli workouts count
# Output: Total workouts: 247

# List your routines
hevycli routines list

# Export data as JSON
hevycli workouts list --format json > workouts.json

Prerequisites

Installation

Install via Go

The easiest way to install:

go install github.com/nsampre/hevycli@latest

This will install the hevycli binary to your $GOPATH/bin directory (usually ~/go/bin).

Make sure $GOPATH/bin is in your PATH:

export PATH=$PATH:$(go env GOPATH)/bin

Build from source

git clone https://github.com/nsampre/hevycli.git
cd hevycli
go build -o hevycli .

For a smaller binary:

go build -ldflags="-s -w" -o hevycli .

Install to system

sudo cp hevycli /usr/local/bin/

Configuration

Set your Hevy API key:

hevycli config set-api-key <your-api-key-uuid>

View current configuration:

hevycli config show

Environment Variable

You can also set your API key via environment variable:

export HEVY_API_KEY=<your-api-key-uuid>

Usage

Global Flags

  • --format - Output format: table (default) or json
  • --debug - Enable debug output for API requests

Workouts

List recent workouts:

hevycli workouts list
hevycli workouts list --page 2 --page-size 20
hevycli workouts list --format json

Get workout details:

hevycli workouts get <workout-id>

Get total workout count:

hevycli workouts count

Routines

List routines:

hevycli routines list
hevycli routines list --page 2

Get routine details:

hevycli routines get <routine-id>

Exercises

List exercise templates:

hevycli exercises list
hevycli exercises list --page 2 --page-size 20

Get exercise template details:

hevycli exercises get <template-id>

Get exercise history:

hevycli exercises history <template-id>
hevycli exercises history <template-id> --from 2024-01-01

Examples

# View your last 5 workouts
hevycli workouts list --page-size 5

# Get detailed information about a specific workout
hevycli workouts get abc123def456

# Export all routines as JSON
hevycli routines list --format json > routines.json

# Check progress on bench press over time
hevycli exercises history <bench-press-template-id> --from 2024-01-01

# See total workout count
hevycli workouts count

Project Structure

hevycli/
β”œβ”€β”€ cmd/                    # CLI commands
β”‚   β”œβ”€β”€ root.go            # Root command & global flags
β”‚   β”œβ”€β”€ config.go          # Configuration commands
β”‚   β”œβ”€β”€ workouts.go        # Workout commands
β”‚   β”œβ”€β”€ routines.go        # Routine commands
β”‚   └── exercises.go       # Exercise commands
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ api/               # API client
β”‚   β”‚   β”œβ”€β”€ client.go      # HTTP client
β”‚   β”‚   β”œβ”€β”€ types.go       # API types
β”‚   β”‚   β”œβ”€β”€ workouts.go    # Workout endpoints
β”‚   β”‚   β”œβ”€β”€ routines.go    # Routine endpoints
β”‚   β”‚   └── exercises.go   # Exercise endpoints
β”‚   β”œβ”€β”€ config/            # Configuration management
β”‚   β”‚   └── config.go      # Config loading/saving
β”‚   └── display/           # Output formatting
β”‚       └── format.go      # Table/JSON formatting
β”œβ”€β”€ main.go                # Entry point
β”œβ”€β”€ go.mod                 # Go module definition
└── README.md              # This file

Development

Build

go build -o hevycli.

Run tests

go test ./...

Format code

go fmt ./...

Update dependencies

go mod tidy

API Reference

This CLI uses the official Hevy API: https://api.hevyapp.com/docs/

License

This project is not officially associated with Hevy. Use at your own risk.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages