Skip to main content

Application Commands

In this section, you will find the list of Application commands.


CommandDescription
stk create appCreates an Application from one or more Plugins.
stk delete appRemoves an Application hosted in a remote repository.
stk deploy appDeploys your Application.
stk destroy appDestroys the Application from an Environment.
stk list appLists all Applications registered in a Workspace.
stk register appRegisters an Application in a Workspace.
stk register app-deployRegisters an Application deployment in a Workspace.
stk register app-destroyRegisters the destruction of an Application in a Workspace.
stk rollback appRolls back your Application.
stk update appUpdates Application information.
stk validate appValidates the structure of an Application.

stk create app

The stk create app command creates an Application from a Starter. The Application is generated with the features of the Plugins defined in the Starter, and may include business logic, infrastructure, or specific functionalities.

Applications created outside a Workspace cannot be registered or deployed on StackSpot.

Additional Information

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

If you do not specify the -o or --target option, the folder name will match the Application name you provided.

Usage

stk create app [APP_NAME] --starter [STUDIO/STACK/STARTER]
Additional Information

The flag usage --starter [ACCOUNT/STUDIO/STACK/STARTER] is deprecated and will be removed soon. Use the flag without the ACCOUNT parameter, as in the example below:

stk create app my-app-name --starter my-studio/my-stack/starter-name

Parameters

OptionsDescriptionExample
APP_NAMESets the Application name. If not provided, the name from the --remote repository parameter is used.
stk create app my-app-name
-s, --starter,
--starter studio-slug/stack-slug/starter-slug
Sets the Starter used to apply the set of Plugins to the Application. Specify the Starter, Studio, and Stack. You can select the Stack interactively in the terminal.
To select the Stack version, include @stack-version in the flag, e.g., --starter studio-slug/stack-slug@1.0.0/starter-slug.
You can also specify the path to a starter.yaml file to use a local Starter.
stk create app my-app-name --starter my-studio/my-stack/starter-name
Select Stack version:
stk create app my-app-name --starter my-studio/my-stack@3.0.0/starter-name
Local Starter:
stk create app my-app-name --starter User/Documents/My-Local-Starters/starter-name.yaml
-r, --remote <git-url>Specifies the remote Git repository URL used as the project source. If not provided, the repository will not be configured automatically.
stk create app my-app-name --remote my-git-repository-url
-sgi, --skip-git-initSkips Git repository initialization when creating the Application.
stk create app my-app-name --skip-git-init
-d, --descriptionSets the description and purpose of the Application.
stk create app my-app-name --description "my app" --starter my-studio/my-stack/starter-name
-q, --non-interactiveDoes not prompt for input parameters and returns an error if any required parameter is missing.
stk create app my-app-name --starter my-studio/my-stack/starter-name --non-interactive
-sp, --spec TEXTPath to the specification file containing inputs and connections data for each Plugin.
stk create app my-app-name --spec /home/user/specs-folder/app.yaml
-o, --targetSets a custom folder name for the Application content. If it does not exist, it will be created. If not used, the folder name will match the Application name.
stk create app my-app-name --starter my-studio/my-stack/starter-name --target home/user/Applications/my-app
-er, --extra-repositories TEXTList of additional repositories for your Application. Each item must be a JSON object:
"[{"name":"repository_name", "description":"repository_description", "provider":"repository_provider", "url":"repository_url"}]"
stk create app my-example-app --starter studio/stack/starter-name --extra-repositories "[{"name":"my-example-app-repo", "description":"repository for test my apps", "provider":"github", "url":"https://github.com/my-organization-name/my-example-app-repo"}]"
-wf, --workflow TEXTName of the Workflow used to create the Application.
stk create app my-example-app --workflow studio-name/stack-name/workflow-name
-rs, --report-statusWorkflow only. Reports the execution status as an activity in the current Application or Infrastructure.
stk create app my-example-app --workflow studio-name/stack-name/workflow-name --report-status
-i, --inputs-json TEXTWorkflow only. Workflow inputs in JSON format.
stk create app my-example-app --workflow studio-name/stack-name/workflow-name --inputs-json "[{"label":"Host","name":"host","type":"text","required":true},{"label":"Port","name":"port","type":"int","required":true}]"
-h, --helpShows command help and exits.
stk create app --help

