Downloads Advent of Code puzzles and inputs

v0.1.3 2023-12-01 17:01 UTC

This package is auto-updated.

Last update: 2024-05-30 00:59:56 UTC


License Supported PHP Versions Packagist Version GitHub Workflow Status (branch) Sponsor this project

Simple PHP-based utility to download all Advent of Code puzzles and inputs locally.


This project requires PHP 7.4 or higher.


There are three ways to download and use this utility:

Composer Dependency

Using PHP for your AoC puzzles? You can include this as a dev dependency in your repository:

composer require --dev colinodell/aoc-downloader

Standalone PHAR

Don't want to mix dependencies or prefer a single executable file? A pre-compiled PHAR is also available via the Releases tab. Simply download the .phar file, make it executable, and run it.

From Source

git clone
cd aoc-downloader
composer update -o --no-dev


You'll need to log into and grab your session cookie using your browser's dev tools:

You can then pass that as an argument to this utility:

  ./bin/aoc-downloader [options] [--] <session_id>

  session_id            Session ID (from the `session` cookie

  -o, --output=OUTPUT   The directory to save the downloaded files [default: "./puzzles"]
  -y, --year=YEAR       The year to download puzzles for (default is all years)
  -h, --help            Display help for the given command. When no command is given display help for the ./bin/download.php command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

It will save both the puzzle test and input data locally:

├── day01
│   ├── input.txt
│   └──
├── day02
│   ├── input.txt
│   └──
├── day03
│   ├── input.txt
│   └──
├── day04
│   ├── input.txt
│   └──
├── day05
│   ├── input.txt
│   └──
├── day06
│   ├── input.txt
│   └──
├── day07
│   ├── input.txt
│   └──
├── day08
│   ├── input.txt
│   └──
├── day09
│   ├── input.txt
│   └──
├── day10
│   ├── input.txt
│   └──