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

Command Validator Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Investing in CLI surface area vs. leaving it as "best effort." If your product exposes operational or admin workflows through Artisan commands — bulk imports, data backfills, tenant provisioning, report generation, cache/index rebuilds — this package lets you raise the quality bar on that surface cheaply. It supports a roadmap decision like "make internal tooling first-class" without a dedicated epic.
  • Build vs. buy on internal DX. The capability itself (validate $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.
  • Standardizing command hygiene across services. In a multi-service Laravel estate, inconsistent CLI input handling means inconsistent failure modes: some commands throw a 400-line stack trace on a typo'd argument, others silently proceed with a default. Adopting one validation convention reduces the blast radius of operator error and makes runbooks predictable. This is the strongest product argument for it.
  • Supporting safer operational runbooks. When on-call engineers execute commands under pressure, fail-fast validation with readable messages is a real reduction in incident risk (wrong environment argument, malformed date, typo'd batch size).
  • Deprioritizing custom CLI UX work. It supports the decision "we will not build a bespoke CLI validation framework," which is usually the right call — but it also implies you accept a very thin, single-maintainer dependency in your stack.
  • Feature-level use cases: admin/ops commands, scheduled-job entry points that take parameters, developer-facing scaffolding, and any command that is invoked by humans rather than only by code.

When to Consider This Package

Consider it when:

  • You run a Laravel application (or several) with a non-trivial number of custom Artisan commands that accept arguments or options from humans.
  • Your team already knows Laravel's validation rules and messages — the mental model transfers directly, so adoption cost is near zero.
  • You want a consistent, low-ceremony convention across commands rather than every developer inventing their own guard clauses.
  • You are comfortable with a small, MIT-licensed utility dependency: single maintainer, modest adoption (~220 stars), zero downstream dependents. That combination is fine for a convenience library, but it means you should be prepared to vendor/fork it if it goes stale. The code surface is small enough that forking is a realistic, cheap contingency.
  • You are optimizing for developer experience and consistency rather than raw functionality.

Look elsewhere when:

  • You are not on Laravel, or you are on a non-Console-driven interface. For plain Symfony Console there are native 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.
  • Your command count is small (say, under five). Inline Validator::make() is clearer than adding a dependency and a layer of indirection to the codebase.
  • You need guarantees: SLAs, active maintenance, security patching commitments, or a track record of dependents. Zero dependents and a single maintainer are genuine supply-chain signals, and for a package embedded in operational tooling those signals matter more than they would for a dev-only nicety.
  • Your validation needs are exotic — cross-field rules are easy with Laravel's Validator, but anything requiring custom lifecycle hooks, async checks, or command-level authorization may be better served by a small in-house abstraction you own outright.
  • You are actively reducing dependency count or enforcing a dependency-review policy that a thin, low-traffic package will struggle to pass.

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.

How to Pitch It (Stakeholders)

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.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource