Rusty Sleigh is a command-line interface (CLI) tool designed to streamline your Advent of Code experience. It automates fetching inputs and articles, creating solution templates, running solutions, and submitting answers.
- Fetch Inputs: Automatically download puzzle inputs.
- Fetch Articles: Retrieve and format the problem description.
- Generate Solution Templates: Create structured Rust projects for each day.
- Run Solutions: Build and execute your solution code.
- Submit Answers: Automatically submit your answers and parse the response.
git clone https://github.com/Dheebz/rusty-sleigh.git
cd rusty-sleigh
-
Build the project:
cargo build --release
-
Install globally (optional):
sudo cp target/release/rusty-sleigh /usr/local/bin/
-
Verify installation:
rusty-sleigh --help
Rusty Sleigh uses a configuration file to manage paths and authentication.
-
Create a config file at
~/.config/rusty-sleigh/config.toml
if it doesn't exist. The tool will auto-generate a default one if missing. -
Example
config.toml
:[session_cookie] session_cookie = "<your-session-cookie>" [inputs] path = "~/Workspace/advent-of-code/input" [articles] path = "~/Workspace/advent-of-code/articles" [solution] path = "~/Workspace/advent-of-code/solutions/rust"
-
Set the Session Cookie:
- Log in to Advent of Code, and retrieve your session cookie from browser developer tools.
Command | Description |
---|---|
run |
Build and execute solutions. |
submit |
Submit answers to Advent of Code. |
fetch-input |
Download puzzle input. |
fetch-article |
Fetch and format problem descriptions. |
create-solution |
Generate Rust solution templates. |
prep-day |
Combines input, article fetch, and solution generation. |
rusty-sleigh fetch-input --year 2023 --day 1
rusty-sleigh fetch-article --year 2023 --day 1
rusty-sleigh create-solution --year 2023 --day 1
Fetch input, fetch article, and generate solution files in one step:
rusty-sleigh prep-day --year 2023 --day 1
rusty-sleigh run --year 2023 --day 1 --part 1
rusty-sleigh submit --year 2023 --day 1 --part 1 --answer 42
Alternatively, omit --answer
to use the solution's output:
rusty-sleigh submit --year 2023 --day 1 --part 1
Feel free to fork the repository, create pull requests, or submit issues to improve Rusty Sleigh!
MIT License