Project

rueda

0.0
The project is in a healthy, maintained state
Fetches your Garmin Connect activities and prints them as a table, JSON, NDJSON or CSV, for people at a terminal and for agents in a shell.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 3.3
 Project Readme

rueda

A read-only command-line client for the Garmin Connect Personal API. It fetches your activities and prints them as a table, JSON, NDJSON, or CSV.

$ rueda activities --since 2025-09-30
DATE        TYPE         NAME        KM    MOVING   KM/H  ELEV  HR   CAD
2025-10-05  road_biking  Activity 1  26.0  1:05:05  23.9  155   146  86
2025-10-03  road_biking  Activity 2  29.3  1:11:32  24.6  160   120  74
2025-10-02  road_biking  Activity 3  35.7  1:32:40  23.1  195   136  73
2025-09-30  road_biking  Activity 4  35.7  1:29:24  23.9  202   133  76

SPEC.md is the full specification.

Install

rueda needs Ruby 3.4 or later.

gem install rueda

To run it from a clone instead, run bundle install and use exe/rueda.

Set up your API key

  1. In Garmin Connect, go to Settings → Personal API and create a key. Choose how long it lasts (30, 90, 180, or 365 days). Garmin shows it only once, so copy it right away.

  2. With the key copied to the clipboard, save it where rueda looks for it:

    mkdir -p ~/.config/rueda && (umask 077 && pbpaste > ~/.config/rueda/api_key)

    The file holds only the key, with 0600 permissions. If ~/.config is in a dotfiles repo or synced, exclude rueda/. You can also set GARMIN_API_KEY instead, which takes precedence over the file. rueda never accepts the key as a command-line argument, so it stays out of your shell history and the process list.

  3. Check it works:

    $ rueda auth check
    Token OK, valid until 2026-11-11 11:01 -03.
    

When the key expires, create a new one and replace the old one in the same place.

Usage

rueda activities                                  # the last 30 days
rueda activities --since 2025-09-01 --until 2025-09-30
rueda activities --type road_biking --limit 5     # --type takes Garmin's type key and can repeat
rueda activity 900000001                          # one activity
rueda activity 900000001 --fit                    # save the original file as activity-900000001.zip

In a terminal, rueda prints a table. When its output goes to a pipe or a file, it prints JSON, so scripts and agents get stable data by default:

$ rueda activities --limit 1 | jq
{
  "schema_version": 1,
  "query": {
    "since": "2025-09-06",
    "until": "2025-10-06",
    "type": []
  },
  "count": 1,
  "activities": [
    {
      "garmin_id": 900000001,
      "name": "Activity 1",
      "type": "road_biking",
      "started_at": "2025-10-05T17:55:26Z",
      "local_date": "2025-10-05",
      "distance_km": 26.0,
      "moving_time_s": 3905,
      "elapsed_time_s": 3916,
      "avg_speed_kmh": 23.9,
      "max_speed_kmh": 35.0,
      "elevation_gain_m": 155,
      "elevation_loss_m": 147,
      "avg_hr_bpm": 146,
      "max_hr_bpm": 170,
      "avg_power_w": null,
      "calories": 728,
      "avg_cadence_rpm": 86,
      "max_cadence_rpm": 125
    }
  ]
}

Units are in the field names, and missing data is null, never 0.

Other options:

  • --format table|json|ndjson|csv picks the format. NDJSON prints one activity per line; CSV prints every field, in schema order.
  • --raw prints Garmin's JSON as it arrives, for fields rueda doesn't map yet. It works only with json and ndjson, and its shape is not guaranteed.
  • --quiet hides warnings. --timeout SECONDS changes the network timeout (30 by default).

Data goes to stdout, and warnings and errors go to stderr. Each kind of error has its own exit code, such as 3 for no API key and 4 when Garmin rejects the key; SPEC.md lists them all.

License

MIT. See LICENSE.