A simple tool for scaffolding Advent of Code tasks
Advent of Code is fun, but setting up tasks every day can be tedious. scaf simplifies this by automating the setup, letting you focus on solving puzzles. It does this by fetching task info directly from the website and creating a directory structure and files for the task, including the input data file. You can select from multiple languages, as long as there is a template for that.
Install scaf globally using npm to make it accessible as a CLI tool:
npm install -g @szymmis/scaf
- Go to the Advent of Code website and login
- Open browser devtools and copy
session
cookie value - Use
scaf login
command or setup the env variableSCAF_TOKEN=<value>
in your shell
Use the init command to create a new task's folder and files for a specific day and programming language:
scaf init <lang> <year>/<day>
lang
: The programming language you want to use (e.g.,go
,rust
,py
).year/day
: The Advent of Code year and day to scaffold (e.g.,2023/01
).
When you’re ready to tackle part two of the day's puzzle, use the advance
command:
scaf advance <year/day>
year/day
: The year and day of the task you're advancing (e.g.,2023/01
).
This command generates the necessary files or updates your workspace to prepare for solving part two.