cerbero/command-validator
Cerbero Command Validator brings Laravel-style validation to Artisan console commands. Define rules for arguments and options, validate input before your command runs, and show clear errors—making CLI tools safer and easier to maintain.
$this->argument() and $this->option() values against Laravel's existing Validator with clear, fail-fast errors) is roughly a trait plus a $rules array. The honest PM framing is: this is a convenience package, not a platform. It buys consistency and a house style, not capability. If your team already writes ad-hoc Validator::make() calls in commands, this is a standardization decision, not a new-feature decision.Consider it when:
Look elsewhere when:
InputArgument/InputOption constraints (REQUIRED, VALUE_IS_ARRAY, VALUE_OPTIONAL) plus your own validation; the package's main value is Laravel's Validator, so off-Laravel you get much less.Validator::make() is clearer than adding a dependency and a layer of indirection to the codebase.Practical recommendation: evaluate against a 1–2 hour spike. Port two existing commands to it, measure whether the error messages and the $rules convention actually improve the on-call experience, and pre-commit to a fork-if-abandoned posture. Given the tiny surface area, the real decision is "do we want a shared convention," and this package is a reasonable, low-cost way to seed one.
To executives / leadership (one paragraph): This is a small, free, open-source utility that makes our internal Laravel command-line tools validate their inputs instead of failing messily or proceeding with bad data. It's low cost and low risk to try, it reduces the chance that an operator typo causes a production incident, and it standardizes how our engineers write operational tooling. It is not a platform bet and does not create meaningful vendor lock-in — the underlying capability is small enough that we can replace or fork it in days if needed. Recommendation: approve a time-boxed pilot on our highest-traffic operational commands, not a company-wide mandate.
To engineering: It reuses Laravel's Validator and message system, so there is nothing new to learn — you declare rules for arguments and options the same way you declare them for form requests, and invalid input fails fast with readable errors before any work happens. The trade-off is an extra dependency with a single maintainer and no downstream users; the mitigation is that the code is small and forkable, and we should pin the version and keep the abstraction thin so removal stays trivial. This is a convention decision more than a technical one — the alternative is a house trait we own, and the package mainly saves us the bikeshedding.
To on-call / operations: Commands will reject malformed input immediately with a plain-English message rather than partially running or failing halfway through with a stack trace. That means safer runbooks, fewer "did it or didn't it run?" moments, and clearer error output to paste into an incident channel.
How can I help you explore Laravel packages today?