01Type a workout
Write the session the way you say it
One step per line, from a flag or from stdin. Runs, rides and swims, and strength and HYROX sessions too: sets, supersets, EMOM, AMRAP and run legs. Lines it can't read come back as warnings.
TNR CLI
Your races, plans and workouts in one command line, for you and for Claude, Cursor and every other agent.
npm i -g @thenextrace/tnrNew to the CLI? Read the docs to learn more.
Built for AI agents
tnr the way you do. They read your races and plan, move and rewrite sessions, and check what you've done. One install gives your agent your whole training calendar.✻ Welcome to your agent
/help for help, /mcp to list connected tools
cwd ~/training
> Plan this week around my 10K on Sunday. Keep Thursday easy.
I'll check your races and what's already planned.
Bash(tnr race list --upcoming)
Bash(tnr schedule list 12 --from 2027-05-03 --to 2027-05-09)
Bash(tnr schedule update 12 3181 --title "Easy 40 min" --text "40min Z2")
✻ Tapering… (esc to interrupt)
What you can do
tnr update.01Type a workout
One step per line, from a flag or from stdin. Runs, rides and swims, and strength and HYROX sessions too: sets, supersets, EMOM, AMRAP and run legs. Lines it can't read come back as warnings.
02Script it
Add --json to any command and pipe it on. Status goes to stderr, data to stdout, and exit codes behave.
03Read your training
Weekly load and completion, recovery, and full activity detail with heart-rate zones and sparklines, right in the terminal.
04Doubles as an MCP server
tnr mcp runs the same commands as an MCP server for Claude, Cursor and other clients: 53 tools, plus prompts like plan my week and should I train today. Your token stays on your machine.
How it connects
tnr talks to The Next Race over its API. Sessions you add land in your plan and reach Garmin, Wahoo or your Apple Watch the same way as sessions planned in the app.Terminal
tnr
On your machine
The Next Race
thenextrace.app
Garmin
Workouts on your watch
Wahoo
Workouts on your head unit
Apple Watch
Through TNR Go
On your devices
A command-line tool for The Next Race. It reads and changes your races, training plans, workout library, activities and physiology from the terminal, and runs as an MCP server for AI agents. It's the npm package @thenextrace/tnr and needs Node.js 22 or later.
Same tools, different place to run them. TNR MCP is hosted at thenextrace.app/mcp: nothing to install, and you sign in with OAuth. The CLI runs on your machine, and tnr mcp serves the tools locally over stdio, so your token never leaves your computer.
In The Next Race, open Settings, then API Tokens, and generate a token. Run tnr login and paste it. It's stored in a file only your user can read, and you can revoke it from the same page at any time.
No. The CLI is free and MIT licensed, and The Next Race is free to use with an account.
Email contact@thenextrace.app. Include the output of tnr status if something isn't working.
npm i -g @thenextrace/tnr