nog is a small Advent of Code helper CLI for managing puzzle workflows from the terminal.
The goal is to reduce friction while solving Advent of Code challenges: authenticate, fetch and cache puzzle inputs, scaffold solution files, run local solutions, and eventually submit or validate answers without constantly switching back to the browser.
Early development. As of v0.3.0, nog includes usable authentication and puzzle-input workflows:
nog auth loginopens a browser-assisted Advent of Code login flow.- Users can log in with their preferred Advent of Code login provider.
nogextracts the Advent of Code session cookie and saves it locally as a normalized session record.nog input YEAR DAYprints the requested puzzle input to stdout.- Puzzle inputs are cached locally and reused without another network request.
- A cached input can be read even when no valid session is currently available.
--forcebypasses the cache and fetches a fresh copy.- Puzzle dates are validated before retrieval.
- Authentication, network, HTTP-response, cache, orchestration, validation, and CLI behavior have automated test coverage.
Puzzle-description fetching, solution scaffolding, running, validation, progress tracking, and answer submission are not implemented yet.
Authenticate with Advent of Code:
nog auth loginRetrieve a puzzle input:
nog input 2024 1Force a fresh download and replace the cached copy:
nog input 2024 1 --forcePuzzle input is written directly to stdout, so it can also be redirected or piped:
nog input 2024 1 > input.txtDevelopment-only authentication:
nog auth login --devThe --dev option is intended for local development and testing. It is not part of the normal user workflow.
By default, nog input:
- validates the requested puzzle date;
- returns the locally cached input when available;
- requires a valid saved Advent of Code session only when a network request is required;
- fetches and caches the input when it is not already available locally;
- prints the input without adding an extra newline.
Use --force to bypass the cache. A valid saved session is required whenever nog must contact Advent of Code.
nog is intended to expand into:
- fetching and caching puzzle descriptions
- generating starter files from language templates
- running local solutions
- submitting or locally validating answers
- tracking local progress by language
- avoiding duplicate or unnecessary submissions
nog new 2024 1
nog run 2024 1
nog submit 2024 1
nog status 2024 1The default workflow should stay simple, with options added over time for manual overrides such as language, puzzle part, or answer value.
Puzzle inputs, cached puzzle text, session records, and other local Advent of Code data should stay local and should not be committed to public repositories.