PHPackages                             nategood/commando - 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. nategood/commando

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

nategood/commando
=================

PHP CLI Commando Style

1.0.0(2y ago)8123.3M↑15%82[10 PRs](https://github.com/nategood/commando/pulls)20MITPHPPHP &gt;=8.0

Since Aug 31Pushed 2y ago17 watchersCompare

[ Source](https://github.com/nategood/commando)[ Packagist](https://packagist.org/packages/nategood/commando)[ Docs](http://github.com/nategood/commando)[ RSS](/packages/nategood-commando/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (16)Used By (20)

Commando
========

[](#commando)

An Elegant PHP CLI Library
--------------------------

[](#an-elegant-php-cli-library)

Commando is a PHP command line interface library that beautifies and simplifies writing PHP scripts intended for command line use.

Why?
----

[](#why)

PHP's `$argv` magic variable and global `$_SERVER['argv']` make me cringe, [`getopt`](http://php.net/manual/en/function.getopt.php) isn't all that much better, and most other PHP CLI libraries are far too bloated for many cases. Commando gets down to business without a ton of overhead, removes the common boilerplate stuff when it comes to handling CLI input, all while providing a clean and readable interface.

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

[](#installation)

*Commando requires that you are running PHP 8.1 or higher.*

Commando 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 `nategood/commando` to your `composer.json`

```
"require": {
    "nategood/commando": "*"
}

```

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 Commando script and run `composer install`

*Currently installing via Composer is the only supported option.*

Example
-------

[](#example)

Here is an example of a PHP Commando script that gives a decent tour of Commando's features. Let's say it is in a file called `hello.php`.

```
