Go Package + CLI Tool for interacting with Advent of Code workflows
31
stars
199
commits
Go
primary language
Feb 26, 2026
updated
aocGo!aocGo is a two part project. It is not an official Advent of Code project, merely my take on some ways to enhance the workflow.
Definitely go support the official project, especially since this project would be useless without it.
aocgoThe first encompasses the go module of the same name. This module contains a main package with some functions for obtaining input for a given day based on the file's directory structure. It also contains an aocutils sub-package, containing some helpful functions for common things you might need when solving AoC puzzles. If you want to handle all of that yourself, don't worry about importing this.
This module should be imported using go get go.dalton.dog/aocgo.
Example:
// Example file/dir structure:
// 2015/1/main.go
package main
import "go.dalton.dog/aocgo"
func main() {
// Get your input data as a string, exactly as the input has it
var inLine string = aocgo.GetInputAsString()
// Get your input data as an array of strings, created by splitting input on newline characters
var inLnArr []string = aocgo.GetInputAsLineArray()
// Get your input data as an array of bytes, where each element is a single byte of the input
var inByteArr []byte = aocgo.GetInputAsByteArray()
}
aocliThe second, and more expansive, is a CLI application called aocli that can be used to interact with the Advent of Code workflow without leaving your terminal.

It can currently do all of the following:
Check out the directory's specific README for detailed documentation!
You should install the program via this repo's 'Releases' page. There are standalone binaries for Windows, Linux, and Mac, and the program has a built-in updating system. Just put the executable in a directory on your PATH and you're good to go.
All you need for this to work is the cookie session token of the user you'd like to use to interface with Advent of Code.
Storage tab.

Storage tab open, double click the value to select it, and copy it.

~/.config/aocgo/session.tokenAOC_SESSION_TOKEN environment variableIf you choose to use the environment variable method, make sure to include a line to set it in your shell's startup script.
From there, you should be good to go! If you installed the CLI program, you can run aocli health to verify that everything loaded properly.

© 2024 Dalton Williams
Check repository LICENSE file for licensing information.
Go
100.0%
Go Package + CLI Tool for interacting with Advent of Code workflows
31
stars
199
commits
Go
primary language
Feb 26, 2026
updated
aocGo!aocGo is a two part project. It is not an official Advent of Code project, merely my take on some ways to enhance the workflow.
Definitely go support the official project, especially since this project would be useless without it.
aocgoThe first encompasses the go module of the same name. This module contains a main package with some functions for obtaining input for a given day based on the file's directory structure. It also contains an aocutils sub-package, containing some helpful functions for common things you might need when solving AoC puzzles. If you want to handle all of that yourself, don't worry about importing this.
This module should be imported using go get go.dalton.dog/aocgo.
Example:
// Example file/dir structure:
// 2015/1/main.go
package main
import "go.dalton.dog/aocgo"
func main() {
// Get your input data as a string, exactly as the input has it
var inLine string = aocgo.GetInputAsString()
// Get your input data as an array of strings, created by splitting input on newline characters
var inLnArr []string = aocgo.GetInputAsLineArray()
// Get your input data as an array of bytes, where each element is a single byte of the input
var inByteArr []byte = aocgo.GetInputAsByteArray()
}
aocliThe second, and more expansive, is a CLI application called aocli that can be used to interact with the Advent of Code workflow without leaving your terminal.

It can currently do all of the following:
Check out the directory's specific README for detailed documentation!
You should install the program via this repo's 'Releases' page. There are standalone binaries for Windows, Linux, and Mac, and the program has a built-in updating system. Just put the executable in a directory on your PATH and you're good to go.
All you need for this to work is the cookie session token of the user you'd like to use to interface with Advent of Code.
Storage tab.

Storage tab open, double click the value to select it, and copy it.

~/.config/aocgo/session.tokenAOC_SESSION_TOKEN environment variableIf you choose to use the environment variable method, make sure to include a line to set it in your shell's startup script.
From there, you should be good to go! If you installed the CLI program, you can run aocli health to verify that everything loaded properly.

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