PHPackages                             d2g/reactor - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. d2g/reactor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

d2g/reactor
===========

v0.2.0(9y ago)147.8kPHPPHP &gt;=5.4

Since Feb 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/DimitriGilbert/Reactor)[ Packagist](https://packagist.org/packages/d2g/reactor)[ RSS](/packages/d2g-reactor/feed)WikiDiscussions master Synced 2w ago

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

\#Command line micro-framework in php

why another cli tool ?
----------------------

[](#why-another-cli-tool-)

Because i did not find anything simple enough to use. This is, in my opinion, quiet simple and will handle most of the nee i can think of concerning cli.

Create your command line
------------------------

[](#create-your-command-line)

### extend reactor command class

[](#extend-reactor-command-class)

```
class Mycommand extends \D2G\Reactor\Command
```

### define your methods and required argument/options

[](#define-your-methods-and-required-argumentoptions)

```
function __construct($args, $opts, $flags)
{
    parent::construct($args, $opts, $flags);
    $this->commands = array(
        '__DEFAULT__'=>'__help',
        // the name of your method
        'my_method'=>array(
            // defining expected inputs
            'expecting'=>array(
                // defining expected arguments
                'args'=>array(
                    array(
                        // used in error message
                        'name'=>'my-argument',
                        // internal function will try to cast the argument to this type
                        'type'=>'type of argument',
                        // command will fail if an expected argument is not present
                        'required'=>true|false
                    )
                ),
                // defining expected options
                'opts'=>array(
                    // option name used in cli prefixed with --
                    'option-name'=>array(
                        // internal function will try to cast the argument to this type
                        'type'=>'string',
                        // command will fail if an expected argument is not present
                        'required'=>true|false
                        // default value assigned to the options if not given
                        'default'=>''
                    )
                )
                // defining expected flags
                'args'=>array(
                    array(
                        // flags
                        'a',
                        'longflag'
                    )
                ),
            ),
        )
    );
}
```

Usage
-----

[](#usage)

### Basic

[](#basic)

on \*nix

```
[php ][vendor/bin/]reactor Your/Command/Class/FQN/With/Slashes:yourCommandMethod firstArg secondArg --myOption=myOptionValue --myOtherOpt="value encapsed" -longFlag -a
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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 ~355 days

Total

3

Last Release

3438d ago

PHP version history (2 changes)0.1.x-devPHP &gt;=5.3.3

0.x-devPHP &gt;=5.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/729282?v=4)[Dimitri Gilbert](/maintainers/DimitriGilbert)[@DimitriGilbert](https://github.com/DimitriGilbert)

---

Top Contributors

[![DimitriGilbert](https://avatars.githubusercontent.com/u/729282?v=4)](https://github.com/DimitriGilbert "DimitriGilbert (25 commits)")

### Embed Badge

![Health badge](/badges/d2g-reactor/health.svg)

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

###  Alternatives

[markstory/mini-asset

An asset compression library. Provides file concatenation and a flexible filter system for preprocessing and minification.

63770.7k3](/packages/markstory-mini-asset)[kubotak-is/php-del

Tool to remove code based on specific comments.

1648.6k](/packages/kubotak-is-php-del)[yii2mod/yii2-scheduling

Scheduling extension for Yii2 framework

1630.3k1](/packages/yii2mod-yii2-scheduling)[lochmueller/seocli

SEO CLI Tool

1013.4k](/packages/lochmueller-seocli)

PHPackages © 2026

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