Skip to main content
Version: v4.5.0

stk create template


The stk create template command creates the structure of a Stack Template. This structure contains the files needed to create a Template.

This Template will be used in the stk create app, the stk create env or both commands.

How does it work?

Run inside a Stack folder, and a sub-folder is generated with the structure to create the Template.

The user must edit the template.yaml file and set the input parameters for the Template.

Creating Templates in separate repositories

If you want to create a Template separate from a Stack so that it can be used in more than one Stack, you need to run the command in the terminal outside the Stack folder. After that, a folder will be generated with the structure to create the Template.

This folder will be initialized as a Git repository.

The user must edit the template.yaml file and configure the input parameters of the Template.


The command's syntax is: stk create template [OPTIONS] [NAME]

Check the option available in the command:

NAMESets the name of the created template. If the name is not given, the repository name from the --remote parameter is set.
--descriptionThis is the text that describes the Template and its purpose. This description will also be displayed in the stk list template command to let the user know about the Template.
--remoteThis is a parameter that sets the remote url of the Git repository that will be used as the origin for the Template. If you don't enter the remote, you need to run git add remote to be able to publish the Template in Git. This should only be used in cases where you are using separate repositories for Templates.

Depreciated Parameters


The parameters below are deprecated.

--types Defines the types of the Template. The Template can be applied to the stk create app, stk create env or both commands. If it is applied to the latter, the values for it are: app-template and env-template. To define more than one type of Template, use a comma.
--deployAdds a life cycle section to plugin.yaml, where you can define the commands executed by stk deploy from the CLI.


Check out a sample template below:

Read more

Was this page helpful?