PHPackages                             corex/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. corex/command

Abandoned → [symfony/console](/?search=symfony%2Fconsole)Library[CLI &amp; Console](/categories/cli)

corex/command
=============

Command Framework

2.1.2(8y ago)073MITPHPPHP &gt;=5.6.4

Since Sep 5Pushed 7y agoCompare

[ Source](https://github.com/corex/command)[ Packagist](https://packagist.org/packages/corex/command)[ RSS](/packages/corex-command/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (23)Used By (0)

CoRex Command
=============

[](#corex-command)

Command Framework for php.

[![License](https://camo.githubusercontent.com/af2b45acb65eb390782517a0f99d32cc4099e777096c5afd5ba4cb39c1b9bf9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f7265782f636f6d6d616e642e737667)](https://camo.githubusercontent.com/af2b45acb65eb390782517a0f99d32cc4099e777096c5afd5ba4cb39c1b9bf9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f7265782f636f6d6d616e642e737667)[![Build Status](https://camo.githubusercontent.com/0d072469081b8803187dd7e8d35aa89389f962345918dbad0a90300e67147c34/68747470733a2f2f7472617669732d63692e6f72672f636f7265782f636f6d6d616e642e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/0d072469081b8803187dd7e8d35aa89389f962345918dbad0a90300e67147c34/68747470733a2f2f7472617669732d63692e6f72672f636f7265782f636f6d6d616e642e7376673f6272616e63683d6d6173746572)[![codecov](https://camo.githubusercontent.com/a5b69f5f7bce618bf4f28d6739e16269fa33f8954c5f59301fe4f8c799ca243b/68747470733a2f2f636f6465636f762e696f2f67682f636f7265782f636f6d6d616e642f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://camo.githubusercontent.com/a5b69f5f7bce618bf4f28d6739e16269fa33f8954c5f59301fe4f8c799ca243b/68747470733a2f2f636f6465636f762e696f2f67682f636f7265782f636f6d6d616e642f6272616e63682f6d61737465722f67726170682f62616467652e737667)

You will recognize some familiar patterns i.e. signature from Laravel but with additional properties. This is for future use in other frameworks and CMS'es.

Run "php crcmd" to see list of available commands.

Run "php crcmd help make:shortcut" to create a shortcut in current directory. This file can be modified to suit your needs i.e. disabling internal commands. If you specify --command, you will be able to make a shortcut for a specific command.

Every command created must end in "Command.php" i.e. "MyCommand.php". Otherwise it will not be added to list of available commands.

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

[](#installation)

- Run "composer require corex/command".

Commands (internal).
--------------------

[](#commands-internal)

- make:command - This command creates commands.
- make:shortcut - This command creates a shortcut in current directory.
- json:delete - Delete key.
- json:get - Get key.
- json:set - Set key in json.

Documentation for command
-------------------------

[](#documentation-for-command)

Look at existing commands to see example. Source can be found in vendor package.

### Properties

[](#properties)

#### $component

[](#component)

Every command belongs to a component. This property specifies the name of component. Must be specified in lowercase. This can be set to an empty string and will then be a "main"-command (no component).

#### $signature

[](#signature)

This signature describes the arguments and options of the command. It follows the same setup as Laravel 5.

Format is "command {argument/--option : description} {argument/--option : description}"

- Part 1 "command" is the name of the command. Must be specified in lowercase.
- Part 2 "{argument/--option : description}" is the format of arguments and options. Can be specified multiple times. Each argument/options must be surrounded by {}.
    - Every argument is required unless you add a "?" at the end of argument-name. If "?" is added, argument will return null.
    - Every option must be prefix'ed with "--". If specified on command-line, it will be true, otherwise false. If you need to parse a value instead, add a "=" at the end.

#### $description

[](#description)

This is a short description you will see on the list of available commands.

#### $visible

[](#visible)

This option can be either true or false. If false, it will not be visible on the list of commands. You can still use "help" to show command and it will still work.

You code lives in a method called run().

Helpers when developing
-----------------------

[](#helpers-when-developing)

If you use "$this-&gt;" when developing, there will be a long list of methods to help you write commands i.e. table(), header(), info(), throwError(), words(), choice(), etc.

Start
-----

[](#start)

To start a new project using commands, do following:

- Install package.
- Setup namespace for commands.
- Use "make:shortcut" to create a shortcut in root of your project.
- Modify and set registerOnPath().
- Use "make:command" to create a new commmand and modify it.

Config
------

[](#config)

Setup configuration for your project.

Setup config-path. Default is {root}/config.

Use $this-&gt;config('path.to.my.config'). Uses dot-notation. First section is the file itself. Rest is array.

Example: If you have following config-file config/vars.php with following array in it....

```
return [
    'test' => [
        'example' => 'testing'
    ]
];
```

.... and you write ....

```
$myVar = $this->config('vars.test.example');
```

.... you will get "testing".

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity68

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

Every ~21 days

Recently: every ~34 days

Total

21

Last Release

3160d ago

Major Versions

1.4.2 → 2.0.02017-06-18

PHP version history (3 changes)1.0.0PHP &gt;=5.5.9

2.0.0PHP ^7.0

2.0.1PHP &gt;=5.6.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/2168107cb28f49e937f963a925553ebac5923aa27cad2e1cf90ddbcabf663d6d?d=identicon)[corex](/maintainers/corex)

---

Top Contributors

[![corex](https://avatars.githubusercontent.com/u/21259173?v=4)](https://github.com/corex "corex (59 commits)")

---

Tags

consolecommand

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/corex-command/health.svg)

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

###  Alternatives

[helhum/typo3-console

A reliable and powerful command line interface for TYPO3 CMS

2959.3M238](/packages/helhum-typo3-console)[adhocore/cli

Command line interface library for PHP

3511.3M57](/packages/adhocore-cli)[aplus/cli

Aplus Framework CLI Library

2311.7M6](/packages/aplus-cli)[illuminated/console-mutex

Mutex for Laravel Console Commands.

147970.4k1](/packages/illuminated-console-mutex)[laminas/laminas-cli

Command-line interface for Laminas projects

564.0M67](/packages/laminas-laminas-cli)[zenstruck/console-extra

A modular set of features to reduce configuration boilerplate for your Symfony commands.

8062.2k1](/packages/zenstruck-console-extra)

PHPackages © 2026

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