CLI and AI agents
The gymgym CLI is for people and for programs. It can print everything that it shows as JSON. It can create and edit everything that you build in the app (routines, plans and logged workouts), step by step or as whole documents.
Agents can use gymgym in two ways. Both give the same abilities and run the same code:
- The MCP server at
https://app.gymgym.club/mcpworks with any assistant that speaks MCP. The assistant can run in the cloud (Claude, ChatGPT) or on your machine (Claude Code, Codex). You install nothing. You sign in and allow the assistant in the browser. The MCP server reference lists every tool. - CLI commands with
--jsonare for scripts and for agents that run shell commands.
Get the CLI
Section titled “Get the CLI”You need Node.js 24 or newer. Install the CLI from npm:
npm install -g @gymgym/cligymgym --helpNew commands can reach the repository before they reach npm. To run the newest version, run the CLI from the repository:
git clone https://github.com/ifokeev/gymgym && cd gymgymcorepack pnpm installalias gymgym="node $PWD/apps/cli/src/main.ts"gymgym --helpThe CLI talks to https://app.gymgym.club. For a self-hosted instance, pass --url <server> or set GYMGYM_URL.
Connect an assistant
Section titled “Connect an assistant”The /connect page of the app walks people through this. It has setup text to copy for each client, and Settings → Connected apps links to it.
Add https://app.gymgym.club/mcp to your assistant as a remote MCP server. Many assistants call this a custom connector. For example, in Claude Code:
claude mcp add --transport http gymgym https://app.gymgym.club/mcpIn Codex (~/.codex/config.toml):
[mcp_servers.gymgym]url = "https://app.gymgym.club/mcp"The first time that the assistant uses the server, a gymgym page opens:
- Sign in with Google, GitHub, a passkey or a guest account. If several accounts are signed in on this browser, pick the account that the assistant must use.
- Check what the assistant asks for and choose Allow.
The assistant now acts as that account only. To give it another account, connect it again and pick the other account. Settings → Connected apps lists every app that you allowed. “Remove access” stops an app at once. Assistants register themselves with a Client ID Metadata Document. Older assistants use dynamic registration. You do not need to create anything first.
Several accounts: profiles
Section titled “Several accounts: profiles”In the CLI, a profile is one signed-in account on one server. You can sign in a second account next to the first and switch between them:
gymgym login # the "default" profilegymgym login --profile coach # another account; becomes currentgymgym profile # list them; * marks the current onegymgym profile use defaultgymgym today --profile coach # one command as another profileGYMGYM_PROFILE=coach gymgym workoutsgymgym logout --profile coach # sign out of one and forget itThe web app has the same idea. Go to Settings → Account → Add account, then switch from the account list or the sidebar. The MCP server has it too: connect an assistant once for each account, and pick the account when you sign in.
Set up an agent with the CLI
Section titled “Set up an agent with the CLI”- Run
gymgym loginonce on the machine that the agent uses. Approve the code at/devicein your browser. The CLI stores the session tokens for each profile in~/.config/gymgym/config.json(mode 0600), or where$GYMGYM_CONFIGpoints. - Give the agent the commands that it can run. A useful read-only set is
today,plan,routine list|show,workouts,workout show,weightandexercises. Addroutine apply,workout applyandlogwhen the agent can write. - Point the agent at the formats.
gymgym routine schemaandgymgym workout schemaprint JSON Schemas.--exampleprints a valid sample. Routine and workout documents explains every field.
Conventions
Section titled “Conventions”--jsonis on every command. It prints the data as JSON on stdout. Prompts and progress go to stderr.- The exit code is 0 on success and 1 on any problem. A problem prints one line on stderr that starts with
gymgym:. Document errors name the field, for examplegymgym: Document problem at exercises[1].sets: expected a whole number 1–20. A command that fails saves nothing. - A command does not prompt when you give it everything. Destructive commands need
--yes.importneeds--yeswithout a terminal.workout --as-plannedlogs a routine without asking. You can pipe documents in with-. - You can name things with a name or an id. A routine takes its name, or a unique start of its name. A workout takes its id (or the last characters of it, as
gymgym workoutsshows), a date, orlast. An exercise takes its everyday name or its id. When two exercises share a name, a document writes the name with the id after it, for exampledumbbell one arm bent-over row [0292]. Write it back as it is, or use only the id. Exercise names follow the language of the account. Listings, search and documents use that language. A name in any of the languages of the app is accepted when it means one exercise. - Documents carry a
unit(kgorlb), and gymgym reads and writes weights in that unit. Commands and MCP tools use the unit of the account.gymgym settings --unit lb(or thesettingstool) changes it. A new account starts in the unit of the region of the browser: pounds in the US, kilograms elsewhere.
Edit a routine
Section titled “Edit a routine”Read the routine, change it and write it back:
gymgym routine show "Upper A" --json > upper.json# … change upper.json (add an exercise, change reps to "8-12", set "superset": "A" on two entries) …gymgym routine apply upper.jsonOr make one change at a time:
gymgym routine create "Upper A" --progression doublegymgym routine add "Upper A" "bench press" --sets 4 --reps 6-10 --weight 80 --rest 2:30gymgym routine add "Upper A" pull-up --sets 3 --reps 6-10 --superset Agymgym routine add "Upper A" "dumbbell lateral raise" --sets 3 --reps 12-15 --superset Agymgym routine edit "Upper A" 1 --reps 5-8gymgym routine move "Upper A" 3 1gymgym plan set mon "Upper A"A routine document can also plan extra sets for each exercise. "warmups": 2 plans warm-ups that ramp toward the first work weight, rounded to the plates that you own. "drops": 1 and "bursts": 1 plan drop sets and rest-pause bursts after the last work set. Each value is from 0 to 5. For an exercise done one side at a time, such as a one-arm row, the reps are for each side. An exercise can also carry a "note" of up to 140 characters: a tip that the workout shows above its sets, such as "down to a box". It can also carry a "why" of up to 280 characters: the reason for its sets, reps and rest, in a sentence or two. The coach writes one for every exercise of a new routine and reads it to answer why an exercise has the sets it has. The workout does not show it. If you leave "why" out of a document that changes a routine, the saved reason stays while the sets, the reps, the time, the rest and the extra sets stay, and it goes when one of them changes. An empty "why" removes it. "deload": true on the routine makes it a planned deload. Its sessions open on its own targets and never feed progression.
Folders and programs
Section titled “Folders and programs”Routines live in folders and run on any day. Each folder suggests the routine after the one that you did last. Routines in no folder are under “My routines”.
gymgym program # the ready-made programs and their routinesgymgym program save ppl --name "Push Pull Legs" # a new folder with a copy of its routinesgymgym folder # folders, their routines and what comes nextgymgym folder create "Arms"gymgym folder move "Arms and core" arms # or "My routines"gymgym folder rename arms "Arms day"gymgym folder archive "arms day" # hide it with its routines; nothing in it changesgymgym folder restore "arms day" # put it back on the Workout screengymgym folder delete "arms day" --yes # its routines move to My routines (--with-routines deletes them)An archived folder leaves the Workout screen with its routines, and gymgym folder lists it last, marked archived. Its routines keep their exercises, schedule and history, so a folder that you restore is the same as before.
Saving a program leaves the weekly schedule alone. If you keep a schedule, gymgym plan set puts routines on weekdays, for reminders. The MCP tools match these commands: list_programs, save_program, list_folders, save_folder, move_routine, archive_folder and delete_folder.
Log a workout
Section titled “Log a workout”Use a document when the agent knows what you did:
gymgym workout apply - <<'JSON'{ "name": "Evening push", "date": "2026-10-03", "minutes": 50, "exercises": [ { "exercise": "bench press", "sets": ["80x8", "80x7@8", "80x6"] } ] }JSONIn the text of a set, w: marks a warm-up, d: a drop set and rp: a rest-pause burst. For example: ["w:40x10", "80x8", "d:60x8"]. Warm-ups never count for volume, records or progression. Drop sets and bursts count for volume only. For a dumbbell or a kettlebell, write the weight of one. When the exercise holds one in each hand, such as a dumbbell bench press, its volume counts both. An exercise can carry a "note". With "pinned": true, the note returns in later workouts with that exercise. An exercise can also carry "skipProgression": true. The same flag on the workout excludes the whole session.
To correct a workout later, apply the edited output of gymgym workout show last --json. It keeps its id. For one exercise, gymgym log "bench press" 85x3 85x3 is shorter. The output of workout apply and log includes any new personal records.
To clear history, use these commands:
gymgym workout delete 2026-10-03 --yesremoves one workout.gymgym workout delete --from 2026-01-01 --to 2026-03-31 --yesremoves every workout in a range of dates. Both days are included. You can leave out either end.--allremoves the whole history.
Without --yes, the command only says how many workouts it would delete and between which dates. The command never deletes a running workout. gymgym counts the records and the progress that the deleted workouts set again without them. There is no undo. The MCP tool delete_workouts does the same for assistants. In the coach of the app, it comes as a card that the person must confirm with Delete.