This guide walks you through everything you need to run cj81499’s Advent of Code solutions locally. You will need Python 3.13 or later, the uv package manager, and an active Advent of Code account so that theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/cj81499/advent-of-code/llms.txt
Use this file to discover all available pages before exploring further.
aocd library can fetch your personal puzzle inputs automatically.
Install uv
uv is a fast Python package and project manager written in Rust. It replaces pip, virtualenv, and pyenv in a single tool and is the only dependency you need to install manually.After installation, restart your shell (or run Full installation docs are at docs.astral.sh/uv.
source $HOME/.local/bin/env) so that the uv command is on your PATH. Verify with:Clone the repository
Clone the repository from GitHub and change into the project directory:The repository root contains
pyproject.toml, which describes the aoc-cj package and all its dependencies. No additional configuration files are needed.Sync dependencies
Install the project and all its dependencies into a managed virtual environment:After syncing, uv places the virtualenv at
You can skip this step entirely —
uv run creates and syncs the environment automatically the first time you run any command. uv sync is useful when you want to pre-warm the environment or inspect it with an IDE..venv/ in the project root. The environment includes all runtime dependencies (networkx, numpy, z3-solver, etc.) as well as the dev group (mypy, pytest, ruff, and friends).Configure your AOC session token
Puzzle inputs on Advent of Code are user-specific — the If you would rather let This command temporarily adds the
aocd library fetches them automatically using your browser session cookie. Place your token in the expected location:aocd scrape the token directly from your browser’s cookie storage, run:browser-cookie3 package and runs the aocd-token scraper, which reads the session cookie from supported browsers (Chrome, Firefox, etc.) and writes it to ~/.config/aocd/token for you.To find your token manually, log in to adventofcode.com, open your browser’s developer tools, navigate to Application → Cookies, and copy the value of the session cookie.Puzzle input files are not included in this repository — Advent of Code’s rules prohibit redistributing inputs. The
aocd library fetches and caches your personal inputs on demand using the session token. Once fetched, inputs are cached locally so you don’t hit the AoC servers on every run.Run a solution
Each day module has an Expected output (with your personal input):To run the full test suite and verify all solved puzzles against their expected answers:To run tests with coverage reporting:
if __name__ == '__main__': block that fetches your input via aocd and prints both answers. For example, to run the 2024 Day 1 solution:What a Solution Module Looks Like
Every day follows the same pattern: aparse() helper, a part_1() function, an optional part_2() function, and a __main__ block. Here is the complete source for 2024 Day 1 (src/aoc_cj/aoc2024/day01.py):
parse(txt: str)— converts the raw puzzle input string into a convenient data structure.part_1(txt: str) -> int— receives the raw input text (not the parsed form) and returns the answer. This makes each function independently testable.part_2(txt: str) -> int— same signature aspart_1.__main__block — usesaocd.datato fetch the current day’s input (determined from the module’s position in theaoc{YEAR}/day{DD}.pypath) and prints results directly.
aoc_cj.solve(year, day, data) function calls part_1 and part_2 dynamically, which is how the aocd test runner and CI both exercise every solution.