PHPackages                             district5/cli - 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. district5/cli

ActiveLibrary

district5/cli
=============

Easy to use CLI driven PHP applications.

6.0.1(2y ago)07mitPHPPHP &gt;=8.1

Since Nov 26Pushed 2y agoCompare

[ Source](https://github.com/district-5/php-cli)[ Packagist](https://packagist.org/packages/district5/cli)[ Docs](https://github.com/district-5/php-cli)[ RSS](/packages/district5-cli/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (11)Used By (0)

[View on Packagist](https://packagist.org/packages/rogerthomas84/ohconsole)

District5\\Cli
==============

[](#district5cli)

Originally from the [OhConsole](https://github.com/rogerthomas84/ohconsole) project.

Cli is a simple interface to create advanced PHP CLI applications by abstracting the commands into separated classes.

Composer
--------

[](#composer)

```
{
    "repositories":[
        {
            "type": "vcs",
            "url": "git@github.com:district-5/php-cli.git"
        }
    ],
    "require": {
        "district-5/cli": "*"
    }
}
```

Theory
------

[](#theory)

Arguments get converted to namespaces. The final route class must be appended with `Route`. So for example, a fully qualified class name of `SomeApp\Foo\Bar\ProcessMyTasksRoute` could be called with `some-app foo bar process-my-tasks`

A much simpler example would be `Config\Get\UrlRoute` which would be called with `config get url`

Quick Start
-----------

[](#quick-start)

To get started in a hurry, first create your core command file. Generally this could be `bin/console`. This file should contain something like this:

```
