GitPedia

Garmin csv plan

A quick n' dirty way of "automating" training plans into Garmin Connect.

From Raistlfiren·Updated May 14, 2026·View on GitHub·

This is a PHP implementation of the great program that mgifos created [here](https://github.com/mgifos/quick-plan). The intentions of the program is to parse a CSV file and create workouts in Garmin Connect. It has the ability to: - Import workouts from a file into Garmin Connect - Prefix workouts with some text Ex.: Convert `14k, 4x 1.6k @TMP` TO `HANSON:14k, 4x 1.6k @TMP` - Add notes to workout steps Ex.: run: 225:00; Example notes here. ("Example notes here." will be inserted as a note to the... The project is written primarily in PHP, first published in 2020. Key topics include: csv, cycling, garmin, garmin-calendar, running.

Latest release: v0.88k
December 21, 2025View Changelog →

Garmin Plan

Actions Status

This is a PHP implementation of the great program that mgifos created here.
The intentions of the program is to parse a CSV file and create workouts in Garmin Connect.
It has the ability to:

  • Import workouts from a file into Garmin Connect
  • Prefix workouts with some text Ex.: Convert 14k, 4x 1.6k @TMP TO HANSON:14k, 4x 1.6k @TMP
  • Add notes to workout steps Ex.: run: 225:00; Example notes here. ("Example notes here." will be inserted as a note to the workout step.)
  • Schedule existing workouts based upon name: Ex.: Simple Google Sheets CSV Plan
  • Delete workouts that are made based upon the CSV file
  • ONLY delete workouts (Do not import anything)
  • Schedule workouts on Garmin Connect calendar based upon a start OR end date
  • Create swimming workouts by specifying the pool size as an option Ex.: --pool-size=25yds
  • Import AND schedule multiple workouts per day Ex.: multi-events-day.csv
  • Nest repeated steps Ex.: test-repeater.csv

Google Sheet Examples

Example of all Workout Types

Simple Google Sheets CSV Plan

Ultra 80K Plan

Example

CONVERT THIS -

csv
running: 2x4x2'@z5 - warmup: 20:00 - repeat: 2 - repeat: 4 - run: 1:00 @z5 - recover: 2:00 @z2 - recover: 4:00 - cooldown: 10:00

INTO

Garmin Workout

AND SCHEDULED ONTO

Garmin Calendar

THROUGH THIS COMMAND -

shell
docker-compose exec garmin-dev bin/console garmin:workout tests/Resource/all-example.csv schedule -s '2021-05-01' -r 'TriPrep: '

Setting up the application to develop or run

  1. Download and install PHP and composer
  2. Run composer install
  3. Put your username and password in .env file
  4. Run the application by ./bin/console garmin:workout

Running the program through Docker

  1. Copy the CSV file to the root directory (The file will then be copied to the Docker container)
  2. docker-compose run garmin ./bin/console garmin:workout <file.csv>

Usage

Specify a CSV file to create and delete workouts in Garmin connect and schedule them on the Garmin calendar.

Examples

You can remove the -m and -p flag by copying .env to .env.local AND updating the file with your username and password under
GARMIN_USERNAME and GARMIN_PASSWORD.

GARMIN_AUTHENTICATION_FILE_PATH in the .env.local file can be used to change the default path for the garmin_credentials.json. By default it is routed
to the default Symfony project directory.

If you have pool workouts included in your plan, then you must specify the --pool-size option with the length of the pool. Ex.:
25yds
100m

shell
# Basic example of importing workouts into Garmin bin/console garmin:workout <file.csv> -m <garmin_email> -p <garmin_password> # Import AND Schedule workouts into Garmin on January 1, 2020. End date is assumed based upon plan length. # End date can be specified with the -d flag. The same can be assumed with the start date. bin/console garmin:workout <file.csv> schedule -m <garmin_email> -p <garmin_password> -s '2020-01-01' # Same as above but delete all previous items first, import items and schedule them, and prefix with HANSON: before all workouts bin/console garmin:workout <file.csv> schedule -m <garmin_email> -p <garmin_password> -s '2020-01-01' -x -r 'HANSON:' # Only delete the previous workouts (notice capital "x") bin/console garmin:workout <file.csv> schedule -m <garmin_email> -p <garmin_password> -s '2020-01-01' -X -r 'HANSON:' # Do a mock run of importing workouts like above bin/console garmin:workout <file.csv> schedule -m <garmin_email> -p <garmin_password> -s '2020-01-01' --dry-run

Arguments

ValueDescription
<path-to-file.csv>The RELATIVE CSV file path that you want to import into Garmin connect
import OR scheduleSpecify import OR schedule to either just import the workouts into Garmin connect or import AND schedule the workouts. [default value: "import"]

Options

Short formLong formDescription
-m--email=EMAILEmail to login to Garmin [default: ""]
-p--password=PASSWORDPassword to login to Garmin [default: ""]
-P--critical-powerThis number is only used when a power target is specified as a % of critical power. If it is omitted then power targets must be specified in Watts directly.
-x--deleteDelete previous workouts from CSV file
-X--delete-onlyNLY delete workouts that are contained in the CSV file
--dry-runDry run that will prevent anything from being created or deleted from Garmin
--pool-sizeThe pool size specified for all workouts in the plan Ex.: 25yds OR 100m
-r--prefix=PREFIXA prefix to put before every workout name/title
-s--start=STARTDate of the FIRST day of the first week of the plan Ex.: 2021-01-01 YYYY-MM-DD
-d--end=ENDDate of the LAST day of the last week of the plan Ex.: 2021-01-31 YYYY-MM-DD
-h--helpDisplay help message
-q--quietDo not output any message
-V--versionDisplay this application version
--ansiForce ANSI output
--no-ansiDisable ANSI output
-n--no-interactionDo not ask any interactive question
-e--env=ENVThe Environment name. [default: "dev"]
--no-debugSwitches off debug mode.
-v OR -vv OR -vvv--verboseIncrease the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Developing and running the program through Docker

  1. Start by building and running the docker file - docker-compose up garmin-dev

  2. Install dependencies - docker-compose exec garmin-dev composer install

    a) Adding dependencies or removing dependencies can be done through docker-compose exec garmin-dev composer require <package>

    b) Updating dependencies csn be done through docker-compose exec garmin-dev composer update

  3. Run the docker install by running docker-compose up garmin-dev (This runs the docker container and keeps it up)

  4. Execute a command by running docker-compose exec garmin-dev bin/console garmin:workout ...

Running PHPUnit tests

If you want to run PHPUnit tests, then you can easily run it through the dev build.

  1. Follow the above to develop and run the program through Docker.
  2. Run the following - docker-compose exec garmin-dev vendor/bin/phpunit

Overriding Docker

Create a new file in the root called docker-compose.override.yaml.

yaml
version: '3.3' services: garmin-dev: environment: XDEBUG_CONFIG: "client_host=<local_IP>"

Debugging the application through PhpStorm

  1. If running linux, then you will need to modify the docker-compose.yaml file and add your IP in place of host.docker.internal

  2. Go to PhpStorm -> Settings -> Languages & Frameworks -> PHP -> Servers

    a) Click "+"

    b) Name docker-cli (Same as serverName under PHP_IDE_CONFIG environment variable)

    c) Host _

    d) Default 80

    e) Debugger Xdebug

    f) Check the checkbox next to "Use path mappings"

    g) Modify the absolute path on the server to /var/www/html

Contributors

Showing top 4 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from Raistlfiren/garmin-csv-plan via the GitHub API.Last fetched: 6/15/2026