DKCutter relies on a configuration file named dkcutter.json
located in the root directory of your DKCutter project. This file defines the prompts and default values that DKCutter uses during project generation.
The dkcutter.json
file supports various data types for your configuration variables, including:
DKCutter leverages a schema file named schema.json
to validate the structure and data types of your dkcutter.json
configuration. This schema helps prevent errors and ensures consistency across your DKCutter projects. You can find the schema file here: link to dkcutter-schema.json.
Here's an example of how to reference the schema in your dkcutter.json
file:
Let's explore some examples of how to define different data types in your dkcutter.json
file:
In this example, the "projectName"
variable is a simple string with a default value of "My Project"
.
The "useSomething"
variable is a boolean value set to true
. You can find more detailed information about working with boolean variables in a separate documentation section.
The "license"
variable is an array containing a list of possible license options. Refer to the choice variables documentation for more information on using arrays in your configuration.
While you can define variables with just a value, the object format offers more flexibility. It allows you to:
Here's an example using the object format for the "projectName"
variable:
The object format allows you to define various properties that control how DKCutter interacts with the variable during configuration:
"value"
(string, boolean, or string array): The default value for the variable."promptMessage"
(string): The message displayed to the user when prompted for input."choices"
(array of objects): An array of options for select or multi-select prompts. You can define properties like "value"
, "title"
, "description"
, and "disabled"
for each choice within the array. (Refer to the variables using object documentation for details on defining choices)."choicesType"
(string): Defines the type of prompt for choices, such as "multiselect"
or "select"
."validateRegex"
(object): Defines a regular expression for validating user input. This object can include a "regex"
property (the regular expression pattern) and a "message"
property (the error message displayed if validation fails)."disabled"
(string): Disables the variable during configuration.For comprehensive explanations of these object properties and advanced configuration options, refer to the dedicated documentation sections linked throughout this explanation. By following these guidelines and exploring the linked resources, you can effectively configure your DKCutter projects to streamline your project generation process.