aoctools
Set of bash scripts for interacting with Advent of Code from the CLI.
Aims to be minimal but functional, current set of utilities is only ~100 lines of bash and can do most of what you would need.
I may add an answer uploader in the future, but I dont currently see a huge need for it.
directory structure
Everything aoctools uses lives in the directory specified by $AOC_DIR, defaulting to ~/.aoc.
There are 2 things within here you should care about
$AOC_DIR/cache: A cache of downloaded inputs. The input for a day can be found atcache/<year>/d<day>.in$AOC_DIR/session: Your session cookie, required to download your personal inputs. Should be able to be found in the devtools of your browser. Do not include something likesession=at the start, just the session key itself, should be a string of random letters and numbers.
dependencies
Just bash, standard GNU/POSIX utilities (only tested on linux with GNU utils, probably works on macOS and busybox too), and curl.
aoc-inputdl
This is the main utility you will be using to download inputs.
Usage: aoc-inputdl <year> <day>
Downloaded inputs will be automatically cached.
The input data will end up in stdout, letting you view it, redirect to a file, or pipe to your solution.
aoc-cacheclear
Clears your cache.
Usage: aoc-cacheclear <year> <day?>
aoc-cacheclear all
If passed all, the whole cache will be cleared.
If only a year is passed, the full cache for that year will be cleared.
If year and day, the cache for that day will be cleared.
It is also easy to just clear it manually using rm, as the structure is very predictable. See directories.
license
This project is licensed under the MIT license See the LICENSE file