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

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

afeefa/cli-app
==============

Convenient wrapper around symfony console

0.0.43(2mo ago)16.5k↓32.8%1MITPHPPHP &gt;=7.4CI passing

Since Jan 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/afeefacode/cli-app)[ Packagist](https://packagist.org/packages/afeefa/cli-app)[ Docs](https://github.com/afeefacode/cli-app)[ RSS](/packages/afeefa-cli-app/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (37)Used By (1)

afeefa/cli-app
==============

[](#afeefacli-app)

Create a `symfony/console` PHP cli app with a minimum of configuration.

Description
-----------

[](#description)

At times a project might need a cli tool to perform some configuration, installation or maintenance work. It shouldn't be much effort to get one running. This package is a convenience wrapper around the PHP's [symfony/console](https://github.com/symfony/console) framework and aims to simplify the creation of cli apps. It provides:

- a fluent interface to create (nested) commands
- selectable (sub) commands and command arguments
- reusable actions
- helper functions for input, output and process execution

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

[](#installation)

Install via composer as usual. Most probably you use the cli for dev purposes:

```
composer require afeefa/cli-app --save-dev
```

Documentation
-------------

[](#documentation)

See the examples below for inspiration and head over to the documentation pages:

- [Read the Docs](https://afeefa-cli-app.readthedocs.io) on installation, configuration and usage
- the [API Documentation](https://afeefacode.github.io/cli-app/api)

Examples
--------

[](#examples)

1. [Basic Workflow](#example-1-basic-workflow)
2. [Command Actions](#example-2-command-actions)
3. [Command Arguments](#example-3-command-arguments)
4. [Nested Commands](#example-4-nested-commands)

### Example 1: Basic workflow

[](#example-1-basic-workflow)

The most basic example shows the workflow of `cli-app`. You create one or more commands (usually in a separate file) and add those commands to the application instance by providing a command name and a description.

File: `pets.php`

```
