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

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

commander/core
==============

container-interop aware command-bus

1.0.0(9y ago)116MITPHP

Since Dec 1Pushed 9y ago2 watchersCompare

[ Source](https://github.com/geggleto/commander)[ Packagist](https://packagist.org/packages/commander/core)[ RSS](/packages/commander-core/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Commander
=========

[](#commander)

Micro-Service Command/Event Framework

Commander maps a HTTP Request to a Command Handler and listens for Framework Events.

How to use
----------

[](#how-to-use)

1. Write a Command Handler

    - Make sure to Fire `CompletedEvent`
    - Make sure to Fire `ErrorEvent`
2. Tell commander what end-point the handler is for
3. Do something with your Event

Use Cases
---------

[](#use-cases)

Currently we only support JSON APIs.

Simple Example
--------------

[](#simple-example)

```
$commander = new Commander();
$this->commander->get('/user/{id}', 'user.cache.get', SimpleGetUserHandler::class);
$commander->run();

//In SimpleGetUserHandler
class SimpleGetUserHandler extends Handler
{
    /**
     * @param CommandInterface $command
     */
    public function handle(CommandInterface $command)
    {
        $this->eventBus->notify(CompletedEvent::makeEvent(['id' => '1'])); //fill in the user info
    }
}
```

Why ??
------

[](#why-)

- CQRS!
- Less Boilerplate.
- Greater Testability.
- No Controllers or Controller Actions...
- Better Resource Usage

Framework Events
----------------

[](#framework-events)

You can subscribe to the following Framework Events

- Framework.Complete

    - This event is raised when the response has been completed
    - Payload: `User Defined`
- Framework.Error

    - This event is raised if there has been an error somewhere
    - Payload: `User Defined` or Framework Errors are `["message" => "..."]`
- Framework.CommandBus.Handle

    - This event is fired when a Command Handler is about to be executed
    - Payload: `[CommandKey]`
- Framework.Invoke

    - This event is fired when a Command is about to be fired to the command bus
    - Payload: `["commandKey" => "", "commandClass" => ""]`
- Framework.EventBus.Notify

    - This event is fired when an Event is about to be sent to the EventBus.
    - Will not propagate Framework.EventBus.Notify's
    - Payload: `callable... [$object, "method"]`

Todo
----

[](#todo)

- Event Payloads
    - JsonPayload
    - TextPayload
    - XMLPayload

Contributors
------------

[](#contributors)

- Glenn Eggleton

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3451d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f941aecd52e3f8ac94dbe9b714801c7adc767acc32644d3ee6a4efeded84c5e?d=identicon)[geggleto](/maintainers/geggleto)

---

Top Contributors

[![geggleto](https://avatars.githubusercontent.com/u/4027602?v=4)](https://github.com/geggleto "geggleto (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)
