A standalone Codex plugin repo for creating structured cycling workouts in Intervals.icu from short natural-language prompts.
It is designed for prompts like:
Create 3x15 sweet spot FTP 200 todaySchedule 5x4 VO2max FTP 260 tomorrowPreview a 90min endurance workout FTP 210
- A repo-scoped Codex marketplace example at
.agents/plugins/marketplace.json - A local plugin at
plugins/intervals-icu-workout - An MCP server that exposes preview + create tools
- A Codex skill that nudges the model toward the right tool and prompt handling
- Deterministic workout parsing, structuring, and Intervals.icu event creation
This can mostly be automated, but not by git clone alone:
- Git does not run repo setup code automatically after clone.
- Codex Desktop currently installs local plugins from user-local paths under
~/pluginsand~/.agents/plugins/marketplace.json, not directly from an arbitrary cloned repo.
So the repo now provides a one-command installer for the user-local registration step.
Recommended for new users on Codex Desktop:
- Clone this repo locally.
- Run:
npm run install:codex
npm run setupThese commands will:
- symlink
plugins/intervals-icu-workoutinto~/plugins/intervals-icu-workout - create or update
~/.agents/plugins/marketplace.json - register the plugin under
Local Plugins - prompt for
INTERVALS_API_KEYandINTERVALS_ATHLETE_ID, then save them to local plugin config
- Fully restart Codex.
- Open
Plugins. - Choose the
Local Pluginsmarketplace. - Install
Intervals.icu Workout.
The checked-in .agents/plugins/marketplace.json remains a repo example for development, but the installer writes the user-local marketplace that the current desktop app reliably picks up.
Recommended order:
env vars manually: Best for security. No secret goes into chat history, and you can keep credentials session-only or manage them with your shell / OS secret tools.npm run setup: Best compromise. It prompts in the terminal, avoids chat history, and saves local plugin config to~/.codex/plugins/intervals-icu-workout/config.jsonwith0600permissions.ask in chat: Ask in chat if you want help, and Codex should tell you to runnpm run setupor set environment variables manually.
This does not mean "create a .env file in this repo". The plugin does not read a repo .env file automatically.
Manual environment variables means:
- Open Terminal.
- Run:
export INTERVALS_API_KEY=your-key
export INTERVALS_ATHLETE_ID=your-athlete-id
open -a Codex- Use Codex after it opens.
If Codex is already open, fully quit it first, then run those commands and reopen Codex.
If you want those variables available every time, add the same export ... lines to your shell profile such as ~/.zshrc, open a new Terminal, and then start Codex from that Terminal.
INTERVALS_API_KEYINTERVALS_ATHLETE_ID
Optional environment variables:
INTERVALS_BASE_URL— defaults tohttps://intervals.icu
npm run setupEnvironment variables still override the saved config if you set both.
Ask in chat if you want help, but the plugin should direct you to npm run setup or tell you to set the variables in Terminal and reopen Codex. It should not ask you to paste secrets into chat.
Preview without creating anything:
npm run preview -- --request "Create 3x15 sweet spot FTP 200 tomorrow"Create the workout in Intervals.icu:
INTERVALS_API_KEY=your-key INTERVALS_ATHLETE_ID=your-athlete-id npm run create -- --request "Create 3x15 sweet spot FTP 200 tomorrow"Run tests:
npm testThe parser is intentionally narrow and deterministic in v0.1.0.
Supported workout types:
- sweet spot
- tempo
- threshold
- VO2max
- endurance
- recovery
Supported date phrases:
YYYY-MM-DDtodaytomorrow
Supported structure examples:
3x15 sweet spot FTP 2004x8 threshold FTP 260 tomorrow90min endurance FTP 21045 min recovery FTP 190 today