stk delete app

The stk delete app command completely removes an Application from a Workspace. There is no rollback: both the Application record and the content of the deployment repository will be removed.

Usage

If your Application has active Infrastructure Plugins deployed via self-hosted Runtime, the stk delete app command will be stopped. In these cases, destroy the Application's Infrastructure first. If not using self-hosted Runtime and your Application has active deployments in one or more Environments:

  • The command checks if Infrastructure destruction is possible; if so, it is removed.
  • Only after all Infrastructures in all Environments are destroyed will the Connection Interfaces created by Plugins and the Application/Infrastructure records be deleted.

If there is no active deployment, only the Application or Infrastructure record is deleted.

Syntax

stk delete app --target [APPLICATION_DIRECTORY]

Example:

Attention!

This command is for pipelines only. You must have STK CLI installed in your pipeline. See the example below for using the command in pipeline steps:

In the Application folder, run:

.github/workflows/run-cli-commands.yml
steps: 
- name: Delete App
run: |
stk delete app --target ./Applications/my-app

Parameters

OptionsDescriptionExample
-o, --targetSets the target directory to remove the Application.
stk delete app --target ./Applications/my-app
-h, --helpShows command help and exits.
stk delete app --help

stk deploy app

The stk deploy app command deploys your Application to an Environment in your Workspace.

Before running the command, do the following:

  1. Log in to your Account with stk login.
  2. Activate a Workspace using stk use workspace.

Usage

stk deploy app

Parameters

OptionsDescriptionExample
-v, --versionSets the deployment version using semantic versioning, e.g., "1.0.0".
stk deploy app --version 1.0.0
-e, --envSpecifies the Environment name for deployment. Check available Environments with stk list env.
stk deploy app --env qa
-b, --branchSets the Git branch for deployment. Optional.
stk deploy app --branch app2-last-release
--open-api-pathPath to the Open API file relative to the Git repository root. Optional.
stk deploy app --open-api-path /home/user/my-app-folder
-w, --watchAutomatically monitors the deployment status.
stk deploy app --env qa --watch
-wf, --workflowName of the deployment Workflow, using the qualifier.
stk deploy app --workflow studio/stack/workflow-name@1.0.0
-rs, --report-statusReports the deployment status as an activity, visible in the StackSpot Portal.
stk deploy app --workflow studio/stack/workflow-name@1.0.0 --report-status
-q, --non-interactiveEnables non-interactive mode, not prompting for missing parameters.
stk deploy app --workflow studio/stack/workflow-name@1.0.0 --report-status --non-interactive
-bc, --backend-configStackSpot Workflows only. Defines the Terraform backend where the deploy state will be saved. For S3, provide only the S3 object; for AZURERM, only the azurerm object. See contracts in the deploy guide.
stk deploy app --workflow studio/stack/workflow-name@1.0.0 --report-status --non-interactive --backend-config '{{"type":"S3","s3":{"iac":{"bucket":"","region":""},"tfstate":{"bucket":"","region":""}}}}'
-rwc, --resume-workflow-configAccepts a JSON string with Azure, GitHub, or GitLab configurations (one at a time). Examples:
{"azure":{"pipeline_name":"...","org":"...","project_name":"...","branch":"..."}}
,
{"github":{"repository_name":"...","org":"...","workflow_name":"...","branch":"..."}}
ou
{"gitlab":{"id":"...","slug":"..."}}
stk deploy app --workflow studio/stack/workflow-name@1.0.0 --report-status --non-interactive --backend-config '{{"type":"S3","s3":{"iac":{"bucket":"","region":""},"tfstate":{"bucket":"","region":""}}}}' --resume-workflow-config '{{"azure":{"pipeline_name":"...","org":"...","project_name":"...","branch":"..."}}}'
-h, --helpShows command help and exits.
stk deploy app --help

stk destroy app

Attention!

This feature is temporarily disabled. If you need to destroy an Application, contact StackSpot support.

The stk destroy app command removes an Application from an Environment.

Usage

Syntax

stk destroy app --env <ENVIRONMENT_NAME>

Example

Navigate to your Application directory and run:

cd my-app-folder
stk destroy app --env prod

Parameters

