Add CLI commands using dependency injection

The Magento 2 sample modules provide a demonstration of many programming techniques, including adding a CLI command using dependency injection
. Look at the sample-module-command for an example. The module’s README.md discusses how to install it.