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

intervals-icu-cli

v0.1.2

Published

LLM-friendly CLI for the intervals.icu API — activities, wellness, calendar events, workouts and settings as compact JSON

Readme

intervals-icu-cli

npm CI license

LLM-first CLI for the intervals.icu API — training data, wellness and workout planning as compact, token-thrifty JSON.

Built as a lightweight alternative to running an MCP server: no server process, no transport config — any agent that can run a shell command (Claude Code, Codex, a cron script, you) gets the full intervals.icu API through 42 predictable commands.

npm install -g intervals-icu-cli
intervals config verify

Install

npm install -g intervals-icu-cli    # or: pnpm add -g intervals-icu-cli
intervals --version

This puts the intervals command on your PATH. Prefer zero-install? Every command also works one-off through npx:

npx intervals-icu-cli activities list --oldest -7d

From source:

git clone https://github.com/alexandcote/intervals-icu-cli && cd intervals-icu-cli
pnpm install && pnpm build
npm link                            # symlinks `intervals` to your build

Requires Node.js >= 18.

Why a CLI instead of an MCP server?

  • Zero infrastructure — npx and an API key. Nothing to keep running, nothing to reconnect.
  • Token economy by design — activity objects have ~174 fields; the CLI trims responses to curated summaries, strips nulls, and pushes field selection to the server. A 20,000-point power stream becomes --stats (min/max/avg) or a downsampled curve, never a context-window flood. When an analysis needs real numbers from streams, activities download writes the full-resolution data to a file for the agent to compute over with code — LLMs are unreliable at reading long numeric arrays; scripts aren't.
  • Self-describing — intervals llms prints the entire command reference as one markdown document; every command has --help with real examples. An agent learns the whole surface in one call.
  • Structured failures — errors are JSON on stderr with a hint that says what to do next, plus distinct exit codes. Agents recover instead of guessing.

Setup

  1. Get your API key from intervals.icu → Settings → Developer Settings.
  2. Provide it either way:
export INTERVALS_API_KEY=your-key        # environment variable, or:
intervals config set api_key your-key          # ~/.config/intervals-cli/config.json (chmod 600)
intervals config verify                        # → {"ok":true,"athlete_id":"i12345","name":"..."}

The athlete defaults to the key's owner. Coaches can target someone else with --athlete i67890 or INTERVALS_ATHLETE_ID. Precedence: flag > env > config file. The API_KEY/ATHLETE_ID env vars used by intervals-mcp-server also work, so migration is a rename away.

Using it from an LLM agent

intervals llms          # full command reference, one markdown document
intervals llms --json   # same, structured

For Claude Code, a ready-made skill ships in skills/intervals-icu/. It teaches the agent the core workflows — reading training data, logging wellness, planning structured workouts — plus the token-economy rules and destructive-command cautions:

cp -r skills/intervals-icu ~/.claude/skills/        # personal, all projects
cp -r skills/intervals-icu .claude/skills/          # or per-project

A second skill, skills/training-analysis/, turns that data into an evidence-based diagnosis and plan — rider/runner phenotype, physiological limiters, training-intensity-distribution audit, durability, and readiness/overreaching — grounded in cited 2019–2026 sports-science thresholds (references/evidence.md).

Commands

| Group | Commands | |---|---| | config | set · get · list · unset · path · verify | | athlete | get · profile · update | | activities | list · get · search · intervals · streams · download · power-curve · power-profile · pace-curve · hr-curve · best-efforts · update | | wellness | list · get · update | | events | list · get · create · update · delete · delete-range | | sport-settings | list · get · update | | folders | list · create · update · delete | | workouts | list · get · create · update · delete | | llms | print the full reference |

Examples

# Last week's training as compact summaries
intervals activities list --oldest -7d

# Fitness trend: CTL (fitness), ATL (fatigue), HRV over 30 days
intervals wellness list --oldest -30d --fields id,ctl,atl,restingHR,hrv

# One activity, zone times only
intervals activities get i81960531 --fields id,name,icu_zone_times,icu_hr_zone_times

# Power + HR summarized instead of 20k raw points
intervals activities streams i81960531 --types watts,heartrate --stats

# Full-resolution data to a file (activity + intervals + every stream), for analysis with code
intervals activities download i81960531 --out ./data

# Best 20-minute power in a ride
intervals activities best-efforts i81960531 --stream watts --duration 20m

# Log this morning's wellness (scales: 1 = best/none … 4 = worst)
intervals wellness update today --weight 71.5 --resting-hr 48 --hrv 92 --sleep-secs 27000

# Plan a structured workout — the server parses the step syntax
# (repeats need a labelled "<label> Nx" header line; "- 5x ..." or "3m 118% / 3m 50%" silently become 1 rep)
intervals events create --start tomorrow --name "VO2 intervals" --type Ride \
  --description 'Warmup
- 15m 60%

Intervals 5x
- 3m 118%
- 3m 50%

Cooldown
- 10m 55%'

# New FTP after a test
intervals sport-settings update Ride --ftp 285

Input & output conventions

Forgiving inputs

  • Dates: 2026-07-06, today, yesterday, tomorrow, now, offsets -7d -4w -3m -1y +2d
  • Durations: seconds or 1h30m / 20m / 90s — distances: meters or 42.2km
  • Write bodies: --set key=value (repeatable, auto-coerced, dots nest, key:=json for arrays/objects) or --data '{...}' | @file | @-, with "did you mean restingHR?" typo hints

Predictable output

  • Compact JSON on stdout; --pretty for humans
  • Null fields stripped (--nulls keeps them); array elements never removed, so stream data stays positionally aligned
  • --fields a,b,c selects exactly what you need (dot paths supported); --full returns everything
  • 429s retried honoring Retry-After; GETs retried once on transient failures

Errors land on stderr as {"error":{"code","message","hint"}}:

| Exit | Meaning | |---|---| | 0 | success | | 1 | API / network / timeout | | 2 | usage or invalid input | | 3 | auth failed or forbidden | | 4 | not found | | 5 | rate limited after retries |

Development

pnpm install
pnpm test         # vitest
pnpm typecheck    # tsc --noEmit
pnpm build        # tsup → dist/index.js, single ESM bundle
node dist/index.js --help

Add pnpm changeset with each user-visible change. After changes merge, the Changesets GitHub Action maintains a release PR containing the generated version and changelog. Merging that PR publishes to npm with provenance and creates the release tag.

License

MIT

Not affiliated with intervals.icu. Be kind to the API — it's a one-person labor of love.