#advent #code #cli #tool #helper

bin+lib aocf_cli

CLI helper tool for Advent of Code, with a workflow similar to Git

13 releases

0.1.21 Dec 19, 2022
0.1.18 Dec 11, 2021
0.1.15 Nov 21, 2021
0.1.13 Dec 15, 2020
0.1.1 Jan 12, 2020

#2147 in Command line utilities

Download history 3/week @ 2022-11-21 22/week @ 2022-11-28 9/week @ 2022-12-05 25/week @ 2022-12-12 31/week @ 2022-12-19 2/week @ 2022-12-26 4/week @ 2023-01-02 16/week @ 2023-01-09 6/week @ 2023-01-16 23/week @ 2023-01-23 25/week @ 2023-01-30 21/week @ 2023-02-06 65/week @ 2023-02-13 14/week @ 2023-02-20 2/week @ 2023-02-27 2/week @ 2023-03-06

83 downloads per month

ISC and GPL-3.0+

937 lines

aocf_cli - Advent of Code fetch CLI


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.

Option flags

Time based flags

  • --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.

Viewing flags

  • --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.

Retrieval flags

  • --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.


~746K SLoC