PHPackages                             monolyth/cliff - 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. monolyth/cliff

ActiveLibrary

monolyth/cliff
==============

Command line interface for Monolyth unframework

0.7.10(1y ago)0865[1 PRs](https://github.com/monolyth-php/cliff/pulls)3MITPHPPHP &gt;=8.1CI passing

Since Aug 17Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/monolyth-php/cliff)[ Packagist](https://packagist.org/packages/monolyth/cliff)[ RSS](/packages/monolyth-cliff/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (32)Used By (3)

monolyth/cliff
==============

[](#monolythcliff)

Command line interface for Monolyth unframework

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

[](#installation)

Using Composer:

```
composer required monolyth/cliff
```

Usage
-----

[](#usage)

`cliff` is Monolyth's command line tool. It allows you to create and run commands from your CLI, supporting arguments.

```
vendor/bin/cliff namespace/of/command [arguments]
```

`cliff` normalises the command given by capitalising the namespace and replacing forward with backward slashes. Thus, the command `my/command` will resolve to a classname of `My\Command` which Composer's autoloader must be able to load.

If the command's classname is itself `Command`, `cliff` will prepend that automagically. Thus, if no class `My\Command` is found, it will look for `My\Command\Command` before giving up.

All `cliff` command classes *must* extend `Monolyth\Cliff\Command` for convenience reasons (see below).

Writing commands
----------------

[](#writing-commands)

Write a class extending `Monolyth\Cliff\Command`. It is easiest to call the class itself `Command` too so you may omit it on the CLI, but this is not required in any way:

```
