2021-05-17 18:32:09 +02:00
# cpl generate
## Contents
- [Description ](#description )
- [Arguments ](#arguments )
- [Schematics ](#schematics )
Generate a file based on schematic.
cpl **generate** *<schematic>* *<name>* < br >
cpl **g** *<schematic>* *<name>* < br >
cpl **G** *<schematic>* *<name>*
## Description
Generates files based on a schematic.
2022-12-08 15:29:48 +01:00
You can define custom schematics by creating templates in a ```.cpl``` folder.
2021-05-17 18:32:09 +02:00
## Arguments
2022-12-04 00:50:24 +01:00
| Argument | Description | Value type |
|-------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------:|
| ```< schematic > ``` | The schematic to generate. | ```str``` |
| ```< name > ``` | The name of the generated file. | ```str``` |
| ```--base``` | First element of path will be used as base-path not 'src'. For example: 'cpl g c test/Test' will be created at ```src/test/``` with --base it would be ```test/``` | ```str``` |
2021-05-17 18:32:09 +02:00
## Schematics
2022-12-08 15:29:48 +01:00
| Schematic | Description | Arguments |
|-----------------|:--------------------------------------:|:------------:|
| ```abc``` | Abstract base class | ```< name > ``` |
| ```class``` | Class | ```< name > ``` |
| ```enum``` | Enum class | ```< name > ``` |
| ```pipe``` | Pipe class | ```< name > ``` |
| ```service``` | Service class | ```< name > ``` |
| ```settings``` | [Configmodel ](cpl_core.configuration ) | ```< name > ``` |
| ```test``` | Test class | ```< name > ``` |
| ```thread``` | Thread class | ```< name > ``` |
| ```validator``` | Validator class | ```< name > ``` |
| ```command``` | Discord bot command class | ```< name > ``` |
| ```event``` | Discord bot event class | ```< name > ``` |