Stack Commands
In this section, you will find detailed instructions on how to manage Stacks with the STK CLI.
| Command | Description |
|---|---|
| stk create stack | Creates a Stack using the STK CLI. |
| stk list stack | Lists all Stacks in a Workspace or Studio. |
| stk validate stack | Validates the structure of a Stack before publishing. |
| stk publish stack | Publishes your Stack through the STK CLI. |
stk create stack
The stk create stack command creates the basic structure of a Stack.
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
| Option | Description | Example |
|---|---|---|
-d, --description | Description for your Stack. | stk create stack my-stack --description "Sample Stack" |
-v, --version | Semantic version for the Stack. | stk create stack my-stack --version 1.3.0 |
-r, --remote | Git remote repository URL (origin). | stk create stack my-stack --remote https://github.com/MyOrg/my-repo |
-sgi, --skip-git-init | Do not initialize a Git repository when creating the Stack. | stk create stack my-stack --skip-git-init |
-q, --non-interactive | Runs the command non-interactively. Returns an error if a required input is missing. | stk create stack my-stack --non-interactive |
-o, --target | Sets a specific folder to create the Stack's content. | stk create stack my-stack --target /path/to/stack |
-f, --from | Generates the Stack from an existing Stack. | stk create stack --from my-studio/other-stack@1.0.0 |
-h, --help | Displays 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
| Option | Description | Example |
|---|---|---|
-stu, --studio | Studio slug to list Stacks outside a Workspace. | stk list stack --studio my-studio-slug |
-h, --help | Displays 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
| Option | Description | Example |
|---|---|---|
-v, --verbose | Shows advanced details during validation. | stk validate stack --verbose |
-stu, --studio | Validates the Stack using information from the published Stack, with the Studio slug. | stk validate stack --verbose --studio my-studio-slug |
-h, --help | Displays 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.
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
| Option | Description | Example |
|---|---|---|
-s, --studio | Studio name where the Stack will be published. | stk publish stack --studio my-studio |
-v, --verbose | Shows advanced details during publishing. | stk publish stack --verbose --studio my-studio |
-h, --help | Displays help for the command. | stk publish stack --help |
See also