Skip to content

Releases: mtzanidakis/coros-query

Release list

v0.0.1

Choose a tag to compare

@github-actions github-actions released this 11 Apr 13:52

coros-query v0.0.1 — initial release

A single-binary Go CLI that fetches a daily training briefing from the private Coros Training Hub API and emits JSON on stdout, intended for consumption by an LLM agent or scripted analysis. No external Go dependencies — only the standard library.

What it does

Given a target date, coros-query fires four Coros endpoints concurrently and stitches the results into a single JSON document:

Section Endpoint Contents
day / range / weekList /analyse/dayDetail/query Daily metrics (training load, fatigue, HRV, RHR, recommendations) for the target day and a trailing window
activities /activity/query Paginated activities inside the window (distance, duration, avg HR, power, cadence, training load)
analytics /analyse/query 12-week sport totals, HR zone distribution (time/distance/TL), training-load intensity by period
schedule /training/schedule/query Active training plan with per-week plan-vs-actual totals

Partial failures are reported per section in an errors key — one broken endpoint does not block the rest.

Derived metrics (computed client-side)

The tool augments the raw data with readiness signals useful for training recommendations:

  • readiness_composite — weighted 0..100 score combining fatigue zone (35%), HRV z-score (25%), RHR delta (15%), and training-load ratio zone (25%)
  • hrv_zscore — last night's HRV relative to the personal balanced band
  • rhr_delta_7d — today's RHR vs 7-day mean
  • acute_chronic_ratiot7d / (t28d/4); sweet spot 0.8..1.3, overreach >1.5
  • tl_trend_7d_slope — linear slope of acute load over the window
  • training_monotony_7d / training_strain_7d — Foster monotony and strain
  • days_since_hard — days since the last session above the chronic-load floor

Authentication

Credentials come from environment variables (COROS_EMAIL, COROS_PASSWORD, optional COROS_USER_ID, optional COROS_REGION). A .envrc + .env.example are provided for direnv users. The access token is cached at $XDG_CACHE_HOME/coros-query/token-<region>.json and reused across runs until it fails, at which point the tool re-logs in automatically.

COROS_USER_ID is auto-detected from the login response when possible; set it explicitly only if auto-detection fails.

Usage

# Today's briefing with 7-day context
coros-query

# A specific past date
coros-query --date 2026-04-09

# Longer context window for trend analysis
coros-query --days 14

# Narrow down for an LLM prompt
coros-query | jq '{date, day, derived, schedule}'

See README.md for the full flag reference and output schema, and SKILL.md for agent usage instructions.

Installation

Download a pre-built binary for your platform from the assets below (linux/darwin/windows × amd64/arm64), or:

go install github.com/mtzanidakis/coros-query@v0.0.1

Tested with

  • Go 1.26.1
  • Coros Training Hub EU cluster (teameuapi.coros.com); us and cn regions are wired up but untested

Not yet wired up

If you need any of these, capture the relevant endpoint from the Training Hub web UI (DevTools → Network) and open an issue:

  • Sleep duration and sleep-stage breakdown (deep/light/REM), sleep score
  • Daytime stress / body battery equivalent
  • VO2max trend (Running Fitness chart)
  • Race predictor
  • Threshold HR and pace zone configuration
  • Personal records

Known limitations

  • The /analyse/query endpoint returns a fixed ~12-week trailing window and is not paginated.
  • training/schedule/query returns the active plan. Per-day scheduled workouts are exposed only when the plan has programs populated.
  • Coros may change their private API at any time. This release works against the API as observed on 2026-04-11.