1---2name: intervals-cli3description: Use the `intervals` CLI to interact with the intervals.icu (Intervals.icu) API for training data, activities, workouts, power/HR/pace curves, wellness, events, routes, chats, and gear. Trigger whenever the user mentions intervals.icu, Intervals.icu, training data, activities, workouts, power curves, heart rate curves, pace curves, wellness records, calendar events, training plans, or wants to create/update/delete activities or events. Also trigger for queries about FTP, CTL/ATL (fitness/fatigue), training load, or any request to fetch or modify training data from intervals.icu. The user's athlete ID is stored in the repo's AGENTS.md or can be provided explicitly.4---56# Intervals CLI Skill78This skill helps you use the `intervals` CLI tool to interact with the [intervals.icu](https://intervals.icu) API.910## Prerequisites1112- The `intervals` binary must be built or available in PATH13- `INTERVALS_API_KEY` environment variable must be set14- The user's athlete ID — check `AGENTS.md` in the repo root, or ask the user1516## Command Reference1718All commands output JSON by default.1920### Athlete & Profile2122| Command | Description |23|---------|-------------|24| `intervals get-athlete <athlete-id>` | Get basic athlete profile |25| `intervals get-athlete-profile <athlete-id>` | Get detailed athlete profile (city, country, timezone, sex) |26| `intervals get-athlete-summary <athlete-id> [--start <date>] [--end <date>]` | Get athlete summary (fitness data, CTL/ATL, training load) |27| `intervals get-athlete-settings <athlete-id> <device-class>` | Get settings for phone/tablet/desktop |28| `intervals get-athlete-training-plan <athlete-id>` | Get current training plan |29| `intervals update-training-plan <athlete-id> --data <json>` | Update athlete training plan |30| `intervals update-athlete-plans --data <json>` | Update training plans for multiple athletes |31| `intervals apply-plan-changes <athlete-id>` | Apply plan changes to calendar |32| `intervals get-athlete-mmp-model <athlete-id> <activity-type>` | Get MMP power model for a sport |33| `intervals list-sport-settings <athlete-id>` | Get sport settings (FTP, LTHR per sport) |34| `intervals get-sport-setting <athlete-id> <id>` | Get sport setting by ID |35| `intervals create-sport-setting <athlete-id>` | Create sport setting (options: `--types`, `--ftp`, `--lthr`, `--name`) |36| `intervals update-sport-setting <athlete-id> <id>` | Update sport setting (options: `--types`, `--ftp`, `--lthr`, `--name`) |37| `intervals delete-sport-setting <athlete-id> <id>` | Delete sport setting |38| `intervals apply-sport-setting <athlete-id> <id>` | Apply setting to matching activities |39| `intervals list-sport-setting-matching <athlete-id> <id>` | List activities matching setting |40| `intervals list-sport-setting-pace-distances <athlete-id> <id>` | List pace distances for sport |41| `intervals list-gear <athlete-id>` | List athlete gear (bikes, shoes, etc.) |42| `intervals get-gear <athlete-id> <gear-id>` | Get a specific gear item |43| `intervals create-gear <athlete-id>` | Create new gear (options: `--name`, `--distance`, `--retired`) |44| `intervals update-gear <athlete-id> <gear-id>` | Update gear (options: `--name`, `--distance`, `--retired`) |45| `intervals delete-gear <athlete-id> <gear-id>` | Delete gear |46| `intervals replace-gear <athlete-id> <gear-id>` | Retire and replace gear (options: `--new-gear-id`, `--retired-date`) |47| `intervals list-custom-items <athlete-id>` | List custom items (charts, custom fields) |48| `intervals get-custom-item <athlete-id> <item-id>` | Get a specific custom item |49| `intervals delete-custom-item <athlete-id> <item-id>` | Delete a custom item |50| `intervals create-custom-item <athlete-id> --data <json>` | Create a custom item |51| `intervals update-custom-item <athlete-id> <item-id> --data <json>` | Update a custom item |52| `intervals update-custom-item-indexes <athlete-id> --data <json>` | Re-order custom items |53| `intervals upload-custom-item-image <athlete-id> <item-id> <file>` | Upload image for custom item |5455### Activities5657| Command | Description |58|---------|-------------|59| `intervals list-activities <athlete-id> --oldest <date>` | List activities (required: `--oldest`, optional: `--newest`, `--limit`, `--route-id`) |60| `intervals list-activities-around <athlete-id> <activity-id>` | List activities before/after another (options: `--route-id`, `--limit`) |61| `intervals get-activity <athlete-id> <activity-id>` | Get a single activity's details |62| `intervals get-activities <athlete-id> <ids>` | Fetch multiple activities by id (comma-separated, option: `--intervals`) |63| `intervals update-activity <activity-id> [options]` | Update activity (options: `--name`, `--description`, `--activity-type`, `--sport`, `--distance`, `--elapsed-time`) |64| `intervals create-manual-activity <athlete-id> --start-date-local <datetime> --activity-type <type>` | Create manual activity (options: `--name`, `--description`, `--sport`, `--distance`, `--elapsed-time`) |65| `intervals delete-activity <activity-id>` | Delete an activity |66| `intervals search-activities <athlete-id> <query>` | Search activities by name or tag |67| `intervals search-activities-full <athlete-id> <query>` | Search activities returning full details (option: `--limit`) |68| `intervals search-activity-intervals <athlete-id>` | Find activities with matching intervals (options: `--min-secs`, `--max-secs`, `--min-intensity`, `--max-intensity`, `--interval-type`) |69| `intervals list-activity-messages <activity-id>` | List messages/comments on an activity |70| `intervals post-activity-message <activity-id> <content>` | Post a message/comment to an activity |71| `intervals list-activity-intervals <activity-id>` | List auto-detected intervals within an activity |72| `intervals list-activity-tags <athlete-id>` | List all activity tags for an athlete |73| `intervals get-interval-stats <activity-id> <start-index> <end-index>` | Get interval stats for a portion of an activity |74| `intervals get-activity-best-efforts <activity-id> <stream>` | Find best efforts (options: `--duration`, `--distance`, `--count`) |75| `intervals get-activity-streams <activity-id>` | Get time series data (options: `--types`, `--include-defaults`) |76| `intervals get-activity-map <activity-id>` | Get activity map data (lat/lng, bounds) |77| `intervals get-activity-weather-summary <activity-id>` | Get weather summary for an activity |78| `intervals get-activity-segments <activity-id>` | Get activity segments |79| `intervals get-activity-hr-curve <activity-id>` | Get activity heart rate curve |80| `intervals get-activity-hr-histogram <activity-id>` | Get activity heart rate histogram |81| `intervals get-activity-hr-load-model <activity-id>` | Get activity heart rate load model |82| `intervals get-activity-pace-curve <activity-id>` | Get activity pace curve |83| `intervals get-activity-pace-histogram <activity-id>` | Get activity pace histogram |84| `intervals get-activity-power-curves <activity-id>` | Get activity power curves |85| `intervals get-activity-power-curve <activity-id>` | Get activity power curve |86| `intervals get-activity-power-histogram <activity-id>` | Get activity power histogram |87| `intervals get-activity-power-spike-model <activity-id>` | Get activity power spike model |88| `intervals get-activity-power-vs-hr <activity-id>` | Get activity power vs heart rate |89| `intervals get-activity-gap-histogram <activity-id>` | Get activity gradient-adjusted pace histogram |90| `intervals get-activity-time-at-hr <activity-id>` | Get activity time at heart rate |91| `intervals update-activity-intervals <activity-id> --intervals <json>` | Update intervals for an activity |92| `intervals update-activity-interval <activity-id> <interval-id> --data <json>` | Update/create an interval |93| `intervals split-activity-interval <activity-id> --interval-id <id>` | Split an interval |94| `intervals delete-activity-intervals <activity-id> --interval-ids <ids>` | Delete intervals |95| `intervals update-activity-streams <activity-id> --data <json>` | Update streams from JSON |96| `intervals update-activity-streams-csv <activity-id> --csv-file <path>` | Update streams from CSV |97| `intervals download-activity-file <activity-id> <output>` | Download original activity file |98| `intervals download-activity-fit-file <activity-id> <output>` | Download FIT file (options: `--power`, `--hr`) |99| `intervals download-activity-gpx-file <activity-id> <output>` | Download GPX file (options: `--power`, `--hr`) |100| `intervals download-activities-csv <athlete-id> <output>` | Download all activities as CSV |101| `intervals upload-activity <athlete-id> <file>` | Upload activity file (fit/tcx/gpx/zip) |102| `intervals create-manual-activities-bulk <athlete-id> --activities <json>` | Bulk create manual activities |103| `intervals download-activity-fit-files <athlete-id> --output <path>` | Download all FIT files as zip |104| `intervals download-gear-csv <athlete-id> <output>` | Download gear as CSV |105| `intervals download-events-csv <athlete-id> <output>` | Download events as CSV |106| `intervals download-wellness-csv <athlete-id> <output>` | Download wellness as CSV |107| `intervals list-activity-streams-ext <activity-id>` | List activity streams |108109### Performance Curves110111| Command | Description |112|---------|-------------|113| `intervals list-athlete-power-curves <athlete-id> <activity-type>` | List power curves for a sport type (e.g., Ride, Run) |114| `intervals list-athlete-hr-curves <athlete-id>` | List heart rate curves |115| `intervals list-athlete-pace-curves <athlete-id>` | List pace curves |116| `intervals get-power-hr-curve <athlete-id> --start <date> --end <date>` | Get power vs heart rate curve |117| `intervals list-pace-distances` | List pace curve distances |118| `intervals list-athlete-hr-curves-best <athlete-id>` | List best heart rate curves |119| `intervals list-athlete-power-curves-best <athlete-id>` | List best power curves |120| `intervals list-athlete-pace-curves-best <athlete-id>` | List best pace curves |121122### Wellness & Weather123124| Command | Description |125|---------|-------------|126| `intervals list-wellness <athlete-id>` | List wellness records (weight, resting HR, HRV, mood, CTL/ATL) |127| `intervals get-wellness <athlete-id> <date>` | Get wellness record for a specific date |128| `intervals update-wellness <athlete-id> <date>` | Update wellness record (options: `--weight`, `--resting-hr`, `--hrv`, `--mood`, `--sleep`) |129| `intervals update-wellness-bulk <athlete-id> --records <json>` | Bulk update wellness records |130| `intervals upload-wellness-csv <athlete-id> <file>` | Upload wellness records from CSV |131| `intervals get-weather-forecast <athlete-id>` | Get weather forecast for athlete's location |132| `intervals get-weather-config <athlete-id>` | Get weather forecast configuration |133| `intervals update-weather-config <athlete-id>` | Update weather forecast configuration (`--forecasts <json>`) |134135### Workouts, Events & Calendar136137| Command | Description |138|---------|-------------|139| `intervals list-workouts <athlete-id>` | List workouts in athlete's library |140| `intervals get-workout <athlete-id> <workout-id>` | Get a specific workout |141| `intervals create-workout <athlete-id>` | Create workout (options: `--name`, `--workout-type`, `--folder-id`) |142| `intervals update-workout <athlete-id> <workout-id>` | Update workout (options: `--name`, `--description`, `--workout-type`) |143| `intervals delete-workout <athlete-id> <workout-id>` | Delete a workout |144| `intervals create-workouts-bulk <athlete-id> --workouts <json>` | Create multiple workouts |145| `intervals duplicate-workouts <athlete-id> --workout-ids <ids>` | Duplicate workouts |146| `intervals download-workouts-zip <athlete-id> <output>` | Download workouts as zip (options: `--oldest`, `--newest`, `--ext`) |147| `intervals download-workout <athlete-id> <workout-id> <output>` | Download a workout (option: `--ext`) |148| `intervals download-workout-ext <workout-id> <output>` | Download a workout without athlete context (option: `--ext`) |149| `intervals import-workout <athlete-id> <folder-id> <file>` | Import workout from file |150| `intervals list-folders <athlete-id>` | List workout folders and plans |151| `intervals list-folder-shared-with <athlete-id> <folder-id>` | List athletes a folder is shared with |152| `intervals delete-folder <athlete-id> <folder-id>` | Delete a folder and all its workouts |153| `intervals create-folder <athlete-id>` | Create folder (options: `--name`, `--description`, `--folder-type`) |154| `intervals update-folder <athlete-id> <folder-id>` | Update folder (options: `--name`, `--description`, `--folder-type`) |155| `intervals update-folder-shared-with <athlete-id> <folder-id> --athlete-ids <ids>` | Update folder sharing |156| `intervals update-folder-workouts <athlete-id> <folder-id> --workout-ids <ids>` | Update plan workouts |157| `intervals list-events <athlete-id>` | List calendar events (options: `--oldest`, `--newest`, `--category`, `--limit`) |158| `intervals create-event <athlete-id> --start-date-local <datetime> --event-type <type> --category <category>` | Create calendar event (options: `--name`, `--description`, `--uid`, `--upsert-on-uid`) |159| `intervals get-event <athlete-id> <event-id>` | Get an event (planned workout, note, etc.) |160| `intervals update-event <athlete-id> <event-id>` | Update an event (options: `--name`, `--description`, `--notes`) |161| `intervals delete-event <athlete-id> <event-id>` | Delete an event from calendar |162| `intervals mark-event-done <athlete-id> <event-id>` | Mark event as done (create manual activity from planned workout) |163| `intervals delete-events-range <athlete-id> --start-date <date> --end-date <date>` | Delete events in date range |164| `intervals update-events-range <athlete-id> --start-date <date> --end-date <date>` | Update events in date range (options: `--name`, `--description`, `--category`) |165| `intervals delete-events-bulk <athlete-id>` | Bulk delete events (options: `--ids`, `--external-ids`) |166| `intervals create-events-bulk <athlete-id> --events <json>` | Create multiple events |167| `intervals duplicate-events <athlete-id> --event-ids <ids>` | Duplicate events (options: `--num-copies`, `--weeks-between`) |168| `intervals apply-plan-to-events <athlete-id> --folder-id <id>` | Apply training plan to events |169| `intervals download-event-workout <athlete-id> <event-id> <output>` | Download event workout (option: `--ext`) |170| `intervals list-event-tags <athlete-id>` | List event tags for an athlete |171| `intervals list-workout-tags <athlete-id>` | List workout tags for an athlete |172173### Routes174175| Command | Description |176|---------|-------------|177| `intervals list-athlete-routes <athlete-id>` | List saved routes |178| `intervals get-route <athlete-id> <route-id>` | Get a route (option: `--include-path` for GPS data) |179| `intervals update-route <athlete-id> <route-id>` | Update a route (options: `--name`, `--description`, `--commute`) |180| `intervals compare-routes <athlete-id> <route-id> <other-id>` | Compare two routes for similarity |181182### Chats183184| Command | Description |185|---------|-------------|186| `intervals list-chats <athlete-id>` | List chats |187| `intervals get-chat <chat-id>` | Get a chat by id |188| `intervals list-chat-messages <chat-id>` | List messages for a chat (options: `--before-id`, `--limit`) |189| `intervals send-chat-message <athlete-id> <content>` | Send a chat message (option: `--chat-id`) |190| `intervals update-chat-message <chat-id> <msg-id> <content>` | Update a chat message |191| `intervals delete-chat-message <chat-id> <msg-id>` | Delete a chat message |192| `intervals mark-chat-messages-seen <chat-id> <msg-id>` | Mark messages as seen |193194### Other195196| Command | Description |197|---------|-------------|198| `intervals disconnect-app` | Disconnect the app from intervals.icu |199| `intervals get-shared-event <event-id>` | Get a shared event (e.g. race) |200| `intervals list-fitness-model-events <athlete-id>` | List events that influence fitness calculation |201202## Examples203204### List recent activities205206```bash207intervals list-activities <athlete-id> --oldest 2024-01-01 --limit 10208```209210### Create a manual run211212```bash213intervals create-manual-activity <athlete-id> \214 --start-date-local "2024-06-15T07:00:00" \215 --activity-type Run \216 --name "Morning Run" \217 --distance 5000 \218 --elapsed-time 1500219```220221### Get power curves for cycling222223```bash224intervals list-athlete-power-curves <athlete-id> Ride225```226227### Update an activity name228229```bash230intervals update-activity <activity-id> --name "New Name"231```232233### Get activity heart rate streams234235```bash236intervals get-activity-streams <activity-id> --types heartrate,time237```238239### Download a FIT file240241```bash242intervals download-activity-fit-file <activity-id> activity.fit243```244245### Get fitness summary for a date range246247```bash248intervals get-athlete-summary <athlete-id> --start 2024-01-01 --end 2024-01-31249```250251### List upcoming calendar events252253```bash254intervals list-events <athlete-id> --oldest 2024-06-01 --newest 2024-06-30255```256257### Mark a planned workout as done258259```bash260intervals mark-event-done <athlete-id> <event-id>261```262263## Common Activity Types264265- `Ride`, `VirtualRide`, `MountainBikeRide`, `GravelRide`266- `Run`, `TrailRun`, `Walk`, `Hike`267- `Swim`, `OpenWaterSwim`268- `NordicSki`, `AlpineSki`269- `Workout` (indoor trainer)270271## Tips272273- Dates use ISO-8601 format (e.g., `2024-01-15` or `2024-01-15T07:00:00`)274- Distances are in meters, times are in seconds275- The `--oldest` flag is required for `list-activities`276- Power curves require an activity type (`Ride`, `Run`, etc.)277- Use `--upsert-on-uid` with `create-event` to avoid duplicates when the event has a known `--uid`278- Activity streams support types: `time`, `heartrate`, `watts`, `cadence`, `speed`, `distance`, `altitude`, `latlng`, `temperature`279- `get-activity-best-efforts` stream can be `watts`, `heartrate`, `speed`, `cadence`