Skip to main content

Stack Commands

In this section, you will learn more about the Stack's commands.


CommandDescription
stk create stackCreate a Stack with the STK CLI.
stk list stackLists all Stacks within a Workspace.
stk validate stackValidate the Stack structure to be published.
stk publish stackPublish a Stack created with the STK CLI.

stk create stack

The stk create stack command creates a basic Stack structure.

tip

The -o, --target option allows you to define a different folder name to create the Stack content. If the folder does not exist, it will be created.

If you do not use the -o or --target option, the Stack content folder name will be the same as the one you gave when creating your Stack.

Usage

Syntax

stk create stack [NAME]

Example

stk create stack my-stack-name

Parameters

OptionDescriptionExample
-d, --descriptionYour Stack description.
stk create stack my-stack-name --description "My Stack description"
-v, --versionSemantic version of your Stack.
stk create stack my-stack-name --version 1.3.0
-r, --remoteGit URL to set as remote repository origin.
stk create stack my-stack-name --remote https://github.com/MyGitHubOrg/my-repository
-sgi, --skip-git-initIt will not start a Git repository.
stk create stack my-stack-name --skip-git-init
-q, --non-interactiveIt does not ask for missing inputs, returning an error when required inputs are not provided.
stk create stack my-stack-name --non-interactive
-o, --targetThe -o, --target option allows you to define a different folder name to create the Stack content. If the folder does not exist, it will be created. If you do not use the -o or --target option, the Stack content folder name will be the same as the one you gave when creating your Stack.
stk create stack my-stack-name --description "My Stack description" --target home/user/documents/stacks
-f, --fromGenerate the Starter file based on an existing Stack. Use the following syntax: stk create stack --from [studio-slug]/[stack-slug]@[semantic-version]
stk create stack --from my-other-studio/source-stack@1.0.0
-h, --helpDisplays the command help and exits.
stk create stack --help

stk list stack

The stk list stack command lists the Stacks. You have two options:

  1. List Stacks from a Workspace available to your account. In this case, you must be inside a Workspace. To do this, execute the command stk use workspace before listing the Stacks.

  2. List Stacks outside of a Workspace. After executing the command, specify the Studio, it will list its Stacks.

You can access the Stack's name, type, description, and version. It also notifies if there is deprecated content with the 'deprecated' tag.

Usage

stk list stack

To list Stacks outside a Workspace, enter a Studio so that the command lists the Stacks:

Example:

stk list stack --studio java-dev-studio

Parameters

OptionsDescriptionExample
-stu, --studioEnter the Studio Slug to list Stacks outside a Workspace.
stk list stack --studio my-studio-slug
-h, --helpDisplay command help and exit.
stk list stack --help

stk validate stack

The stk validate stack command validate the structure of your Stack and it's components. The files ignored on your .gitignore will not be validated.

Usage

Syntax

stk validate stack

Example

Inside your Stack's Folder, run the following command:

stk validate stack

Parameters

OptionDescriptionExample
-v, --verboseShow validation with more details.
stk validate stack --verbose
-h, --helpDisplays the command help and exits.
stk validate stack --help

stk publish stack

The stk publish stack command publish your Stack with the STK CLI.

warning

Files listed in .stkignore will not be published to StackSpot, but will be added by Git commits as normal. They are not ignored in .gitignore.

Usage

Syntax

stk publish stack [OPTIONS] --studio [STUDIO-SLUG]

Example

Inside your Stack's Folder, run the following command:

stk publish stack --studio [STUDIO-SLUG]

Parameters

OptionDescriptionExample
-s, --studioStudio to be used in the publication.
stk publish stack --studio my-studio
-v, --verboseShow publication output with more details.
stk publish stack --verbose --studio my-studio
-h, --helpDisplays the command help and exits.
stk publish stack --help