- enable easier notation for workouts (textual form)
- be able to specify weekly based training plans in e.g. spreadsheets that can be exported to CSV
- be able to import workouts from CSV file to Garmin Connect workout list
- be able to schedule imported workouts in Garmin Connect calendar automaticaly based on start/end date
# Quick plan
is a command line tool to define, import, schedule and share GarminConnect workouts i.e. weekly based training plans.
An example of a workout definition notation:
```sh
workout: run-fast
- warmup: 10:00 @ z2
workout: 15k, 3x3.2k @HMP
- warmup: 2km @z2
- repeat: 3
- run: 1.5km @ 5:10-4:40
- recover: 500m @ z2
- cooldown: 05:00
- run: 3200m @ 5:05-4:50
- recover: 800m @z2
- run: 1km @z2
- cooldown: lap-button
```
In CSV 1st row is reserved for heading, can be anything and the 1st column is reserved for a week number. The cells represent days and they are populated with workouts (definitions and references), so there's a limitation: a single work out per day/cell, for now. In case of the references, a workout needs to be defined first in one of the previous cells and then it can be referenced by name in the following cells.
and the tool's job is actually to translate it to this:

## File format
The file format is a spreadsheet exported to csv format. The 1st row is reserved for heading, can be anything (you define your first day of a week etc.). The 1st column is reserved for a week number. The cells represent days and they are populated with workouts (definitions and references), so there's a limitation: a single workout per day/cell, for now. In case of the references, a workout needs to be defined first in one of the previous cells and then it can be referenced by name in the following cells.
An example of 2-weeks training plan, containing 2 workout definitions, 4 references and 6 training days in total:
@ -22,3 +24,69 @@ An example of 2-weeks training plan, containing 2 workout definitions, 4 referen
Checkout a [complete training plan for 80K ultra](https://docs.google.com/spreadsheets/d/1b1ZzrAFrjd-kvPq11zlbE2bWn2IQmUy0lBqIOFjqbwk/edit?usp=sharing). It was originally published in an article of Runner's world website - here's [the link](https://www.runnersworld.com/ultrarunning/the-ultimate-ultramarathon-training-plan).
-e, --email <value> E-mail to login to Garmin Connect
-p, --password <value> Password to login to Garmin Connect
-d, --delete Delete all existing workouts with same names as the ones that are going to be imported.
--help prints this usage text
<file> File with a weekly based plan in CSV format
Command: import
Imports all workout definitions from CSV file. If it's omitted, it is will be on by default.
Command: schedule [options]
Schedules your weekly plan defined in CSV in Garmin Connect calendar, starting from the first day of first week or ending on the last day of the last week. Either start or end date must be entered so the scheduling can be done properly. In case both are entered, start date has priority. All dates have to be entered in ISO date format e.g. '2018-03-24'.
-s, --start <value> Date of the first day of the first week of the plan
-n, --end <value> Date of the last day of the last week of the plan
EXAMPLES
Schedules ultra 80k plan targeting 28-4-2018 for a race day