Read and locally mirror personal CAROL Bike workout data.
An unofficial read-only CLI for a rider's own CAROL workout history, with typed commands and a local SQLite mirror.
Learn more at CAROL Bike.
Created by @bricenice17 (bricenice17).
Authentication
Set CAROL_BIKE_TOKEN to a bearer token from your own authenticated dashboard session and CAROL_BIKE_RIDER_ID to your rider identifier. Never commit either value.
Quick Start
# Check credential configuration and API reachability.
carol-bike-pp-cli doctor --json
# Preview the latest-ride request without sending it.
carol-bike-pp-cli ride get-latest --dry-run --json
# Preview a bounded full sync into the local store.
carol-bike-pp-cli sync --full --max-pages 1 --dry-run --json
Unique Features
These capabilities aren't available in any other tool for this API.
Local data
-
sync — Mirror personal CAROL ride history into local SQLite for dependable offline search and analysis.
Agents can query a durable personal ride history without keeping a browser running.
carol-bike-pp-cli sync --full --max-pages 1 --json
Recipes
Preview current weekly frequency
carol-bike-pp-cli stats get-rides-per-week --dry-run --json
Inspect the read-only request for weekly ride rate and target.
Preview the recent ride calendar
carol-bike-pp-cli stats get-ride-calendar --dry-run --json
Inspect the read-only calendar request before making a live call.
Preview a bounded local mirror
carol-bike-pp-cli sync --full --max-pages 1 --dry-run --json
Verify sync wiring without sending API requests.
Usage
Run carol-bike-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:
CAROL_BIKE_CONFIG_DIR, CAROL_BIKE_DATA_DIR, CAROL_BIKE_STATE_DIR, or CAROL_BIKE_CACHE_DIR
--home <dir> for this invocation
CAROL_BIKE_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 CAROL_BIKE_HOME=/srv/carol-bike
carol-bike-pp-cli doctor
Under CAROL_BIKE_HOME=/srv/carol-bike, the four dirs resolve to /srv/carol-bike/config, /srv/carol-bike/data, /srv/carol-bike/state, and /srv/carol-bike/cache.
MCP servers do not receive CLI flags from the host. Put relocation in the host env block:
{
"mcpServers": {
"carol-bike": {
"command": "carol-bike-pp-mcp",
"env": {
"CAROL_BIKE_HOME": "/srv/carol-bike"
}
}
}
}
Precedence matters in fleets: an ambient per-kind variable such as CAROL_BIKE_DATA_DIR overrides an explicit --home for that kind. Use CAROL_BIKE_HOME or the per-kind variables for durable fleet relocation; treat --home as the weaker per-invocation lever.
Relocation is one-way. Unsetting CAROL_BIKE_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 carol-bike-pp-cli doctor --fail-on warn to check path and credential-location warnings in automation.
Commands
ride
Read personal CAROL Bike ride history.
carol-bike-pp-cli ride get-latest - Get the latest ride
carol-bike-pp-cli ride list-rehit - List REHIT rides
stats
Read aggregate CAROL Bike rider statistics.
carol-bike-pp-cli stats get-ride-calendar - Get recent ride-calendar data
carol-bike-pp-cli stats get-ride-count - Get total ride count
carol-bike-pp-cli stats get-rider - Get aggregate rider statistics
carol-bike-pp-cli stats get-rides-per-week - Get current weekly ride rate and target
trends
Read CAROL Bike rider trend series.
carol-bike-pp-cli trends - Get rider trend series
Self-learning loop
This CLI caches per-question discovery so repeat queries skip the walk and structurally similar queries get answered via entity substitution. The loop also self-captures: every invocation is journaled locally, and failed-flag corrections plus fresh teaches surface as candidates on the next recall for confirm/reject judgment. Agents call recall before discovery and fire teach & after answering. See the ## Automatic learning section in SKILL.md for the full protocol.
carol-bike-pp-cli recall <query> - Look up cached resources for a query before running discovery
carol-bike-pp-cli teach - Record a query -> resource mapping (silent on success, safe to background with &)
carol-bike-pp-cli learnings list - Inspect taught rows
carol-bike-pp-cli learnings forget <query> - Undo a teach
carol-bike-pp-cli learnings candidates - List auto-captured candidates awaiting confirm/reject
carol-bike-pp-cli learnings stats - Local loop metrics: recall hit rate, teach-to-reuse, playbook resolution, candidate counts
carol-bike-pp-cli teach-pattern - Install a query/resource template up front
carol-bike-pp-cli teach-lookup - Add an entity mapping (e.g. country code, team alias) for pattern substitution
Pass --no-learn or set CAROL_BIKE_NO_LEARN=true to disable the loop for deterministic flows.
The local store's schema version stamp is one-way: once this version of carol-bike-pp-cli opens the database, older binaries refuse it with a version error — upgrade the binary rather than downgrading.
Output Formats
# Human-readable table (default in terminal, JSON when piped)
carol-bike-pp-cli ride get-latest
# JSON for scripting and agents
carol-bike-pp-cli ride get-latest --json
# Filter to specific fields
carol-bike-pp-cli ride get-latest --json --select id,type,start
# Dry run — show the request without sending
carol-bike-pp-cli ride get-latest --dry-run
# Agent mode — JSON + compact + no prompts in one flag
carol-bike-pp-cli ride get-latest --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 <field>[,<field>...] 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:
CAROL_BIKE_RIDER_ID resolves {riderId}
Base URL: https://i.carolbike.com/rider-api
Health Check
carol-bike-pp-cli doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Run carol-bike-pp-cli doctor to see the resolved config, data, state, and cache directories. The platform-default config path is ``; --home, CAROL_BIKE_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 |
|---|
CAROL_BIKE_RIDER_ID | endpoint | Yes | Rider identifier from your authenticated CAROL Bike account. |
CAROL_BIKE_TOKEN | per_call | Yes | Set to your API credential. |
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, carol-bike-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
carol-bike-pp-cli doctor to check credentials
- Verify the environment variable is set:
echo $CAROL_BIKE_TOKEN
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
API-specific
- CAROL returns 401 or 403 — Obtain a current bearer token from your own authenticated CAROL dashboard session; this private API is unsupported and may change.
- A command reports a missing riderId — Set CAROL_BIKE_RIDER_ID to the rider identifier from your own CAROL account.
Discovery Signals
This CLI was generated with browser-captured traffic analysis.
- Target observed: https://i.carolbike.com/dashboard/main
- Capture coverage: 7 API entries from 7 total network entries
- Reachability: standard_http (95% confidence)
- Protocols: rest_json (99% confidence)
- Auth signals: bearer_token — headers: Authorization
Generated by CLI Printing Press