npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chrisdoc/hevy-cli

v1.2.9

Published

Command-line client for the Hevy API

Downloads

12,065

Readme

@chrisdoc/hevy-cli

The @chrisdoc/hevy-cli package is a terminal client for the Hevy API. It supports read commands plus create and update commands for workouts, routines, custom exercise templates, routine folders, and body measurements. Deletion is not supported.

Requirements

  • Node.js 24 or newer
  • A Hevy PRO account and API key

Install

pnpm install -g @chrisdoc/hevy-cli
export HEVY_API_KEY=your-hevy-api-key
hevy --help

The CLI reads credentials only from HEVY_API_KEY. It does not accept API keys in command arguments, JSON payloads, or URLs.

Examples

Read commands do not require confirmation:

# List 10 workouts
hevy workouts list --page-size 10

# Search the exercise catalog
hevy exercises search "bench press"

# Pipe one JSON value to jq
hevy routines list --json | jq

Mutation commands require both --data and an explicit --yes:

# Create a folder from an API-shaped snake_case envelope
hevy folders create --data '{"routine_folder":{"title":"Strength"}}' --yes

# Create a workout from a UTF-8 JSON file
hevy workouts create --data @workout.json --yes --json

# Replace a routine from JSON piped on stdin
cat routine.json | hevy routines update routine-123 --data @- --yes --json

# Patch one measurement field
hevy measurements update 2026-07-27 \
  --data '{"date":"2026-07-27","weight_kg":80.5}' --yes --json

# Explicit nulls are validated but omitted from the API PUT body
hevy measurements update 2026-07-27 \
  --data '{"date":"2026-07-27","fat_percent":null}' --yes --json

--data accepts inline JSON, @path for a UTF-8 file, or @- for stdin. Mutation JSON uses strict snake_case API envelopes: workout, routine, exercise, and routine_folder. Measurement JSON includes its date. The CLI validates the complete payload before making an API request.

Commands

Read

| Command | What it returns | | --------------------------------------------------------------------------------------------------- | ------------------------------------- | | hevy user | Your Hevy user profile | | hevy workouts list [--page N] [--page-size N] | A page of workouts | | hevy workouts get <workout-id> | One workout | | hevy workouts count | Your workout count | | hevy workouts events --since <timestamp> [--page N] [--page-size N] | Workout events since an ISO timestamp | | hevy routines list [--page N] [--page-size N] | A page of routines | | hevy routines get <routine-id> | One routine | | hevy exercises search <query> [--max-pages N] | Exercise templates matching the query | | hevy exercises get <exercise-template-id> | One exercise template | | hevy exercises history <exercise-template-id> [--start-date <timestamp>] [--end-date <timestamp>] | History for one exercise | | hevy measurements list [--page N] [--page-size N] | A page of body measurements | | hevy measurements get <YYYY-MM-DD> | Measurements for one date | | hevy summary [--weeks N] | Workout totals for a recent period |

Create and update

| Command | Payload | | ------------------------------------------------------------ | --------------------------------------------- | | hevy workouts create --data <value> --yes | Complete workout | | hevy workouts update <workout-id> --data <value> --yes | Complete replacement workout | | hevy routines create --data <value> --yes | Complete routine, optionally with folder_id | | hevy routines update <routine-id> --data <value> --yes | Complete replacement routine | | hevy exercises create --data <value> --yes | Custom exercise template | | hevy folders create --data <value> --yes | Routine folder | | hevy measurements create <YYYY-MM-DD> --data <value> --yes | New body measurement | | hevy measurements update <YYYY-MM-DD> --data <value> --yes | Measurement patch |

There is no delete command, update-template command, or update-folder command.

Payloads and safety

Workout and routine updates are full replacements. Include every exercise and set that should remain; omitted content is not preserved. A workout update requires the same complete workout payload as creation. A routine update cannot move a routine between folders because Hevy's update endpoint does not accept folder_id.

Measurement updates are patches over Hevy's replacement PUT endpoint. The CLI reads the existing date first, preserves omitted fields, replaces supplied numbers, and omits explicit null values because the API rejects them. The date must appear in --data and match the positional YYYY-MM-DD argument. Measurement creation needs at least one numeric field; update needs at least one supplied field.

Writes are never retried automatically. Creates are not idempotent, and an uncertain network result can still have committed. Verify an uncertain write with a read before deciding whether to retry. A duplicate measurement date is reported by Hevy as HTTP 409. HTTP 403 is reported as a generic API failure because Hevy uses it for permissions and routine/custom-exercise quotas.

Pagination, output, and exit codes

List commands default to page 1 with 5 results per page. --page-size accepts up to 10. Summary defaults to one week and accepts up to 520. Exercise search checks up to 10 API pages, with 100 templates per page; --max-pages accepts up to 100.

Add --json to any command for machine-readable output. Successful commands write one JSON value followed by a newline to stdout. Errors write one sanitized line to stderr.

| Exit code | Meaning | | --------- | ---------------------------------------- | | 0 | Success | | 1 | Missing or invalid configuration | | 2 | Invalid command, flag, payload, or value | | 3 | Hevy API failure | | 4 | Network or timeout failure |