Stack Commands
In this section, you will learn more about the Stack's commands.
Command Description stk create stack Create a Stack with the STK CLI. stk list stack Lists all Stacks within a Workspace. stk validate stack Validate the Stack structure to be published. stk publish stack Publish a Stack created with the STK CLI.
stk create stack
The stk create stack command creates a basic Stack structure.
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
| Option | Description | Example |
|---|---|---|
-d, --description | Your Stack description. | stk create stack my-stack-name --description "My Stack description" |
-v, --version | Semantic version of your Stack. | stk create stack my-stack-name --version 1.3.0 |
-r, --remote | Git URL to set as remote repository origin. | stk create stack my-stack-name --remote https://github.com/MyGitHubOrg/my-repository |
-sgi, --skip-git-init | It will not start a Git repository. | stk create stack my-stack-name --skip-git-init |
-q, --non-interactive | It does not ask for missing inputs, returning an error when required inputs are not provided. | stk create stack my-stack-name --non-interactive |
-o, --target | 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. | stk create stack my-stack-name --description "My Stack description" --target home/user/documents/stacks |
-f, --from | Generate 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, --help | Displays the command help and exits. | stk create stack --help |
stk list stack
The stk list stack command lists the Stacks. You have two options:
-
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.
-
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
| Options | Description | Example |
|---|---|---|
-stu, --studio | Enter the Studio Slug to list Stacks outside a Workspace. | stk list stack --studio my-studio-slug |
-h, --help | Display 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
| Option | Description | Example |
|---|---|---|
-v, --verbose | Show validation with more details. | stk validate stack --verbose |
-h, --help | Displays the command help and exits. | stk validate stack --help |
stk publish stack
The stk publish stack command publish your Stack with the STK CLI.
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
| Option | Description | Example |
|---|---|---|
-s, --studio | Studio to be used in the publication. | stk publish stack --studio my-studio |
-v, --verbose | Show publication output with more details. | stk publish stack --verbose --studio my-studio |
-h, --help | Displays the command help and exits. | stk publish stack --help |