PHPackages                             friendsofhyperf/closure-command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. friendsofhyperf/closure-command

Abandoned → [hyperf/command](/?search=hyperf%2Fcommand)ArchivedLibrary[CLI &amp; Console](/categories/cli)

friendsofhyperf/closure-command
===============================

The closure command component for Hyperf.

v3.1.0(2y ago)015.5k↓50%MITPHP

Since May 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/friendsofhyperf/closure-command)[ Packagist](https://packagist.org/packages/friendsofhyperf/closure-command)[ RSS](/packages/friendsofhyperf-closure-command/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (92)Used By (0)

closure-command
===============

[](#closure-command)

[![Latest Stable Version](https://camo.githubusercontent.com/d068d43c723acfbf1f926c2d8f806eb13fc8bc0567f0bf6612fa3f2476a75dcf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667269656e64736f666879706572662f636c6f737572652d636f6d6d616e64)](https://packagist.org/packages/friendsofhyperf/closure-command)[![Total Downloads](https://camo.githubusercontent.com/e74ba1b4decfdfe3997f6a3ea43463611ad20fe4f08875892240a452a40993a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667269656e64736f666879706572662f636c6f737572652d636f6d6d616e64)](https://packagist.org/packages/friendsofhyperf/closure-command)[![License](https://camo.githubusercontent.com/4c5d0fef60f9dff656d5b17524d62e4e56456eb4a375587aa9796629820a8970/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f667269656e64736f666879706572662f636c6f737572652d636f6d6d616e64)](https://github.com/friendsofhyperf/closure-command)

The closure command component for Hyperf.

⚠️ This component is deprecated, please use [hyperf/command](https://github.com/hyperf/command) instead.

Installation
------------

[](#installation)

```
composer require friendsofhyperf/closure-command
```

Publish
-------

[](#publish)

```
php bin/hyperf.php vendor:publish friendsofhyperf/closure-command
```

Usage
-----

[](#usage)

- Define ClosureCommand

```
// config/console.php

use FriendsOfHyperf\ClosureCommand\Console;
use FriendsOfHyperf\ClosureCommand\Inspiring;

Console::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->describe('Display an inspiring quote');

Console::command('foo:bar', function() {
    $this->info('Command foo:bar executed.');
})->describe('Description of command foo::bar');
```

- Define AnnotationCommand

```
