Skip to content

CLI Commands

CLI Commands in the CMS makes easy to genarate and scafold the module specific folders and files.

make:middleware

yarn make:middleware name=testMiddleware

As this command will generate the controller file in the (src/middlewares) directory.

make:route

yarn make:route name=testRoute

As this command will generate the controller file in the (src/routes) directory.

make:validator

yarn make:validator name=testValidator

As this command will generate the controller file in the (src/validators) directory.

make:controller

yarn make:controller name=testController

As this command will generate the controller file in the (src/controllers) directory.

make:service

yarn make:service name=testService

As this command will generate the service file in the (src/services) directory.

make:model

yarn make:model name=testModel

As this command will generate the model file in the (src/models) directory.

generate:scafold

yarn generate:scafold name=Users

As this command will generate the route, model, controller and service files and if sub-directory is passed it will be generate according to it.

Likewise, these all commands also supports the sub-folder structure. So in order to create the file in the specific folder we can execute like:

yarn make:controller name=backend\users\userController

AS this command will create the userController.js file under src/controllers/backend/users. If file already exists error is thrown.