gidsoft/basecommand

Easy start for building Magento 2 commands

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:magento2-module

dev-master 2018-10-26 21:39 UTC

This package is not auto-updated.

Last update: 2024-10-04 11:15:29 UTC


README

Easy start for creating Magento 2 commands, that will ask questions when needed arguments are not entered. After composer install and enabling this extension. You can run the command generation. This will setup a base console extension, with your settings.

Install

composer require gidsoft/basecommand dev-master

bin/magento module:enable Gidsoft_Basecommand

Test run

bin/magento gidsoft:basecommand:example

How to use

Simple run: bin/magento gidsoft:basecommand:generate vendorjoe example joe:example

This wil generate an console extension ready to be used as you like! The generate command will ask for vendor / module / command

To get started go to you generated extension and look for Console/Command/Base.php and change some settings, like $OPTIONS, this will be the input arguments of your command.

    protected $COMMAND = 'gidsoft:basecommand:base';
    protected $DESCRIPTION = 'Base command code: simple command setup';
    protected $OPTIONS = [
            'vendor_name'=>'vendor_name',
            'module_name'=>'module_name'
    ];

TODO

  • Default input validation
  • Easy setup optional and required arguments
  • Add config class in constructor, to read magento config settings