A CLI helper tool for Advent of Code.
This is a wrapper around the aocf
crate, and freely interoperates with it if
needed.
cargo install aocf_cli
Or from source:
git clone https://github.com/aocf
cd aocf/aocf_cli
cargo install --path .
The tool will now be available as aocf
for the user who ran this command. The
cargo binary install path provided after cargo completes may need to be added
to your shell's PATH
variable.
Initialise an aocf repository, similar to how you would initialise a git
repository. Data and configuration for aocf is kept in ./.aocf
.
Write the cookie into cache using provided session cookie string.
Extract your session cookie from the Firefox cookie store. You should have
previously logged in to Advent of code using Firefox. This command will then
set the cookie as with set-cookie
.
Move to a given day, and optionally year. May be combined with --now
.
Fetch input and brief for the current day.
Show the brief for the currently checked out day.
Print the currently checked out day's input.
Show the current status (for the currently checked out day).
Show a summary of all challenges which exist in the cache, and stars achieved,
for a given challenge year. The year shown is either the currently checked out
year, or the year provided by the --year
command line option.
Generate a shell completion script. Supported shells are Bash, Zsh, Fish, Powershell, Elvish.
Get help on command usage, for a given subcommand.
--now
--year
--day
These can be used to override the current day or year used when fetching, or other commands. Generally commands will get the day and year from the root configuration if it exists, and these are not provided.
--view
If no flags are given, aocf
will generally output content on standard output
or stderr; if --view
is provided, output will be piped to the pager programme
specified in the root configuration (.aocf/config
) as e.g. pager = "less"
.
--pretty
Only available for the brief
subcommand, pretty formats the challenge brief
in a similar format to viewing on the Advent of Code website, in a scrollable,
pager fashion.
--web
Only available for the brief
subcommand, opens the brief in a web browser.
--force
This will force retrieval from the AoC site, even if a cache exists already for the current day/problem part.
The cache for data for each day is stored as JSON under .aocf/cache
.