๐Ÿ“ฆ tranzystorekk / arrive

Simple CLI tool for interacting with Advent of Code

โ˜… 5 stars โ‘‚ 0 forks ๐Ÿ‘ 5 watching โš–๏ธ MIT License
advent-of-codeclirust
๐Ÿ“ฅ Clone https://github.com/tranzystorekk/arrive.git
HTTPS git clone https://github.com/tranzystorekk/arrive.git
SSH git clone git@github.com:tranzystorekk/arrive.git
CLI gh repo clone tranzystorekk/arrive
tranzystorekk tranzystorekk chore(version): release 0.4.2 46e4629 1 months ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ build.rs
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ CHANGELOG.md
๐Ÿ“„ cliff.toml
๐Ÿ“„ justfile
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ README.md

Arrive

GitHub release (latest SemVer) Crates.io

About

A simple tool to fetch your Advent of Code input and submit your solutions.

Key features and goals:

  • keeps your current AOC day selection and solution status in a TOML state file (for human readability)
  • caches input files to ease load on AOC servers
  • reasonably minimal dependencies
Directories used (see dirs for more info):

DescriptionPath
Cache${XDG_CACHE_HOME}/arrive or ${HOME}/.cache/arrive
State${XDG_STATE_HOME}/arrive or ${HOME}/.local/state/arrive

Installation

Arch Linux:

Arrive is available on the AUR as arv. You can install it with your preferred AUR helper. Example:

paru -S arv

Via Cargo:

cargo install --locked arrive

From source:

git clone https://github.com/tranzystorekk/arrive.git
cargo install --path arrive

Usage

Set a new session token (see Token section):

arv token set <token>

Print currently stored session token:

arv token show

Select currently processed advent day:

arv select -y <year> -d <day>

Show current selection and day completion status:

arv status

Print input for current selection:

arv input

Save input to file:

arv input > path/to/file.txt

Submit advent solution for current selection. If <solution> is omitted, STDIN is read instead.

arv submit [<solution>]

Token

For the web commands (arv input, arv submit) to work, a valid AOC session token needs to be supplied to arv token set.

To obtain such a token, do the following:

  • Login to AOC:
  • In your browser, open the developer tools
  • Navigate to Storage -> Cookies
  • Find and copy the entry named session
  • Run arv token set <token>
These tokens have long expiration dates, so you can typically set-and-forget once.

Acknowledgements

Deeply inspired by aocf!