Was this article helpful?
Thanks for your feedback
This utility is used to generate models based on content types in stack.
To install Contenstack Model Generator, run following command:
dotnet tool install --global contentstack.model.generator --version 0.2.1
Once you install Contentstack Model Generator utility, run --help to view available commands. The following table lists the shortcut keys for running specific operations:
Short key | Long Key | Description |
-a | --api-key | The Stack API key for the Content Delivery API |
-d | --delivery-token | The Delivery token for the Content Delivery API |
-e | --endpoint | The Contentstack Host for the Content Delivery API |
-n | --namespace | The namespace the classes should be created in |
-f | --force | Automatically overwrite files that already exist |
-m | --modular-block-prefix | The Modular block Class Prefix |
-g | --group-prefix | The Modular block Class Prefix |
-p | --path | Path to the file or directory to create files in |
To create classes in the current directory run the following command:
contentstack.model.generator -a <stack_api_key> -d <delivery_token>
contentstack.model.generator -a <stack_api_key> -d <delivery_token> -p /User/xxx/Desktop
To create classes with namespace, run the following command:
contentstack.model.generator -a <stack_api_key> -d <delivery_token> -n YourProject.Models
For more details, refer to our GitHub page.
Was this article helpful?
Thanks for your feedback