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

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

bobdenotter/commando
====================

PHP CLI Commando Style

1.0.1(3y ago)177.4k↓10.1%2MITPHPPHP &gt;=8.0

Since Apr 13Pushed 3y agoCompare

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

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

Commando
========

[](#commando)

Note: This is a fork of , compatible with PHP 8.1 and up.

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

```
"require": {
    "bobdenotter/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`.

```
