{"id":17302402,"url":"https://github.com/coriolinus/aoctool","last_synced_at":"2025-04-14T12:52:40.321Z","repository":{"id":37103062,"uuid":"324552472","full_name":"coriolinus/aoctool","owner":"coriolinus","description":"Tool handling initialization of a year's Advent of Code puzzles","archived":false,"fork":false,"pushed_at":"2024-04-15T08:09:32.000Z","size":196,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-24T04:13:02.492Z","etag":null,"topics":["hacktoberfest","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coriolinus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-26T12:39:38.000Z","updated_at":"2024-07-23T01:57:35.993Z","dependencies_parsed_at":"2023-02-14T06:15:40.845Z","dependency_job_id":"387d6bf9-6743-4097-a3fe-589309d43ee0","html_url":"https://github.com/coriolinus/aoctool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coriolinus%2Faoctool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coriolinus%2Faoctool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coriolinus%2Faoctool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coriolinus%2Faoctool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coriolinus","download_url":"https://codeload.github.com/coriolinus/aoctool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248885337,"owners_count":21177623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","rust"],"created_at":"2024-10-15T11:47:26.235Z","updated_at":"2025-04-14T12:52:40.291Z","avatar_url":"https://github.com/coriolinus.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `aoctool`: Advent of Code Downloader / Initializer\n\nThe AOC tool is an opinionated and configurable utility for handling the repetitive parts of\nAdvent of Code in Rust.\n\nIt's intended to synergize nicely with my [`aoclib` support library](https://github.com/coriolinus/aoclib/),\nbut there is no requirement that your implementation use that.\n\nThe actual workflow for day 1 of 2021 might look like this:\n\n```bash\n$ # Initialize a new workspace for 2021\n$ aoc init-year --implementation adventofcode-2021 \u0026\u0026 cd adventofcode-2021\nadventofcode-2021$ # Set the session key, acquired from the browser's cookies\nadventofcode-2021$ aoc config set --session \"$SESSION\"\nadventofcode-2021$ # Initialize a new sub-crate called day01 from templates, and download the input file.\nadventofcode-2021$ aoc init\nadventofcode-2021$ # Fill in the day01/src/lib.rs:part1() function body using the editor of your choice. Then:\nadventofcode-2021$ cargo run -p day01\nadventofcode-2021$ # Fill in the day01/src/lib.rs:part2() function body using the editor of your choice. Then:\nadventofcode-2021$ cargo run -p day01 -- --part2 --no-part1\n```\n\nFor each subsequent day, the only command required is `aoc init`.\n\n## Installation\n\nWindows is only supported via WSL.\n\n```sh\ncargo install --git \"https://github.com/coriolinus/aoctool.git\"\n```\n\n## Initial setup\n\nLog in to the AoC site with whatever method you prefer. Then use the browser's dev tools to inspect\nthe cookies. You want the one called `session`. Configure this tool with it, so it can download the\ninputs for you.\n\n```bash\naoc config set --session \"$SESSION\"\n```\n\n### Annual Setup\n\nIf desired, initialize a top-level workspace in the current directory with\n\n```bash\naoc init-year\n```\n\nThat subcommand allows for inline configuration of templates, implementations, etc on a per-year\nbasis. To explore those options:\n\n```bash\naoc init-year --help\n```\n\nThe paths to the day's template files, to the implementation directory, and to the input files can\nall be configured on an annual basis. For details, see\n\n```bash\naoc config set --help\n```\n\nor edit the configuration directly with\n\n```bash\nopen \"$(aoc config path)\"\n```\n\n## Per-day templating\n\n```bash\naoc init\n```\n\nWithin the configured year (if set) or in the current directory, this command will create a new\nsub-crate and add it to the workspace, as well as downloading the problem's input. Inputs are saved\nto a canonical directory. The sub-crate will be named for the day in question, so it can then be run\nlike\n\n```bash\ncargo run -p day01 -- --part2\n```\n\n### Specifying the Templates\n\nBy default, each day's exercise will be initialized with the templates stored [here](https://github.com/coriolinus/aoctool/tree/master/day-template).\nHowever, this behavior can be customized as desired. You can customize the directory where the templates are stored with\n\n```bash\naoc config set --day-templates \u003cpath\u003e\n```\n\nThat path must be a directory containing three files: `Cargo.toml`, `src/lib.rs`, and `src/main.rs`. Those files can contain anything you like.\nThe following expressions are evaluated within the template: `{year}`, `{day}`, `{package_name}`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoriolinus%2Faoctool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoriolinus%2Faoctool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoriolinus%2Faoctool/lists"}