| name | intervals-cli |
| description | Use this skill whenever the user asks about their sports activities, training, fitness data, wellness, or calendar from intervals.icu — things like "how many km did I run this week?", "what was my last workout?", "show my wellness today", "what's on my training calendar?", or "get my athlete profile". This skill gives you a ready-to-run CLI (Bun) to fetch live data from the intervals.icu API without writing any HTTP code yourself.
|
intervals-cli
A Bun CLI that fetches sports data from the intervals.icu API.
The client is fully typed from the OpenAPI spec via openapi-fetch.
Setup
The CLI lives entirely inside this skill folder. To set it up:
cd .agents/skills/intervals-cli
bun install
Copy .env.example to .env at the project root and fill in your credentials:
INTERVALS_ICU_KEY=<api key — find it at intervals.icu/settings>
INTERVALS_ICU_ATHLETE_ID=<your athlete id, e.g. i123456>
INTERVALS_ICU_URL=https://intervals.icu
Bun loads .env from the directory where you run the command, so always invoke the CLI from the project root:
bun .agents/skills/intervals-cli/cli.ts <command> [options]
Commands
athlete — Profile
bun .agents/skills/intervals-cli/cli.ts athlete
Returns name, ID, email, FTP, timezone.
activities — List activities
bun .agents/skills/intervals-cli/cli.ts activities --from YYYY-MM-DD [--to YYYY-MM-DD] [--limit N]
--from: start date. Default: 30 days ago.
--to: end date. Default: today.
--limit: max results.
Each row: [id] date type name distance duration
Examples:
bun .agents/skills/intervals-cli/cli.ts activities --from 2026-05-01
bun .agents/skills/intervals-cli/cli.ts activities --from 2026-04-01 --to 2026-04-30 --limit 5
activity — Single activity detail
bun .agents/skills/intervals-cli/cli.ts activity <id>
<id> comes from the [id] column of the activities command (e.g. i12345678).
Returns: type, date, distance, moving time, avg power, avg HR, avg speed, elevation, training load, RPE.
wellness — Daily wellness record
bun .agents/skills/intervals-cli/cli.ts wellness [YYYY-MM-DD]
Defaults to today. Returns whatever is recorded: weight, resting HR, HRV, sleep, soreness, fatigue, stress, mood, SpO2, steps, etc.
events — Training calendar
bun .agents/skills/intervals-cli/cli.ts events [--from YYYY-MM-DD] [--to YYYY-MM-DD]
Defaults to today → +14 days. Returns planned workouts, notes, races on the calendar.
Typical agent workflow
To answer "how many km did I run this week?":
- Run
activities --from <monday of current week> to get the list.
- Filter rows where
type is Run.
- Sum the distances and report.
To answer "what was my last workout?":
- Run
activities --from <7 days ago> --limit 1.
- Run
activity <id> on the first result for full details.
To answer "how did I sleep this week?":
- Run
wellness for each day in the range (Mon–Sun), or check individual dates.
- Summarise
sleep, sleepScore, hrv.
Auth note
The CLI uses Basic Auth with API_KEY as the username and the value from INTERVALS_ICU_KEY as the password — this matches the intervals.icu API spec. You never need to handle auth manually; it is wired into src/client.ts.