<p>You should see your commands when using the Craft CLI.</p>
<p>First thing to check would be that the module is registered in <code>app.php</code>, both in the <code>modules</code> and <code>bootstrap</code> arrays. Craft's documentation on that is <a href="https://craftcms.com/docs/3.x/extend/module-guide.html#update-the-application-config" rel="nofollow noreferrer">here</a>.</p>
<p>I find the best way to quickly validate that your module is registered, is by dumping something out from the module <code>init()</code> function. <code>Craft::dd('Registered')</code> does the trick. If you don't see anything on the frontend, your module isn't getting loaded into Craft.</p>
<p>Secondly, I would check that you are correctly setting the <code>controllerNamespace</code>, so that Craft knows where to look for controllers, depending on your request. Their documentation on that is <a href="https://craftcms.com/docs/3.x/extend/commands.html#module-setup" rel="nofollow noreferrer">here</a>.</p>
<p>Finally, check that you have some valid functions setup in your controllers. Each function name should be prefixed with <code>action</code>. For example: <code>actionRun()</code> in a <code>JobController.php</code> file will be run with <code>php craft mymodule/job/run</code>.</p>

CC BY-SA 4.0
2021-04-27T22:07:32.503Z
2021-04-27T22:07:32.503Z
Matt Banner
<p>I found the documentation here very confusing: <a href="https://craftcms.com/docs/3.x/extend/commands.html#module-setup" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/extend/commands.html#module-setup</a></p>
<p>I've scaffolded a simple test plugin from <a href="https://pluginfactory.io/" rel="nofollow noreferrer">https://pluginfactory.io/</a> with &quot;Console Commands&quot; enabled and I've pulled my plugin into composer via 'path'. The plugin shows up fine in the Craft UI, and so I installed it.</p>
<p>However, I can't get the new command to display in the terminal when I do a 'php craft'. Am I supposed to see it?</p>

CC BY-SA 4.0
2021-04-05T07:54:15.530Z
Maybe there is something missing. I would also suggest you to take a look on some popular plugins and how they implemented custom commands.
Johannes
<plugin-development>
Trouble with Custom Command in Custom Plugin. How do I do it?
# Trouble with Custom Command in Custom Plugin. How do I do it?

(Asked by: username_0 on 2021-04-01)

I found the documentation here very confusing: <https://craftcms.com/docs/3.x/extend/commands.html#module-setup>

I've scaffolded a simple test plugin from <https://pluginfactory.io/> with "Console Commands" enabled and I've pulled my plugin into composer via 'path'. The plugin shows up fine in the Craft UI, and so I installed it.

However, I can't get the new command to display in the terminal when I do a 'php craft'. Am I supposed to see it?

**Tags:** plugin-development

> **Comments:**
> **username_1**: Maybe there is something missing. I would also suggest you to take a look on some popular plugins and how they implemented custom commands.  

---

## 1 answers

### Answer by username_2 on 2021-04-27. Score: 1

You should see your commands when using the Craft CLI.

First thing to check would be that the module is registered in `app.php`, both in the `modules` and `bootstrap` arrays. Craft's documentation on that is [here](https://craftcms.com/docs/3.x/extend/module-guide.html#update-the-application-config).

I find the best way to quickly validate that your module is registered, is by dumping something out from the module `init()` function. `Craft::dd('Registered')` does the trick. If you don't see anything on the frontend, your module isn't getting loaded into Craft.

Secondly, I would check that you are correctly setting the `controllerNamespace`, so that Craft knows where to look for controllers, depending on your request. Their documentation on that is [here](https://craftcms.com/docs/3.x/extend/commands.html#module-setup).

Finally, check that you have some valid functions setup in your controllers. Each function name should be prefixed with `action`. For example: `actionRun()` in a `JobController.php` file will be run with `php craft mymodule/job/run`.


---