OptionsDescriptionExample
-e, --envEnvironment where the Application was deployed. Required.
stk destroy app --env prod
-w, --watchAutomatically monitors the destroy status.
stk destroy app --env prod --watch
-q, --non-interactiveDoes not prompt for parameters and returns an error if any required parameter is missing.
stk destroy app --env prod --non-interactive
-wf, --workflow TEXTName of the Workflow to destroy the Application.
stk destroy app --env prod --watch --workflow studio-name/stack-name/workflow-name
-rs, --report-statusWorkflow only. Reports execution status as an activity.
stk destroy app --env prod --watch --workflow studio-name/stack-name/workflow-name --report-status
-h, --helpShows command help and exits.
stk destroy app --help

stk list app

The stk list app command displays all Applications registered in the active Workspace.

Before running the command, do the following:

  1. Log in to your Account with stk login.
  2. Activate a Workspace using stk use workspace.

Usage

stk list app

Parameters

OptionsDescriptionExample
-h, --helpShows command help and exits.
stk list app --help

stk register app

The stk register app command registers an Application in your Workspace.

Before running the command:

  1. Log in to your Account with stk login.
  2. Activate a Workspace using stk use workspace.

Usage

Inside the Application directory, run:

stk register app

Parameters

OptionsDescriptionExample
-r, --remoteRemote Git repository URL for hosting the Application. If not provided, configure it manually.
stk register app --remote url
-bb, --base-branchName of the Application repository's base branch.
stk register app --base-branch my-app-release-branch
-er, --extra-repositories TEXTList of additional repositories in JSON format:
"[{"name":"repository_name", "description":"repository_description", "provider":"repository_provider", "url":"repository_url"}]"
stk register app --base-branch my-app-release-branch --extra-repositories "[{"name":"my-example-app-repo", "description":"repository for test my apps", "provider":"github", "url":"https://github.com/my-organization-name/my-example-app-repo"}]"
-h, --helpShows command help and exits.
stk register app --help

stk register app-deploy

The stk register app-deploy command registers an Application deployment in your Workspace, used for Applications that do not use StackSpot Runtimes.

Usage

Attention!

This command is for pipelines only. You must have STK CLI installed in your pipeline. See the example below for using the command in pipeline steps:

Before running the command:

  1. Log in to your Account with stk login.
  2. Activate a Workspace using stk use workspace.
.github/workflows/run-cli-commands.yml
steps: 
- name: Authenticate StackSpot
run: |
stk login --client-id ${{ secrets.CLIENT_ID }} --client-key ${{ secrets.CLIENT_KEY }} --realm ${{ secrets.CLIENT_REALM }}

- name: Use your Workspace
run: |
stk use workspace my-workspace-name

- name: Register App Deployment
run: |
stk register app-deploy --env prod --status success --version 1.0.0 --target ./Apps/my-app

Inside the Application directory, run:

stk register app-deploy --env prod --status success --version 1.0.0 --target ./Apps/my-app

Parameters

OptionsDescriptionExample
-e, --envEnvironment name for registering the Application deployment.
stk register app-deploy --env dev
-s, --status [error, success]Deployment status: error or success.
stk register app-deploy --status success
-v, --versionApplication version to register the deployment.
stk register app-deploy --env prod --status success --version 1.0.0
-o, --targetDirectory where the Application deployment occurred.
stk register app-deploy --env prod --status success --version 1.0.0 --target ./Apps/my-app
-er, --links TEXTList of additional links for the Application. Each item must be a JSON object:
"[{"title":"url title", "url":"text_url"}]"
stk register app-deploy --links "[{"title":"url title", "url":"text_url"}]"
-h, --helpShows command help and exits.
stk register app-deploy --help

stk register app-destroy

The stk register app-destroy command registers the destruction of an Application in the Workspace, used for Applications that do not use StackSpot Runtimes.

Usage

Attention!

This command is for pipelines only. You must have STK CLI installed in your pipeline. See the example below for using the command in pipeline steps:

Before running the command:

  1. Log in to your Account with stk login.
  2. Activate a Workspace using stk use workspace.
.github/workflows/run-cli-commands.yml
steps: 
- name: Authenticate StackSpot
run: |
stk login --client-id ${{ secrets.CLIENT_ID }} --client-key ${{ secrets.CLIENT_KEY }} --realm ${{ secrets.CLIENT_REALM }}

