Application Commands
In this section, you will find the list of Application commands.
| Command | Description |
|---|---|
| stk create app | Creates an Application from one or more Plugins. |
| stk delete app | Removes an Application hosted in a remote repository. |
| stk deploy app | Deploys your Application. |
| stk destroy app | Destroys the Application from an Environment. |
| stk list app | Lists all Applications registered in a Workspace. |
| stk register app | Registers an Application in a Workspace. |
| stk register app-deploy | Registers an Application deployment in a Workspace. |
| stk register app-destroy | Registers the destruction of an Application in a Workspace. |
| stk rollback app | Rolls back your Application. |
| stk update app | Updates Application information. |
| stk validate app | Validates 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.
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]
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
| Options | Description | Example |
|---|---|---|
APP_NAME | Sets 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-nameSelect Stack version: stk create app my-app-name --starter my-studio/my-stack@3.0.0/starter-nameLocal 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-init | Skips Git repository initialization when creating the Application. | stk create app my-app-name --skip-git-init |
-d, --description | Sets 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-interactive | Does 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 TEXT | Path 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, --target | Sets 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 TEXT | List 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 TEXT | Name of the Workflow used to create the Application. | stk create app my-example-app --workflow studio-name/stack-name/workflow-name |
-rs, --report-status | Workflow 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 TEXT | Workflow 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, --help | Shows 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:
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:
steps:
- name: Delete App
run: |
stk delete app --target ./Applications/my-app
Parameters
| Options | Description | Example |
|---|---|---|
-o, --target | Sets the target directory to remove the Application. | stk delete app --target ./Applications/my-app |
-h, --help | Shows 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:
- Log in to your Account with stk login.
- Activate a Workspace using stk use workspace.
Usage
stk deploy app
Parameters
| Options | Description | Example |
|---|---|---|
-v, --version | Sets the deployment version using semantic versioning, e.g., "1.0.0". | stk deploy app --version 1.0.0 |
-e, --env | Specifies the Environment name for deployment. Check available Environments with stk list env. | stk deploy app --env qa |
-b, --branch | Sets the Git branch for deployment. Optional. | stk deploy app --branch app2-last-release |
--open-api-path | Path to the Open API file relative to the Git repository root. Optional. | stk deploy app --open-api-path /home/user/my-app-folder |
-w, --watch | Automatically monitors the deployment status. | stk deploy app --env qa --watch |
-wf, --workflow | Name of the deployment Workflow, using the qualifier. | stk deploy app --workflow studio/stack/workflow-name@1.0.0 |
-rs, --report-status | Reports 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-interactive | Enables 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-config | StackSpot 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-config | Accepts 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, --help | Shows command help and exits. | stk deploy app --help |
stk destroy app
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
| Options | Description | Example |
|---|---|---|
-e, --env | Environment where the Application was deployed. Required. | stk destroy app --env prod |
-w, --watch | Automatically monitors the destroy status. | stk destroy app --env prod --watch |
-q, --non-interactive | Does not prompt for parameters and returns an error if any required parameter is missing. | stk destroy app --env prod --non-interactive |
-wf, --workflow TEXT | Name of the Workflow to destroy the Application. | stk destroy app --env prod --watch --workflow studio-name/stack-name/workflow-name |
-rs, --report-status | Workflow only. Reports execution status as an activity. | stk destroy app --env prod --watch --workflow studio-name/stack-name/workflow-name --report-status |
-h, --help | Shows 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:
- Log in to your Account with stk login.
- Activate a Workspace using stk use workspace.
Usage
stk list app
Parameters
| Options | Description | Example |
|---|---|---|
-h, --help | Shows 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:
- Log in to your Account with stk login.
- Activate a Workspace using stk use workspace.
Usage
Inside the Application directory, run:
stk register app
Parameters
| Options | Description | Example |
|---|---|---|
-r, --remote | Remote Git repository URL for hosting the Application. If not provided, configure it manually. | stk register app --remote url |
-bb, --base-branch | Name of the Application repository's base branch. | stk register app --base-branch my-app-release-branch |
-er, --extra-repositories TEXT | List 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, --help | Shows 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
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:
- Log in to your Account with stk login.
- Activate a Workspace using stk use workspace.
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
| Options | Description | Example |
|---|---|---|
-e, --env | Environment 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, --version | Application version to register the deployment. | stk register app-deploy --env prod --status success --version 1.0.0 |
-o, --target | Directory where the Application deployment occurred. | stk register app-deploy --env prod --status success --version 1.0.0 --target ./Apps/my-app |
-er, --links TEXT | List 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, --help | Shows 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
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:
- Log in to your Account with stk login.
- Activate a Workspace using stk use workspace.
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
| Options | Description | Example |
|---|---|---|
-e, --env | Environment 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, --target | Directory where the Application destroy operation occurred. | stk register app-destroy --env prod --status success --target ./Apps/my-app |
-h, --help | Shows 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
| Options | Description | Example |
|---|---|---|
-v, --version | Version of the tag used for deployment, following semantic versioning. | stk rollback app --version 1.2.0 --env prod |
-e, --env | Environment for the rollback. Check environments with stk list env. | stk rollback app --version 1.2.0 --env prod |
-w, --watch | Automatically monitors the rollback status. | stk rollback app --version 1.2.0 --env prod --watch |
-q, --non-interactive | Does 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 TEXT | Name of the Workflow for Application rollback. | stk rollback app --version 1.2.0 --env prod --workflow studio-name/stack-name/workflow-name |
-bc, --backend-config | StackSpot 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-status | Workflow exclusive use. Reports the execution status as an activity. | stk rollback app --version 1.2.0 --env prod --report-status |
-h, --help | Shows 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"
Application metadata will be synchronized with the API.
Parameters
| Options | Description | Example |
|---|---|---|
-n, --name TEXT | Updates the Application name. | stk update app --name app-renamed |
-d, --description TEXT | Updates the Application description. | stk update app --description "my new app description" |
-r, --repo-url TEXT | Sets the Application's Git repository URL. | stk update app --repo-url https://github.com/my-org/my-new-app-repository |
-b,--repo-base-branch TEXT | Updates the Application's base branch. | stk update app --name "update/app-branch-name" |
-q, --non-interactive | Enables non-interactive mode, without prompting for missing parameters. | stk update app --non-interactive |
-er, --extra-repositories TEXT | List 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, --help | Shows 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.
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
| Options | Description | Example |
|---|---|---|
-v, --verbose | Displays details of all analyzed, validated, and ignored items. | stk validate app --verbose |
-h, --help | Shows command help and exits. | stk validate app --help |