PHPackages                             robotusers/commander - 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. robotusers/commander

ActiveLibrary[CLI &amp; Console](/categories/cli)

robotusers/commander
====================

Command Bus abstraction for PHP.

0.3.0(5y ago)298.8k11MITPHPPHP ^7.1|^8CI failing

Since Jul 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/robotusers/commander)[ Packagist](https://packagist.org/packages/robotusers/commander)[ Docs](https://github.com/robotusers/commander)[ RSS](/packages/robotusers-commander/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (1)

Commander
=========

[](#commander)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/e0641005dec5b96db5bd113fa9be4638420d0c34f45ecef6738027d385d014d3/68747470733a2f2f7472617669732d63692e6f72672f726f626f7475736572732f636f6d6d616e6465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/robotusers/commander)[![codecov](https://camo.githubusercontent.com/804c3bd46f45080c4d46d39b44ef5e5481f502df8866ce35ef5b3ff20ec4f324/68747470733a2f2f636f6465636f762e696f2f67682f726f626f7475736572732f636f6d6d616e6465722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/robotusers/commander)

Command Bus abstraction for PHP.

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

[](#installation)

```
composer require robotusers/commander

```

Command Bus abstraction
-----------------------

[](#command-bus-abstraction)

This library provides a `CommandBusInterface` which a command bus should implement.

Using the command bus
---------------------

[](#using-the-command-bus)

```
use Robotusers\Commander\CommandBusAwareInterface;
use Robotusers\Commander\CommandBusAwareTrait;

class OrdersController implements CommandBusAwareInterface
{
   use CommandBusAwareTrait;

   public function makeOrder()
   {
        ...
        $command = new MakeOrderCommand($data);
        $this->handleCommand($command);
        ...
   }

}
```

Adapters
--------

[](#adapters)

The library provides adapters for the most common command bus implementations.

### Tactician

[](#tactician)

```
composer require league/tactician

```

```
use League\Tactician\CommandBus;
use Robotusers\Commander\Adapter\TacticianAdapter;

$commandBus = new CommandBus($middleware);
$adapter = new TacticianAdapter($commandBus);

$controller->setCommandBus($adapter);
```

### SimpleBus/MessageBus

[](#simplebusmessagebus)

```
composer require simple-bus/message-bus

```

```
use Robotusers\Commander\Adapter\SimpleBusAdapter;
use SimpleBus\Message\Bus\Middleware\MessageBusSupportingMiddleware;

$commandBus = new MessageBusSupportingMiddleware();
$adapter = new SimpleBusAdapter($commandBus);

$controller->setCommandBus($adapter);
```

### PSB - ProophServiceBus

[](#psb---proophservicebus)

```
composer require prooph/service-bus

```

```
use Prooph\ServiceBus\CommandBus;
use Robotusers\Commander\Adapter\ServiceBusAdapter;

$commandBus = new CommandBus();
$adapter = new ServiceBusAdapter($commandBus);

$controller->setCommandBus($adapter);
```

### Writing a custom adapter

[](#writing-a-custom-adapter)

You can write your custom adapter. The adapter must implement `Robotusers\Commander\CommandBusInterface`.

```
class MyAdapter implements CommandBusInterface
{
    public function handle($command)
    {
        //handle a command
    }
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~669 days

Total

3

Last Release

1879d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.3.0PHP ^7.1|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ea7e55d797f61a7a0448f1b88cfd5b855e9644c7909af356a82896587926197?d=identicon)[robertpustulka](/maintainers/robertpustulka)

---

Top Contributors

[![robertpustulka](https://avatars.githubusercontent.com/u/7437773?v=4)](https://github.com/robertpustulka "robertpustulka (13 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/robotusers-commander/health.svg)

```
[![Health](https://phpackages.com/badges/robotusers-commander/health.svg)](https://phpackages.com/packages/robotusers-commander)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