- name: Use your Workspace
run: |
stk use workspace my-workspace-name

- name: Register App Destroy
run: |
stk register app-destroy --env prod --status success --target ./Apps/my-app

Inside the Application directory, run:

stk register app-destroy --env dev --status failed --target ./Apps/my-app

Parameters

OptionsDescriptionExample
-e, --envEnvironment name for registering the destroy operation.
stk register app-destroy --env dev
-s, --status [success, failed]Destroy status: success or failed.
stk register app-destroy --status success
-o, --targetDirectory where the Application destroy operation occurred.
stk register app-destroy --env prod --status success --target ./Apps/my-app
-h, --helpShows command help and exits.
stk register app-destroy --help

stk rollback app

The stk rollback app command executes the Application rollback.

Usage

Syntax

stk rollback app --version <VERSION> --env <ENVIRONMENT_NAME>

Example

stk rollback app --version 1.2.0 --env prod

Parameters

OptionsDescriptionExample
-v, --versionVersion of the tag used for deployment, following semantic versioning.
stk rollback app --version 1.2.0 --env prod
-e, --envEnvironment for the rollback. Check environments with stk list env.
stk rollback app --version 1.2.0 --env prod
-w, --watchAutomatically monitors the rollback status.
stk rollback app --version 1.2.0 --env prod --watch
-q, --non-interactiveDoes not prompt for parameters and returns an error if any required parameter is missing.
stk rollback app --version 1.0.0 --env prod --non-interactive
-wf, --workflow TEXTName of the Workflow for Application rollback.
stk rollback app --version 1.2.0 --env prod --workflow studio-name/stack-name/workflow-name
-bc, --backend-configStackSpot Workflows only. Defines the Terraform backend for saving deploy state. For S3, provide only the S3 object; for AZURERM, only the azurerm object. See contracts in the deploy guide.
stk rollback app --version 1.2.0 --env prod --report-status --non-interactive --backend-config '{{"type":"S3","s3":{"iac":{"bucket":"","region":""},"tfstate":{"bucket":"","region":""}}}}'
-rs, --report-statusWorkflow exclusive use. Reports the execution status as an activity.
stk rollback app --version 1.2.0 --env prod --report-status
-h, --helpShows command help and exits.
stk rollback app --help

stk update app

The stk update app command updates Application data in StackSpot.

You can update:

  • Name;
  • Description;
  • Repository URL;
  • Default branch.

Usage

Syntax

stk update app [OPTIONS]

Example

stk update app --description "Updated Application description"
Additional Information

Application metadata will be synchronized with the API.

Parameters

OptionsDescriptionExample
-n, --name TEXTUpdates the Application name.
stk update app --name app-renamed
-d, --description TEXTUpdates the Application description.
stk update app --description "my new app description"
-r, --repo-url TEXTSets the Application's Git repository URL.
stk update app --repo-url https://github.com/my-org/my-new-app-repository
-b,--repo-base-branch TEXTUpdates the Application's base branch.
stk update app --name "update/app-branch-name"
-q, --non-interactiveEnables non-interactive mode, without prompting for missing parameters.
stk update app --non-interactive
-er, --extra-repositories TEXTList of additional repositories in JSON format:
"[{"name":"repository_name", "description":"repository_description", "provider":"repository_provider", "url":"repository_url"}]"
stk update app --name app-renamed --extra-repositories "[{"name":"my-example-app-repo", "description":"repository for test my apps", "provider":"github", "url":"https://github.com/my-organization-name/my-example-app-repo"}]"
-h, --helpShows command help and exits.
stk update app --help

stk validate app

The stk validate app command validates the structure of an Application. Run the command in the Application directory.

The command will:

  • Validate the Application structure;
  • Remove empty folders;
  • Ignore unwanted files and folders at the end of development.
info

Files ignored in the .gitignore file will not be validated.

At the end, the command displays any inconsistencies and the validation result.

Usage

stk validate app

Parameters

OptionsDescriptionExample
-v, --verboseDisplays details of all analyzed, validated, and ignored items.
stk validate app --verbose
-h, --helpShows command help and exits.
stk validate app --help