Skip to content

Rust Advent of Code Utility for Fetching, Running and Submitting Advent of Code Solutions

License

Notifications You must be signed in to change notification settings

Dheebz/rusty-sleigh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty Sleigh - Advent of Code CLI Tool

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.


Features

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

Getting Started

Clone the Repository

git clone https://github.com/Dheebz/rusty-sleigh.git
cd rusty-sleigh

Build and Deploy

  1. Build the project:

    cargo build --release
  2. Install globally (optional):

    sudo cp target/release/rusty-sleigh /usr/local/bin/
  3. Verify installation:

    rusty-sleigh --help

Configuration

Rusty Sleigh uses a configuration file to manage paths and authentication.

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

  2. 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"
  3. Set the Session Cookie:

    • Log in to Advent of Code, and retrieve your session cookie from browser developer tools.

Usage

Commands Overview

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.

Examples

Fetch Input

rusty-sleigh fetch-input --year 2023 --day 1

Fetch Article

rusty-sleigh fetch-article --year 2023 --day 1

Create Solution Template

rusty-sleigh create-solution --year 2023 --day 1

Prepare a Day

Fetch input, fetch article, and generate solution files in one step:

rusty-sleigh prep-day --year 2023 --day 1

Run a Solution

rusty-sleigh run --year 2023 --day 1 --part 1

Submit an Answer

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

Contributing

Feel free to fork the repository, create pull requests, or submit issues to improve Rusty Sleigh!


License

MIT License

About

Rust Advent of Code Utility for Fetching, Running and Submitting Advent of Code Solutions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages