Skip to main content
The Next Race logo
PricingContact

TNR CLI

Plan your future.
Right from your terminal.

Your races, plans and workouts in one command line, for you and for Claude, Cursor and every other agent.

npm i -g @thenextrace/tnr

New to the CLI? Read the docs to learn more.

Built for AI agents

Let your agent plan your training with you

Claude Code, Cursor and other agents run 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)

ID Date Type When Title
41 2027-05-09 Run in 6d Copenhagen 10K
44 2027-08-22 Triathlon in 111d Aarhus Olympic

Bash(tnr schedule list 12 --from 2027-05-03 --to 2027-05-09)

2027-05-04 07:00 · · run Threshold 3×10 min
2027-05-06 07:00 · · run Intervals 6×800 m
2027-05-08 09:00 · · run Long run 75 min

Bash(tnr schedule update 12 3181 --title "Easy 40 min" --text "40min Z2")

✓ Updated planned workout #3181

✻ Tapering… (esc to interrupt)

>

What you can do

Your whole training, one command away

Races, plans, your workout library, activities and physiology. Read them, change them, and script them. Keep it current with tnr update.

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 schedule add 12 --title "HYROX sim" \ --sport strength --date 2027-03-06 --text - <<'EOF' 4 rounds for time, cap 40: 1 km run @ 5:15 50m sled push 102kg 25 wall balls 6kg EOF ✓ Scheduled #3204 HYROX sim on 2027-03-06

02Script it

Every command speaks JSON

Add --json to any command and pipe it on. Status goes to stderr, data to stdout, and exit codes behave.

$ tnr --json race list --upcoming \ | jq '.[] | .title' "Copenhagen 10K" "Aarhus Olympic"

03Read your training

Your weeks at a glance

Weekly load and completion, recovery, and full activity detail with heart-rate zones and sparklines, right in the terminal.

$ tnr fitness summary Last 4 weeks Apr 5 → May 2 Week Acts Plan Done Completion Apr 5 6 7 6 86% Apr 12 7 7 7 100% Apr 19 5 8 5 63% Apr 26 7 8 7 88%

04Doubles as an MCP server

Give any agent your training

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.

> /tnr
  • /plan_my_weektnr
  • /how_am_i_doingtnr
  • /log_recent_effortstnr
  • /should_i_train_todaytnr
  • /race_week_checklisttnr
53 tools · tnr mcp

How it connects

From your terminal to your wrist

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

You, a script, or an AI agent

tnr

CLI, or tnr mcp

On your machine

The Next Race

Races, plans, workouts and activities

thenextrace.app

  • Garmin

    Workouts on your watch

  • Wahoo

    Workouts on your head unit

  • Apple Watch

    Through TNR Go

On your devices

Frequently asked questions

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.

Try TNR CLI.

npm i -g @thenextrace/tnr