Skip to content
On this page

Developer docs

Build on TrainHeroic with a Claude Code skill, a JSON command-line tool, a TypeScript SDK, or MCP servers that share one typed client.

The toolkit has four entry points over the same TrainHeroic client and typed data shapes. Pick the one that matches who drives the work, and the page shows that surface’s first request.

If you need to… Start with…
Ask Claude Code to work with your account Claude Code skill
Run repeatable shell commands or emit JSON CLI
Build an application or automation TypeScript SDK
Connect an AI client to typed tools MCP server

First request with the skill

The skill teaches Claude Code the TrainHeroic workflows and runs the CLI for each step.

$ npx skills add alandotcom/trainheroic-unofficial
$ export TRAINHEROIC_EMAIL=coach@example.com
$ export TRAINHEROIC_PASSWORD=yourpassword
$ claude

Ask for last week’s training.

Read the skill guide for the athlete variant and the version-matched reference.

First request with the CLI

Every command prints JSON to stdout, so you can pipe it into jq or another program.

$ npm install -g @trainheroic-unofficial/cli
$ export TRAINHEROIC_EMAIL=athlete@example.com
$ export TRAINHEROIC_PASSWORD=yourpassword
$ trainheroic athlete workouts --start 2026-08-01 --end 2026-08-31

Read the CLI guide for coach commands, JSON input, and confirmation flags.

First request with the SDK

npm install @trainheroic-unofficial/js
pnpm add @trainheroic-unofficial/js
yarn add @trainheroic-unofficial/js
bun add @trainheroic-unofficial/js
nub add @trainheroic-unofficial/js
aube add @trainheroic-unofficial/js
import { TrainHeroicClient, fetchAthleteProfileSummary, resolveAthleteUserId } from "@trainheroic-unofficial/js";

const client = new TrainHeroicClient(process.env.TRAINHEROIC_EMAIL!, process.env.TRAINHEROIC_PASSWORD!);

const userId = await resolveAthleteUserId(client);
console.log(await fetchAthleteProfileSummary(client, userId));

Read the SDK guide for auth behavior, the exercise library, workout building, and analytics.

First request over MCP

Add the hosted server to Claude Code. It opens the TrainHeroic sign-in the first time a tool runs.

$ claude mcp add trainheroic --transport http https://mcp.trainheroic-unofficial.com/mcp

Ask through the connected tools.

Read the MCP guide for other clients, role-scoped endpoints, and local stdio servers.

How the pieces fit

Every surface reuses the layer below it, so a fix in the SDK reaches the CLI and every MCP server in the same release.

Runtime requirements

Published packages require Node 18 or a modern runtime with fetch and Web Crypto. Developing the monorepo itself requires Node 24 and pnpm 11.