Refer to how to create custom commands at https://docs.drupalconsole.com/en/extending/creating-custom-commands.html