Adding a CLI to Your Extension
Command-Line Interfaces (CLIs) are a popular tool for developers to automate certain tasks. CLI applications are intended to be used through a terminal emulator, such as xterm on Linux systems, Windows Command Prompt on Windows systems, or the Terminal app on macOS.
The most common reason people use a CLI web application is to automate certain tasks. This can be accomplished with Cron Jobs or by including the CLI commands in a development automated pipeline (for example, a continuous integration pipeline).
Many PHP CMS and frameworks implement a CLI application with different naming, so for instance, you can find Laravel Artisan, the Symfony Console, WP-CLI for WordPress, or even the PrestaShop CLI. Some of these systems actually share code and packages to create their CLIs. Joomla! CLI is based on the Symfony Console component.
In this chapter, we are going to explore Joomla! CLI and see the options it offers. We will learn how to create a CLI...