Skip to main content

Stack Commands

In this section, you will find detailed instructions on how to manage Stacks with the STK CLI.


CommandDescription
stk create stackCreates a Stack using the STK CLI.
stk list stackLists all Stacks in a Workspace or Studio.
stk validate stackValidates the structure of a Stack before publishing.
stk publish stackPublishes your Stack through the STK CLI.

stk create stack

The stk create stack command creates the basic structure of a Stack.

Additional information

The -o or --target option lets you specify a different folder name for your Stack's content. If the folder does not exist, it will be created automatically.

If you do not use -o or --target, the folder will be named after the Stack you are creating.

Usage

Syntax

stk create stack [NAME]

Example

stk create stack my-stack

Options

OptionDescriptionExample
-d, --descriptionDescription for your Stack.
stk create stack my-stack --description "Sample Stack"
-v, --versionSemantic version for the Stack.
stk create stack my-stack --version 1.3.0
-r, --remoteGit remote repository URL (origin).
stk create stack my-stack --remote https://github.com/MyOrg/my-repo
-sgi, --skip-git-initDo not initialize a Git repository when creating the Stack.
stk create stack my-stack --skip-git-init
-q, --non-interactiveRuns the command non-interactively. Returns an error if a required input is missing.
stk create stack my-stack --non-interactive
-o, --targetSets a specific folder to create the Stack's content.
stk create stack my-stack --target /path/to/stack
-f, --fromGenerates the Stack from an existing Stack.
stk create stack --from my-studio/other-stack@1.0.0
-h, --helpDisplays help for the command.
stk create stack --help

stk list stack

The stk list stack command displays available Stacks in the terminal.

You can:

  • List Stacks in a Workspace. In this case, access the Workspace first with stk use workspace.
  • List Stacks outside a Workspace by providing a Studio. This way, the command lists all public Stacks from that Studio.

You can see the Stack’s name, type, description, and version. The command also marks deprecated Stacks with the 'deprecated' tag.

Usage

Syntax

stk list stack

To list Stacks outside a Workspace, provide the Studio:

stk list stack --studio my-studio-slug

Options

OptionDescriptionExample
-stu, --studioStudio slug to list Stacks outside a Workspace.
stk list stack --studio my-studio-slug
-h, --helpDisplays help for the command.
stk list stack --help

stk validate stack

The stk validate stack command validates the Stack structure and its components. Files ignored in .gitignore are not validated.

Usage

Syntax

stk validate stack

Example

In your Stack directory, run:

stk validate stack

Options

OptionDescriptionExample
-v, --verboseShows advanced details during validation.
stk validate stack --verbose
-stu, --studioValidates the Stack using information from the published Stack, with the Studio slug.
stk validate stack --verbose --studio my-studio-slug
-h, --helpDisplays help for the command.
stk validate stack --help

stk publish stack

The stk publish stack command publishes the Stack to the specified Studio using the STK CLI.

Attention!

Files listed in .stkignore will not be published to StackSpot. However, they will still be added to Git commits if not ignored in .gitignore.

Usage

Syntax

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

Example

In your Stack directory, run:

stk publish stack --studio my-studio-slug

Options

OptionDescriptionExample
-s, --studioStudio name where the Stack will be published.
stk publish stack --studio my-studio
-v, --verboseShows advanced details during publishing.
stk publish stack --verbose --studio my-studio
-h, --helpDisplays help for the command.
stk publish stack --help

See also