Command-line tool and Go parse helpers for Advent of Code.
The CLI scaffolds a day's solve.go / solve_test.go, downloads the puzzle spec and input, extracts example cases, and can submit answers. The parse package is the shared input helpers used by KasimKaizer/advent_of_code.
go install github.com/KasimKaizer/aoc-cli/cmd/aoc@latest| Variable | Required | Description |
|---|---|---|
AOC_SESSION |
yes | Session cookie from adventofcode.com |
AOC_PATH |
yes | Root of the solutions repo (year/day folders are created here) |
AOC_MODULE |
no | Go module path written into generated tests. Defaults to github.com/KasimKaizer/advent_of_code |
aoc -y 2024 -d 7
aoc --help| Flag | Short | Description |
|---|---|---|
-year |
-y |
Event year (default: current year) |
-day |
-d |
Event day (default: current day) |
-submit |
-s |
Submit an answer |
-part |
-p |
Puzzle part, 1 or 2 (default: 1) |
-answer |
-a |
Answer to submit |
import "github.com/KasimKaizer/aoc-cli/parse"Helpers include ToString, ToStringSlice, ToIntMatrix, and Opener implementations (NewFileOpener, NewTextOpener) for tests.
MIT