PHPackages                             elbakerino/console - 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. elbakerino/console

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

elbakerino/console
==================

PHP Console with DI and Annotations, based on GetOpt.php

0.9.0(6y ago)16MITPHPPHP &gt;=7.3

Since Dec 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/elbakerino/console-di-annotations)[ Packagist](https://packagist.org/packages/elbakerino/console)[ RSS](/packages/elbakerino-console/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

PHP Console with DI and Annotations
===================================

[](#php-console-with-di-and-annotations)

Build PHP Console applications with Dependency Injection and Annotations.

Setup app skeleton and install dependencies with [composer](https://getcomposer.org/):

```
composer create-project elbakerino/console

```

That's it - ready to code!

**Run demo commands:**

```
# get help
php cli -h

# how to access operands, see `Commands\Demo->handle`
php cli demo
php cli demo World
php cli demo:welcome
php cli demo:bye

```

For [Docker](https://www.docker.com/), download repository and spin up services:

```
git clone https://github.com/elbakerino/console-di-annotations.git

docker-compose up

# open second terminal:
# open `bash` in docker service `app` with user `www-data`
docker-compose exec -u www-data app bash
composer install

```

Command Setup
-------------

[](#command-setup)

At [\_commands.php](_commands.php) demo [GetOpt-PHP](http://getopt-php.github.io/getopt-php/commands.html) commands are registered with inline documentation.

Here also the commands are registered for found annotations.

For only manual command, it's as short as:

```
