PHPackages                             10quality/ayuco - 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. 10quality/ayuco

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

10quality/ayuco
===============

Command-Line interface that can be used to execute commands written in PHP.

v1.0.6(2mo ago)16.0k11MITPHPCI passing

Since May 12Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/10quality/ayuco)[ Packagist](https://packagist.org/packages/10quality/ayuco)[ Docs](https://github.com/10quality/ayuco)[ RSS](/packages/10quality-ayuco/feed)WikiDiscussions v1.0 Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (9)Used By (1)

Ayuco
=====

[](#ayuco)

[![Latest Stable Version](https://camo.githubusercontent.com/2fd40b65bdf57704a25ee911c26bddfbceb68a6282104263505425c8d44f7cc9/68747470733a2f2f706f7365722e707567782e6f72672f31307175616c6974792f617975636f2f762f737461626c65)](https://packagist.org/packages/10quality/ayuco)[![Total Downloads](https://camo.githubusercontent.com/de4054c38e417e77cca69842a50109d6dd5fc9e45370f59d895f31163436393a/68747470733a2f2f706f7365722e707567782e6f72672f31307175616c6974792f617975636f2f646f776e6c6f616473)](https://packagist.org/packages/10quality/ayuco)[![GitHub Workflow Status (with branch)](https://camo.githubusercontent.com/96ee80f033a00cc5c361688dffcc6b86329b41a2a98efd8d6c0fb4cd96c0e00f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f31307175616c6974792f617975636f2f746573742e796d6c)](https://camo.githubusercontent.com/96ee80f033a00cc5c361688dffcc6b86329b41a2a98efd8d6c0fb4cd96c0e00f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f31307175616c6974792f617975636f2f746573742e796d6c)[![License](https://camo.githubusercontent.com/7cd558e42becd176fb2c0e806414a100bf63ef2c2bbc326ab4f74698c9cfc000/68747470733a2f2f706f7365722e707567782e6f72672f31307175616c6974792f617975636f2f6c6963656e7365)](https://packagist.org/packages/10quality/ayuco)

Command-Line interface that can be used to execute commands written in PHP.

**Note:** Commands included in this package (excluding help command) were written for WordPress-MVC.

Usage
-----

[](#usage)

Create a php file that will be called in command-line, [Sample](https://github.com/10quality/ayuco/blob/v1.0/tests/environments/plugin/ayuco), and include the following code lines:

```
use Ayuco\Listener;
```

Create a listener:

```
$ayuco = new Listener();

// or without use
$ayuco = new Ayuco\Listener()
```

Register your commands.

```
$ayuco->register($command1)
    ->register($command2)
    ->register(new MyCommand);
```

Start interpreting or listening:

```
$ayuco->interpret();
```

Use in command line:

```
php filename command_key arguments
```

If `filename` is named `ayuco.php` and `command_key` is `clear_cache`, command in *command-line* will be:

```
php ayuco.php clear_cache
```

### Arguments and command options

[](#arguments-and-command-options)

Send arguments right after the `command_key`, for example:

```
php ayuco.php cache clear
```

In the example above, `cache` will be the command key and `clear` will be an argument (in order, it will be `$arg[2]`).

Send arguments as command options with the prefix `--`, for example:

```
php ayuco.php cache clear --debug --note="Cache clear note"
```

### Create a custom command

[](#create-a-custom-command)

Create your own class command by extending from Ayuco base command class:

```
use Ayuco\Command;

class MyCommand extends Command
{
    protected $key = 'command_key';

    protected $description = 'My command description.';

    public function call($args = [])
    {
        // TODO command action.
    }
}
```

Example for a clear cache command.

```
use Ayuco\Command;

class ClearCacheCommand extends Command
{
    protected $key = 'clear_cache';

    protected $description = 'Clears system cache.';

    public function call($args = [])
    {
        Cache::flush(); // Example
    }
}
```

Registration in listener would be:

```
$ayuco->register(new ClearCacheCommand);
```

### Arguments and options

[](#arguments-and-options)

For this command:

```
php ayuco.php cache clear
```

The arguments can be accessed like:

```
use Ayuco\Command;

class CacheCommand extends Command
{
    protected $key = 'cache';

    public function call($args = [])
    {
        // ayuco.php
        $args[0];

        // cache
        $args[1];

        // clear
        $args[2];
    }
}
```

For this command:

```
php ayuco.php cache clear --debug --note="Cache clear note"
```

The options can be accessed like:

```
use Ayuco\Command;

class CacheCommand extends Command
{
    protected $key = 'cache';

    public function call($args = [])
    {
        // ayuco.php
        $args[0];

        // cache
        $args[1];

        // clear
        $args[2];

        // --debug
        $this->options['debug'];

        // --note="..."
        $this->options['note'];
    }
}
```

### Coloring output

[](#coloring-output)

Change the coloring of the output printed in the console using class `Ayuco\Coloring` static method `apply()`:

```
use Ayuco\Coloring;
use Ayuco\Command;

class ColoringCommand extends Command
{
    public function call($args = [])
    {
        $this->_print(Coloring::apply('red', 'Print this message in red.'));
    }
}
```

You can read more about coloring [here](https://github.com/php-parallel-lint/PHP-Console-Color).

### Help command

[](#help-command)

AYUCO automatically will register its own `help` command. This command can be used to display in `command-line` the list of registered commands, use it like:

```
php ayuco.php help
```

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4

Coding guidelines
-----------------

[](#coding-guidelines)

PSR-4.

LICENSE
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2016 [10Quality](http://www.10quality.com).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance87

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 81.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~512 days

Recently: every ~558 days

Total

8

Last Release

65d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2cdad4e398292477582ba8ec4ab02a96fa645cd620518a5bcf697cd788c96c3?d=identicon)[amostajo](/maintainers/amostajo)

---

Top Contributors

[![amostajo](https://avatars.githubusercontent.com/u/1645908?v=4)](https://github.com/amostajo "amostajo (22 commits)")[![garretthyder](https://avatars.githubusercontent.com/u/8726005?v=4)](https://github.com/garretthyder "garretthyder (4 commits)")[![10quality-info](https://avatars.githubusercontent.com/u/16583059?v=4)](https://github.com/10quality-info "10quality-info (1 commits)")

---

Tags

phpcommand-linecommands

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/10quality-ayuco/health.svg)

```
[![Health](https://phpackages.com/badges/10quality-ayuco/health.svg)](https://phpackages.com/packages/10quality-ayuco)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[nunomaduro/laravel-console-summary

A Beautiful Laravel Console Summary for your Laravel/Laravel Zero commands.

662.0M3](/packages/nunomaduro-laravel-console-summary)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16255.4k7](/packages/nunomaduro-laravel-console-dusk)[rahul900day/laravel-console-spinner

Laravel Console Spinner is a spinner output for Laravel command line.

76125.4k1](/packages/rahul900day-laravel-console-spinner)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
