Skip to main content

CLI

The Necord Schematics is a collection of schematics that helps you to initialize, develop, and maintain your Necord applications. It embodies best-practice architectural patterns to encourage well-structured apps.

Installation

To install the schematics, run the following command:

npm install -g @nestjs/cli
npm install -D @necord/schematics

Usage

Generating commands

To generate a slash command you can use the command schematic:

nest g -c @necord/schematics command 

from there the wizard will ask what the name of the command is and type of command.

The available options for this command are the following:

OptionDescription
--nameThe name of the command.
--pathThe path to create the service.
--flatWhether or not a directory is created. (default: false)
--sourceRootNestJS service source root directory.
--specWhether or not a spec file is generated. (default: true)
--strategyThe type of command. (text-command or slash-command)

Generating message components

To generate a component you can use the component schematic:

nest g -c @necord/schematics component 

from there the wizard will ask what the name of the component is and type of component.

The available options for this command are the following:

OptionDescription
--nameThe name of the component.
--pathThe path to create the service.
--flatWhether or not a directory is created. (default: false)
--sourceRootNestJS service source root directory.
--specWhether or not a spec file is generated. (default: true)
--strategyThe type of component. (button, select)

Generating context menus

To generate a context menu you can use the context menu schematic:

nest g -c @necord/schematics context-menu 

from there the wizard will ask what the name of the context menu is and type of context menu.

The available options for this command are the following:

OptionDescription
--nameThe name of the context menu.
--pathThe path to create the service.
--flatWhether or not a directory is created. (default: false)
--sourceRootNestJS service source root directory.
--specWhether or not a spec file is generated. (default: true)
--strategyThe type of context menu. (user, message)

Generating modal components

To generate a modal component you can use the modal schematic:

nest g -c @necord/schematics modal 

from there the wizard will ask what the name of the modal is and type of modal.

The available options for this command are the following:

OptionDescription
--nameThe name of the modal.
--pathThe path to create the service.
--flatWhether or not a directory is created. (default: false)
--sourceRootNestJS service source root directory.
--strategyWhether or not a spec file is generated. (default: true)