Sled is the Seasonal Linear Enigma Device, a command-line utility for Advent of Code.
Usage: sled [--session <file>] <subcommand> [<args>]
Seasonal Linear Enigma Device, a command-line utility for Advent of Code.
Options:
-s, --session <file> A file that contains the session ID for the user's
logged in session. (Default: session.txt)
-h, --help Show this help message.
Subcommands:
a, answer Submit an answer.
c, calendar Display the calendar.
p, puzzle Download a puzzle.
For more information on each subcommand, type 'sled help <subcommand>'.
Sled uses the curl command-line utility to communicate with the Advent of Code
servers. It must be on the PATH of the user that runs sled.
The latest release of sled is available via Homebrew for macOS (Apple Silicon)
and Linux (x86-64 and aarch64):
$ brew tap pyrmont/sled https://github.com/pyrmont/sled
$ brew install sled
If you use Janet, you can install sled using Jeep:
$ jeep install https://github.com/pyrmont/sled
Pre-built binaries of sled are available as tarballs via the
Releases section on GitHub for:
- FreeBSD 14 (x86-64 and aarch64)
- Linux (x86-64 and aarch64)
- macOS (aarch64)
$ curl -LO https://github.com/pyrmont/sled/releases/latest/download/sled-v<version>-<platform>-<arch>.tar.gz
$ tar -xzf sled-v<version>-<platform>-<arch>.tar.gz
$ cd sled-v<version>
# use sudo or doas depending on the permissions of the target directories
$ sudo cp sled /usr/local/bin/ # or somewhere else on your PATH
$ sudo cp sled.1 /usr/local/share/man/man1/ # or somewhere else on your MANPATHTo build the sled binary from source, you need Janet installed on your
system. Then run:
$ git clone https://github.com/pyrmont/sled
$ cd sled
$ git tag --sort=creatordate
$ git checkout <version> # check out the latest tagged version
$ janet --install .Sled requires your Advent of Code session cookie to authenticate with the Advent of Code servers. To get your session cookie:
- log in to Advent of Code
- open your browser's developer tools
- go to the Storage tab
- find the cookie named
session - copy its value to a file (such as
session.txt)
Run sled --help for usage information. The command-line arguments are
explained in more detail in the man page.
Download a puzzle for a specific year and day:
$ sled puzzle --year 2025 --day 1This downloads both the puzzle explanation and your puzzle input. The puzzle explanation is converted from HTML to a text-friendly format.
By default, Sled puts the files for each day into a subdirectory with a name
that matches that day (e.g. ./day01/puzzle.txt and ./day01/input.txt). To
save files without creating any subdirectories, use the --no-subdirs option.
Submit an answer for a specific part:
$ sled answer --year 2025 --day 1 --part 1 <answer>Display your Advent of Code calendar with ASCII art and completion status:
$ sled calendar --year 2025The calendar displays:
- the ASCII art calendar for that year
- gold stars (
**) for puzzles you've completed - ANSI 256 colours
To disable colours:
$ sled calendar --year 2025 --no-colorFound a bug? I'd love to know about it. The best way is to report your bug in the Issues section on GitHub.
Sled is licensed under the MIT Licence. See LICENSE for more details.