Read-only Peloton workout, class, and structural-provider facts in a private local store.
Created by @itsmefelix- (Felix Banuchi).
Quick Start
1. Install
See Install above.
2. Set Up OAuth2 Refresh Credentials
This CLI uses OAuth2 with refresh-token rotation. Provide the client credentials and refresh token; access tokens are refreshed automatically.
export PELOTON_OAUTH_USERNAME="your-username"
export PELOTON_OAUTH_PASSWORD="your-password"
3. Verify Setup
peloton-pp-cli doctor
This checks your configuration and credentials.
4. Try Your First Command
peloton-pp-cli classes search --browse-category example-value --content-format example-value
Usage
Run peloton-pp-cli --help for the full command reference and flag list.
Paths & environment variables
This CLI separates local files into four path kinds:
| Kind | Contents |
|---|
config | User-editable settings such as config.toml and saved profiles |
data | Durable local data: credentials.toml, data.db, cookies, browser-session proof files, and other auth sidecars |
state | Runtime state such as persisted queries, jobs, and teach.log |
cache | Regenerable HTTP/cache files |
Each kind resolves independently. The ladder is:
- Per-kind env var:
PELOTON_CONFIG_DIR, PELOTON_DATA_DIR, PELOTON_STATE_DIR, or PELOTON_CACHE_DIR
--home <dir> for this invocation
PELOTON_HOME for a flat relocated root
- XDG env vars:
XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME
- Platform defaults matching existing installs
For containers and agent sandboxes, prefer a single relocated root:
export PELOTON_HOME=/srv/peloton
peloton-pp-cli doctor
Under PELOTON_HOME=/srv/peloton, the four dirs resolve to /srv/peloton/config, /srv/peloton/data, /srv/peloton/state, and /srv/peloton/cache.
MCP servers do not receive CLI flags from the host. Put relocation in the host env block:
{
"mcpServers": {
"peloton": {
"command": "peloton-pp-mcp",
"env": {
"PELOTON_HOME": "/srv/peloton"
}
}
}
}
Precedence matters in fleets: an ambient per-kind variable such as PELOTON_DATA_DIR overrides an explicit --home for that kind. Use PELOTON_HOME or the per-kind variables for durable fleet relocation; treat --home as the weaker per-invocation lever.
Relocation is one-way. Unsetting PELOTON_HOME does not move files back to platform defaults, and doctor cannot find credentials left under a former root. Move the files manually before unsetting relocation variables.
Existing installs keep working because the platform-default rung matches the legacy layout. On the first auth write, stored secrets leave config.toml and are consolidated into credentials.toml under the data directory. Run peloton-pp-cli doctor --fail-on warn to check path and credential-location warnings in automation.
Commands
account
Current account/profile fact; no implicit account expansion.
peloton-pp-cli account - Show the current profile fact.
classes
Read-only catalog, class detail, planned structure, and provider filter vocabulary.
peloton-pp-cli classes catalog - List a caller-scoped archived class catalog page.
peloton-pp-cli classes filters - Show provider class/filter vocabulary and embedded instructor metadata.
peloton-pp-cli classes search - Search the caller-scoped catalog by factual provider filters; U4 adds offline structural predicates.
peloton-pp-cli classes show - Show class metadata and supported planned structure.
peloton-pp-cli classes structure - Inspect ordered provider segments and target ranges without coaching labels.
strength
Provider-supplied performed movement facts present only in workout detail payloads.
peloton-pp-cli strength <workout_id> - Inspect provider workout detail containing movement_tracker_data when present; no template fallback.
workouts
Read-only recorded workout history, detail, and recorded performance facts.
peloton-pp-cli workouts list - List workout history in newest-first pages; user_id is supplied by the caller until U3 links the profile fact.
peloton-pp-cli workouts performance - Show recorded performance samples and summaries for one workout.
peloton-pp-cli workouts show - Show a recorded workout detail payload.
Output Formats
# Human-readable table (default in terminal, JSON when piped)
peloton-pp-cli classes search --browse-category example-value --content-format example-value
# JSON for scripting and agents
peloton-pp-cli classes search --browse-category example-value --content-format example-value --json
# Filter to specific fields
peloton-pp-cli classes search --browse-category example-value --content-format example-value --json --select id,name,status
# Dry run — show the request without sending
peloton-pp-cli classes search --browse-category example-value --content-format example-value --dry-run
# Agent mode — JSON + compact + no prompts in one flag
peloton-pp-cli classes search --browse-category example-value --content-format example-value --agent
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--json output to stdout, errors to stderr
- Filterable -
--select id,name returns only fields you need
- Previewable -
--dry-run shows the request without sending
- Read-only by default - this CLI does not create, update, delete, publish, send, or mutate remote resources
- Offline-friendly - sync/search commands can use the local SQLite store when available
- Agent-safe by default - no colors or formatting unless
--human-friendly is set
Exit codes: 0 success, 2 usage error, 3 not found, 4 auth error, 5 API error, 7 rate limited, 10 config error.
Runtime Endpoint
This CLI resolves endpoint placeholders at runtime, so one installed binary can target different tenants or API versions without regeneration.
Endpoint environment variables:
PELOTON_USER_ID resolves {user_id}
Base URL: https://api.onepeloton.com
Health Check
peloton-pp-cli doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Run peloton-pp-cli doctor to see the resolved config, data, state, and cache directories. The platform-default config path is ~/.config/peloton-pp-cli/config.toml; --home, PELOTON_HOME, and per-kind env vars can relocate it.
Static request headers can be configured under headers; per-command header overrides take precedence.
Environment variables:
| Name | Kind | Required | Description |
|---|
PELOTON_USER_ID | endpoint | Yes | |
PELOTON_OAUTH_USERNAME | auth_flow_input | No | Set during initial auth setup. |
PELOTON_OAUTH_PASSWORD | auth_flow_input | No | Set during initial auth setup. |
agentcookie (optional)
If you use agentcookie to sync secrets across machines, this CLI auto-adopts agentcookie-managed credentials with no extra setup. When the daemon writes to this CLI's config, peloton-pp-cli doctor reports agentcookie: detected and auth-status labels the source as agentcookie. Skip this section if you don't use agentcookie - the CLI works the same as any other.
Troubleshooting
Authentication errors (exit code 4)
- Run
peloton-pp-cli doctor to check credentials
- Verify the environment variable is set:
echo $PELOTON_OAUTH_USERNAME
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
Generated by CLI Printing Press