aocli

command
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

README

Welcome to aocli

aocli is a command line with the goal to provide a snappy, pretty, and functional way to interact with the entire Advent of Code workflow without ever leaving your terminal.

It is implemented with rate limiting and local caching to ensure we're not hitting the servers more often than necessary.

Cached information is stored in ~/.cache/aocgo/<session_token>.db.

Available Commands

Syntax Example: aocli command_name <RequiredParam> [OptionalParam] -optionOne valueOne -x

help

Prints out help for the program or for a specific command. If no parameter is specified, all available commands are printed. If a command is specified, command-specific help will be printed out.

Syntax: aocli help [command]

get

Allows you to get the user input for a given year and day. Can be passed in as parameters. If not passed in, will attempt to be derived from the current directory.

Syntax: aocli get [year] [day]

aocli get demo

view

Allows you to view the puzzle page for a given year and day. Can be passed in as parameters. If not passed in, will attempt to be derived from the current directory.

Syntax: aocli view [year] [day]

aocli view demo

leaderboard

Allows you to view the leaderboard for a given year, or given year + day. Passed in as parameters.

Syntax: aocli leaderboard <year> [day]

aocli leaderboard demo

user

Loads all available information for the available user. This essentially runs view on every puzzle, but doesn't visualize the puzzle itself. Counts all the user's stars across the days and years, and displays that in a table.

Syntax: aocli user

aocli user demo

submit

Submits an answer to a puzzle. The year, day, and part are NOT presently able to be specified, and will use the directory structure naming to derive the year and day. The part to submit to will be determined by the current state of the puzzle. For example, if the puzzle already has a correct answer 1, then it will submit to answer 2.

Submission validation is in place as well, preventing you from submitting obviously incorrect errors. For example, you can't submit previously submitted answers, nor can you attempt to submit the answer to part 1 for part 2.

Syntax: aocli submit <answer>

version

Will print out the latest version. Will also check the latest GitHub repo release to see if there's a new version available.

Syntax: aocli version

update

Will attempt to download and install the newest version of aocli in-place, if there is one newer.

Syntax: aocli update

reload

Will reload the contents of the puzzle page for a given year and day. Can be passed in as parameters. If not passed in, will attempt to be derived from the current directory.

Syntax: aocli reload [year] [day]

clear-user

Will clear the stored information for the user in the session token file, or AOC_SESSION_TOKEN environment variable.

You can also just manually delete the database file if you want. This file is located in ~/.cache/aocgo/<session_token>.db

Syntax: aocli clear-user

Licensing

© 2024 Dalton Williams Check repository LICENSE file for licensing information.

Documentation

Overview

`Aocli` allows you to interface with Advent of Code workflows without leaving your terminal. This command is *NOT* Go-specific and can be used with any language for solving.

This command is *NOT* intended to be installed or updated as part of the parent module. Though part of the parent module, that is for central code sharing purposes. Aocli has self-updating capabilities that can/should be used to keep it up-to-date. Otherwise, you can find and install the latest version by checking the GitHub Releases

Usage:

aocli <command> [flags...]

Available commands are:

get --------- Get the user input for a given year and day and save it to a local file
health ------ Checks to see if the system has valid configuration in place to successfully run the program
help -------- Shows the help information for a specific command
leaderboard - Shows the leaderboard for the given year, or given year and day
reload ------ Refresh the page data for the puzzle on a given year and day
submit ------ Submit a puzzle answer for a given year and day
user -------- View the stars obtained for the current user
view -------- Pretty print the puzzle for a given day

Any commands that rely on a year and day will attempt to derive those values from the names of the current directory and the parent directory. If those can't be properly derived, or you wish to run the command for another date, you can pass those in manually.

Run aocli help `<command>` for more information on a specific command.

Get puzzle input for default session token

Usage:

aocli get [year] [day]

This will automatically download the input into the current working directory to a file called 'input.txt'.

Check that enough config is in place to run the program

Usage:

aocli health

This will check that there is a valid session token in the environment to use for AoC requests. The AOC_SESSION_TOKEN environment variable will be checked, as will the ~/.config/aocgo/session.token file.

Display the leaderboard for a given year

Usage:

aocli leaderboard <year> <day>

This will display the leaderboard for the given year, or a given year and day, in a scrollable table.

View the puzzle information for a given day and year

Usage:

aocli view [year] [day]

This will display the page information about a puzzle. This includes the title, the description, any correct answers for the current user, as well as successfully loading Part B once it's unlocked.

Refresh the puzzle information for a given day and year

Usage:

aocli refresh [year] [day]

Submit an answer for a day and year, SOLELY determined by the CWD directory structure

Usage:

aocli submit <answer>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL