Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Adventofcode Cli

Adventofcode Cli Laravel Package

petervanderwal/adventofcode-cli

A Laravel/PHP CLI toolkit for Advent of Code that helps you scaffold daily puzzle classes, manage inputs, and run or test solutions from the command line, streamlining your AoC workflow and keeping puzzle code organized.

View on GitHub
Deep Wiki
Context7

Bundle to help you creating puzzle implementations for Advent of Code

Frequently asked questions about Adventofcode Cli
How do I install petervanderwal/adventofcode-cli in a Laravel application?
Install it with Composer using composer require petervanderwal/adventofcode-cli, and let Laravel package auto-discovery register the service provider. Publish the package configuration so you can set your puzzle year, session token, and solution namespace once instead of per command. No host-application restructuring is needed beyond that, because the integration surface is only the service provider, the published config, and the CLI commands themselves.
Which Laravel and PHP versions does adventofcode-cli support?
The package is a normal Composer dependency, so its composer.json is the authoritative source for the supported PHP and Laravel ranges; check that file or the Packagist page before upgrading. The 1.2.2 patch did not advertise a change to the supported version matrix, but patch releases occasionally pick up a minimum-version bump in CI, so verify after updating. Composer will simply refuse the install if your PHP or framework version falls outside the constraint.
How does the package fetch my personalized Advent of Code puzzle inputs?
It downloads your personalized puzzle input for a given day using your Advent of Code session cookie and caches the result locally, so the same file is not re-fetched on every run. You supply the cookie once through the published configuration. Because inputs are tied to your account, the session token is required rather than a public URL.
How do I configure the year, session token, and solution namespace?
After publishing the config file you set the puzzle year, your Advent of Code session token, and the namespace where generated solution classes should live. Configuring these once means the scaffold, fetch, run, and submit commands all target the same year and the same code location. Keep the token out of version control, ideally by reading it from an environment variable if the repository is shared.
Can I test my solution against the example input before submitting an answer?
Yes. Each puzzle ships with a small example input and expected answer, and the built-in test runner validates your solution against those examples before you spend a submission. Confirm the sample output matches, then submit the real input. This catches parsing and off-by-one errors that would otherwise cost you a wrong-answer penalty.
How does answer submission work and does it post automatically?
A dedicated command posts your computed answer for the selected day and part and prints the server's response, so you get immediate feedback on whether it was correct. Submission is an explicit command rather than something that fires automatically whenever you run your solution. Since Advent of Code rate-limits and penalizes wrong answers, validate against the sample first.
What changed in version 1.2.2 about resubmitting an already solved puzzle?
Version 1.2.2 fixes a defect where the package would resubmit a puzzle that had already been solved. After the fix, a solved puzzle is no longer resubmitted, which is a behavior change rather than a new feature. Check the tagged diff or your own run to confirm what you now see, because the release note does not state whether the new outcome is a rejection, a silent no-op, or a cached prior success.
How do I safely upgrade from an earlier 1.2.x release to 1.2.2?
Pin to ^1.2 and run composer update petervanderwal/adventofcode-cli to move from an earlier 1.2.x to 1.2.2. Inspect the tagged diff to confirm no migration files were added and no published config keys were renamed or given new defaults. Then inventory anything that re-submits a puzzle, such as retry middleware, an offline queue, or an integration test that submits twice, since those flows now observe a different result.
Should adventofcode-cli be used in production or only locally?
Treat it as a local development and puzzle-solving tool rather than a runtime dependency of a deployed application. If you commit the project, keep your session token out of the repository and out of CI logs, because that cookie grants access to your Advent of Code account. To run solution tests in CI, ship cached input fixtures instead of injecting the cookie into the pipeline.
Is adventofcode-cli actively maintained and what are the alternatives?
Alternatives are mostly do-it-yourself: a plain PHP script per day, a generic HTTP client wrapped in artisan commands, or one of the community Advent of Code runner projects in other ecosystems. This package's value is that it handles scaffolding, input caching, and submission while keeping puzzle code in a Laravel-style structure. It is a small, single-maintainer package, so check recent release activity and the GitHub issue tracker before relying on it for a whole season, and read the tagged diff whenever a patch version lands.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console