Race from your terminal.
Plan races, build workouts, and manage your physiology with tnr. The same binary doubles as an MCP server for Claude, Cursor, and Claude Code.
tnr is a small command-line tool that gives you scriptable access to your The Next Race account: races, training plans, workout library, scheduled sessions, completed activities, and physiology. Useful if you live in a terminal — or if you want to wire your training data into the rest of your tooling.
Every command supports --json for clean machine-readable output. Status messages go to stderr. Exit codes follow standard conventions. Pleasant to pipe into jq, glue into shell scripts, or schedule from cron.
The same binary doubles as a Model Context Protocol server, so Claude Desktop, Cursor, Claude Code can call your The Next Race account directly through it.
Commands
tnr login [--token <token>] Save your API token
tnr logout Clear stored credentials
tnr whoami Show the current user
tnr race list [--upcoming] List races
tnr race show <id> Show a single race
tnr race create --title <t> --date <YYYY-MM-DD> --plan <id>
[--type <type>] [--priority A|B|C] [--location <l>]
tnr race update <id> [--title <t>] [--date <d>] [--plan <id>] [--type <t>]
[--priority A|B|C] [--location <l>] [--notes <n>]
[--completed | --not-completed]
tnr race delete <id> [-y] Delete a race
tnr plan list List training plans
tnr plan show <id> Show a single training plan
tnr plan create --title <t> Create an empty plan
tnr plan update <id> [--title <t>] [--mode calendar|template]
[--public | --no-public] [--access view|comment|edit]
[--allow-duplication | --no-allow-duplication]
tnr plan delete <id> [-y] Delete a plan (cascades to its races)
tnr workout list [--sport <s>] List library workouts
tnr workout show <id> Show a single library workout
tnr workout create --title <t> --sport <s>
[--type <type>] [--description <d>]
tnr workout update <id> [--title <t>] [--sport <s>] [--type <t>]
[--description <d>] [--distance <d>]
[--duration <d>] [--pace <p>]
tnr workout delete <id> [-y] Delete a library workout (unless locked)
tnr schedule list <planId> [--from <d>] [--to <d>]
List planned workouts in a plan
tnr schedule show <planId> <scheduledId>
Show a planned workout
tnr schedule add <planId> --title <t> --sport <s>
[--date <YYYY-MM-DD>] [--week <n>] [--day <0-6>]
[--type <t>] [--description <d>]
tnr schedule update <planId> <scheduledId> [--title <t>] [--date <d>]
[--sport <s>] [--type <t>]
[--description <d>]
[--completed | --not-completed]
tnr schedule remove <planId> <scheduledId> [-y]
Remove a planned workout
tnr schedule link <planId> <scheduledId> --activity <activityId>
Link an actual activity to a planned workout
tnr schedule unlink <planId> <scheduledId>
Remove the activity link
tnr activity list [--from <d>] [--to <d>] [--sport <s>] [--source <src>]
[--unlinked] [--limit <n>]
List completed activities
tnr activity show <id> Show a single activity with full detail
tnr profile show Show profile and physiology
tnr profile set [--ftp <w>] [--threshold-pace <mm:ss>] [--max-hr <bpm>]
[--resting-hr <bpm>] [--weight <kg>] [--css <mm:ss>]
[--vo2max <v>]
tnr mcp Run as an MCP server over stdio