MatteoGisondi / aoc-cli

Advent of Code CLI client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent of Code CLI (WIP)

This is a work in progress

License: MIT Code style: black

Python based unofficial CLI client for Advent of Code.

Requirements

  • python >= 3.8

Install

pip install aoc-cli

Login

aoc login

Alternatively

aoc login -u `username` -p `password`

Get

aoc get  # for current day's problem

Alternatively

aoc get -y 2022 -d 1 -p 1

There are some convenience tools here:

You can output to a file instead of stdout with the -o flag. Tip: don't specify an output file and aoc-cli will use the default ./problems/{year}/{day}/description.txt for description and ./problems/{year}/{day}/.in for input. By default both are pulled.

Submit

aoc submit -i answer

Alternatively

aoc submit -f path_to_answer_file

Info

In general, for all use cases use --help to print out all options for any subparser

aoc --help
aoc get --help
aoc submit --help
aoc input --help

Currently, only github authentication is implemented - and now so is GitHub 2FA! See login instructions to store a .cookies file. This will save a session key for Advent of Code, not Github. Even if it is stolen, it should only grant temporary access to you account on AOC. I haven't tested what happens when the session expires - it can most likely be fixed by logging in again.

The cookies are stored as pickle of a requests.Session.cookies object. In theory any login method should work as long as it generates the session cookie as done by a browser.

About

Advent of Code CLI client

License:MIT License


Languages

Language:Python 99.0%Language:Shell 1.0%