- Node.js
- Python 3
- ZSH
Create file .env
in aoc-scripts
directory with the following properties:
export AOC_SESSION=<your-aoc-session-token>
export AOC_URL=<aoc-url>
export AOC_YEAR=<year>
export AOC_DAY=<day>
export AOC_LEVEL=<level>
export AOC_PROJECT_DIR=<location-of-aoc-project>
export AOC_SRC_DIR=<src-directory-within-module>
export AOC_RES_DIR=<resources-directory-within-module>
export AOC_SRC_SUBDIR=<subdirectory-within-src-dir>
export AOC_RES_SUBDIR=<subdirectory-within-resources-dir>
export AOC_MODULE_PREFIX=<prefix-of-module>
export AOC_SRC_YEAR_PREFIX=<prefix-for-year-package-in-source-dir>
export AOC_RES_YEAR_PREFIX=<prefix-for-year-dir-in-resources-dir>
export AOC_DAY_PREFIX=<prefix-for-day-subdirectory>
export IDE=<ide-or-editor-to-open-project>
- Session token cookie can be found in the browser dev tools when logged in on the AoC website
IDE
value must be an executable in order to workINSTALL_DIR
value must be in PATH for cli to work- resulting directory structure:
- Source:
project-dir/module-dir/source-dir/year-subdirectory/day-subdirectory/
- Resources:
project-dir/module-dir/resources-dir/day-subdirectory/
year-subdirectory
== year-prefix{year}day-subdirectory
== day-prefix{day}resources-subdirectory
: leave blank to omit resources subdirectoryYEAR_PREFIX
: leave blank to omit year subdirectoryDAY_PREFIX
: default value:d
- Source:
Run executable with aoc
command
-i
Install:
- Creates necessary symlinks to make aoc executable findable on
PATH
-u
Uninstall:
- Removes symlinks to
aoc
executable fromPATH
-a <answer>
Answer:
- Submits parameter as answer for selected year, day and level
-D <new-day>
New Day:
- Overrides
DAY
environment variable
-Y <new-year>
New Year:
- Overrides
YEAR
environment variable
-L <new-level>
New Level:
- Overrides
LEVEL
environment variable
-c
Create:
- Creates empty src and resources directories for selected year and day
- Creates input and example files
- Gets input from AoC website to create input file
- Gets problem description from AoC website to create
README.md
and formats into Markdown
-s
Set:
- Sets the
YEAR
,DAY
andLEVEL
environment variables to the values passed to-Y
,-D
and-L
respectively - Missing parameters are left unchanged
-n
Next:
- Advances to the next day
-y
,-d
and-l
can be combined to advance all or some of the fields, e.g.aoc -nydl
-O <ide>
Open:
- Opens AoC project with chosen IDE
-o
Open:
- Opens AoC project with default IDE
-e
Echo:
- Echoes current values for
YEAR
,DAY
andLEVEL
to the shell
-I
Init:
- Initialises a new project
- Set custom structure up via cli input
-h
Help:
- Shows help