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 Laravel Package

hyperf/command

Hyperf's command component lets you build console applications and Artisan-style commands on the coroutine framework, with argument and option parsing, input/output handling, and seamless integration into Hyperf services.

View on GitHub
Deep Wiki
Context7

Command for hyperf

Frequently asked questions about Command
Can I use hyperf/command in a Laravel application?
It is technically installable via Composer, but hyperf/command is the console component of the Hyperf coroutine framework, not a Laravel package. It expects Hyperf's dependency injection container and hyperf/contract bindings, and several code paths assume a coroutine context that does not exist in a standard Laravel lifecycle. The realistic options are running Hyperf as a separate worker or service, or reading the source purely for design patterns. Laravel teams should keep Artisan for in-application console work.
How do I install hyperf/command with Composer?
You would run composer require hyperf/command, but expect it to pull in hyperf/di, hyperf/support, hyperf/contract and PSR-11 expectations alongside it. Before any design work, run composer why-not hyperf/command 3.2.0 against your actual project constraints on a throwaway branch. Check that the PHP floor, psr/container version and symfony/console major resolve cleanly next to your existing illuminate/container packages.
What is the difference between hyperf/command and Laravel Artisan?
Both sit on top of symfony/console, so command classes, input and output handling, and exit codes feel familiar at first glance. The difference is the runtime: Hyperf's component is coroutine-native, resolves commands through Hyperf's DI container, and supports annotation-based registration. Artisan is bound to Laravel's service container and application bootstrap. The similarity is superficial, and the two are not interchangeable.
How do I register a command class or use annotations in hyperf/command?
The component supports both class-based registration and annotation-based registration of console commands. Command classes are resolved through Hyperf's DI container, arguments and options are declared and validated declaratively, and lifecycle hooks are available around execution. That registration model depends on Hyperf's container being present, so the pattern only transfers to Laravel if you adopt the whole Hyperf runtime.
Which Laravel and PHP versions does hyperf/command support?
There is no Laravel version support to speak of, because the package targets Hyperf 3.x, a separate coroutine framework. The PHP version floor is governed by Hyperf's release line and has historically shifted between minors. Read the composer.json constraint delta for v3.2.0 and check the psr/container and symfony/console major versions before assuming anything about compatibility with your Laravel support matrix.
What changed between hyperf/command v3.1.56 and v3.2.0?
The v3.2.0 release notes contain only an auto-generated compare link, with no changelog body, feature list, deprecation notice or breaking-change callout. A jump from a long patch line to a new minor is exactly where PHP floor raises and symfony/console major bumps have landed in the past. Treating the release as additive because it is a minor version is an unsupported inference. Read the compare diff and composer.json delta before making any adoption decision.
Does hyperf/command require Swoole or a coroutine context?
Hyperf is a coroutine-native runtime built on Swoole or Swow, and several command code paths assume a coroutine scheduler is present. Outside that context, coroutine-only APIs can silently no-op or fault. Verify per command whether anything in the new minor requires coroutine context before you assume plain CLI execution is safe.
How do I define arguments, options and validation in hyperf/command?
Arguments and options are declared on the command class and parsed and validated by the component before your handle logic runs. Output helpers cover styled output, tables, progress bars and interactive prompts through a consistent framework-integrated API. Because the API mirrors Symfony Console conventions, Symfony documentation is a reasonable reference point. Confirm the specifics against the Hyperf documentation for the exact version you are evaluating.
Can Laravel Artisan and Hyperf commands run in the same PHP process?
Running two command kernels in one process means two containers with overlapping singleton semantics, which is a known source of silent resolution bugs. It is only feasible when Hyperf runs as a separate service or worker and the boundary between the systems is an HTTP or queue call rather than shared memory. Keep Artisan inside Laravel and give Hyperf its own process.
Is hyperf/command safe to use in production?
It is safe only inside a Hyperf runtime, and only after the v3.2.0 diff and constraint changes have been reviewed. The main risks are container duality if co-hosted with Laravel, coroutine-only APIs used outside a scheduler, version-floor drift cascading into your Laravel support matrix, and lock-in to a fast-moving single-vendor minor line. Also confirm how long the v3.1.x line will continue to receive security patches.
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.
vento/laravel-airbrake
wfeller/laravel-batch
maco-studios/mage-os-installer
busarm/armie
siberfx/laravel-logger
kfteam1991/dcat-admin
dashed/dashed-laposta
dashed/dashed-ecommerce-montaportal
dashed/dashed-ecommerce-etsy
neohq/string-blade-compiler
log1x/acf-composer
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager