Skip to main content

Create Application via STK CLI

Overview

In StackSpot, an Application is any source code that implements business rules, such as classes, methods, library imports, or the code of a minimally functional Application.

Applications are developed within Workspaces, using tools such as Plugins, Stacks, Starters, or available Workflows, which make the development and delivery of solutions faster and simpler.

warning

It is not possible to create an Application using a Starter that is marked as deprecated.

In StackSpot, you can create Applications in two ways:

  • STK CLI
  • StackSpot EDP Portal

To create an Application, you must use a Stack and either a Starter or a Workflow.

The following steps show how to create Applications using Workflows through the STK CLI.

Prerequisites

Before you begin, make sure you have:


caution

If you do not meet any of the prerequisites above, pause this guide and use the corresponding link to complete the pending setup before continuing.


Step-by-Step: Creating an Application via STK CLI with a Workflow

Step 1. In your terminal, select the Workspace you want to use to create the Application. Run:

stk use workspace

The Workspaces in your account will be listed in the terminal. Select the Workspace and press Enter.

tip

To list all available Workspaces in the terminal, run stk list workspace. The Workspace currently in use is marked with an asterisk.

You can also check this in the StackSpot Portal, in the Workspaces section.

Step 2. To create the Application using a Workflow, run:

tip

For Studio, Stack, and Workflow names, always use the slug. The slug is the name registered in the StackSpot EDP Portal. The displayed name may differ from the slug, which can cause errors when creating the Application via STK CLI.

stk create app <APP-NAME> --workflow <STUDIO-SLUG>/<STACK-SLUG>/<WORKFLOW-SLUG>

Example:

stk create app app-with-workflow --workflow studio-name/stack-name/workflow-create-app
danger
  • If the --workflow argument is provided, the CLI will run the specified Workflow of type create or starter.
  • The Workflow is responsible for all steps, including applying Plugins, configuring inputs, and any additional logic defined in the Workflow.
  • If both --starter and --workflow arguments are provided, the CLI will return an error because they are mutually exclusive.

Answer the Workflow prompts in the terminal. When the process finishes, your Application will be created.

tip

If you want to create the Application folder (directory) in a different location or with a different name, use the --target or -o parameter.

Example:

stk create app app-with-workflow \
--workflow studio-name/stack-name/workflow-create-app \
--target /home/user/Applications/my-app

Step 3. Now register your Application in your StackSpot account. First, go to the Application directory:

cd <application-name>

Then, run the command to register it:

stk register app

Answer the prompts:

  • Repository URL: provide the repository that will store your Application code.
  • Base branch: provide the branch to be used in the repository.

You can now see your Application details in your Workspace in the StackSpot Portal, under the Applications section, and check the Workflow execution in the Activities section.

Your Application has been created and registered successfully!

caution