PHPackages                             tolidano/commandox - 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. tolidano/commandox

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

tolidano/commandox
==================

PHP CLI Inspired by Commando

v0.7.2(6y ago)245[7 issues](https://github.com/tolidano/commandox/issues)MITPHPPHP &gt;=7.2

Since Jun 13Pushed 6y agoCompare

[ Source](https://github.com/tolidano/commandox)[ Packagist](https://packagist.org/packages/tolidano/commandox)[ Docs](http://github.com/tolidano/commandox)[ RSS](/packages/tolidano-commandox/feed)WikiDiscussions master Synced 2d ago

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

CommandoX
=========

[](#commandox)

PHP 7.2+ CLI Manager
--------------------

[](#php-72-cli-manager)

[![Build Status](https://camo.githubusercontent.com/b890e54985584d717a3b6fccbae9440d1e21331c334260e3535e98ab29d2cea0/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f746f6c6964616e6f2f636f6d6d616e646f782e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/tolidano/commandox)

CommandoX is a PHP command line interface library that beautifies and simplifies writing PHP scripts intended for command line use. This is a PHP 7.2+ port of Nate Good's abandoned Commando project available here: ()

Why?
----

[](#why)

PHP's `$argv` magic variable and global `$_SERVER['argv']` should be avoided, encapsulated, or abstracted away in proper OOP design. PHP's [`getopt`](http://php.net/manual/en/function.getopt.php) is not a significant improvement, and most other PHP CLI libraries are far too OOP bloated. CommandoX provides a clean and readable interface without a ton of overhead or common boilerplate when it comes to handling CLI input.

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

[](#installation)

*CommandoX requires that you are running PHP 7.2 or higher.*

CommandoX is [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compliant and can be installed using [Composer](http://getcomposer.org/). Add `tolidano/commandox` to your `composer.json`

```
"require": {
    "tolidano/commandox": "*"
}

```

If you're new to Composer...

- [Download and build Composer](http://getcomposer.org/download/)
- Make it [globally accessible](http://getcomposer.org/doc/00-intro.md#globally)
- `cd` to your the directory where you'll be writing your CommandoX script and run `composer install`

*Installing via Composer is the only supported option.*

Example
-------

[](#example)

Here is an example of a PHP CommandoX script that gives a decent tour of CommandoX's features:

```
