PHPackages                             corley/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. [CLI &amp; Console](/categories/cli)
4. /
5. corley/cli

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

corley/cli
==========

A base project for cli commands

1.0.1(9y ago)122MITPHP

Since Feb 4Pushed 9y agoCompare

[ Source](https://github.com/wdalmut/php-cli)[ Packagist](https://packagist.org/packages/corley/cli)[ RSS](/packages/corley-cli/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (10)Versions (3)Used By (0)

Command line applications
=========================

[](#command-line-applications)

A simple base point for command line applications

Install with composer
---------------------

[](#install-with-composer)

```
composer create-project corley/cli ./my-app ~1
```

Usage
-----

[](#usage)

Everything is ruled by the dependency injection container. In `services.yml` you can define services and in `commands.yml` you can add commands.

### Add commands

[](#add-commands)

Every command must be tagged as `app.comand` (autoloading)

```
# commands.yml
hello.command:
  class: Command\MyCommand
  arguments:
    - "%hello%"
  tags:
    - {name: app.command}
```

### Add services

[](#add-services)

```
# services.yml
services:
  mailer:
    class: MyApp\Mailer
    arguments:
      - mailer.transport
  mailer.transport:
    class: MyApp\Sendmail
```

Create a command
----------------

[](#create-a-command)

Just `Symfony` commands

```
