Adding a Joomla! CLI command to Joomla!
In Joomla!, we can add our own commands to the CLI, creating a plugin for every command we want to add. These plugins belong to the console plugin group. Out-of-the-box commands do not have a plugin associated, but they are included in Joomla! libraries, so you will not see the console plugin group in a basic Joomla! installation.
After Chapter 8, we know how to code Joomla! plugins, so we can start creating our basic plugin structure and adding the manifest. Let’s create the file, src/plugins/console/spm/spm.xml
, with the following content:
<?xml version="1.0" encoding="UTF-8"?> <extension type="plugin" group="console" method="upgrade"> <name>plg_console_spm</name> <author>Carlos Cámara</author> <creationDate>2023-05</creationDate> ...