# SOLVED: Shell logic commands in Plugin

**URL:** <https://discourse.cakephp.org/t/solved-shell-logic-commands-in-plugin/6099>\
**Category:** Plugins\
**Created:** [May 19, 2019, 8:16am UTC](https://discourse.cakephp.org/t/solved-shell-logic-commands-in-plugin/6099 "2019-05-19T08:16:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xv1t](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/xv1t/32/821_2.png) [@xv1t](https://discourse.cakephp.org/u/xv1t)\
**Post date:** [May 19, 2019, 8:16am UTC](https://discourse.cakephp.org/t/solved-shell-logic-commands-in-plugin/6099/1 "2019-05-19T08:16:23Z")

</div>

A need a plugin for Shell commands.

```bash
# create a plugin
bin/cake bake plugin "ShellTest"

```

Ok, a have a folder `src/plugins/ShellTest`  
Create a file `src/plugins/ShellTest/src/Shell/PoleShell.php`

```php
namespace ShellTest\Shell;

use Cake\Console\Shell;

class PoleShell extends Shell {
    public function main()
    {
        $this->out('<warning>Fire!!!</warning>');
    }
}

```

and run command

```bash
bin/cake "pole"

```

And I’m getting a Exception message

```auto
Exception: Unknown command `cake t34`. Run `cake --help` to get the list of valid commands. in [./my_app_name/vendor/cakephp/cakephp/src/Console/CommandRunner.php, line 346]

```

Can someone help?

---

<div class="post-metadata">

**Author:** ![xv1t](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/xv1t/32/821_2.png) [@xv1t](https://discourse.cakephp.org/u/xv1t)\
**Post date:** [May 19, 2019, 1:36pm UTC](https://discourse.cakephp.org/t/solved-shell-logic-commands-in-plugin/6099/2 "2019-05-19T13:36:13Z")

</div>

My first solution through composer. **Not easy** , but worked!

I’m created a [repo](https://github.com/xv1t/shell-test) with plugin. Added to `composer.json` file and published this [pakage](https://packagist.org/packages/xv1t/shell-test) as `xv1t/shell-test`  
in the project tree.

A am changed a pluginname to `ShellTest` and shell class to `PoleShell`

```bash
composer require "xv1t/shell-test" --dev;
bin/cake plugin load "ShellTest";

```

After the install run in the console for project

```bash
# type by Shell name is `pole`
bin/cake "pole"

```

It worked.
