Skip to main content

General Commands

In this section, you will learn more about the general STK CLI commands.


CommandDescription
stk --helpThe --help flag shows more information about the commands and their parameters.
stk --versionShows the current installed version.
stk aiStarts StackSpot Artificial Intelligence Assistant.
stk configure connectionEdits the required connection settings when applying an app or infra Plugin.
stk config localeIt configures the STK CLI language.
stk create extensionCreates an Extension for StackSpot EDP.
stk deploy planGenerates a manifest file used to plan a deployment of an Application or Infrastructure.
stk deploy statusMonitors the status of the current deploy running.
stk destroy statusDisplays the status of the destroy using its ID.
stk diff stateDisplays a diff of deploying an Application or Infrastructure between two environments.
stk initLaunches and configures the STK CLI tool in your environment.
stk list envLists all environments available within a Workspace.
stk list studioLists all Studios available in your StackSpot account.
stk loginLog in to a StackSpot account.
stk logoutLogs out of the StackSpot account.
stk notifyCommand to send a Deploy notification to StackSpot.
stk publish apiPublishes your API on StackSpot.
stk publish extensionPublish your Extension on StackSpot EDP.
stk rollback statusDisplays the status of the rollback using its ID.
stk show meDisplays your StackSpot account user information on the terminal.
stk update api-definitionUpdates an API's definitions.
stk update docUpdate the documentation of an Action, Plugin or Stack.
stk upgradeUpdates to a new version of the CLI.

stk --help

The --help option shows more information about the commands and their parameters.

To use this option, simply type the command you want to learn more about, followed by the --help flag.

Usage

<stk command> --help

stk --version

The stk --version command displays the current version of the STK CLI that is installed in the terminal.

Usage

stk --version

Parameters

OptionDescriptionExample
--version or -vDisplays the current version of the STK CLI installed on your machine.
stk --version
or
stk -v

stk ai

The stk ai command starts StackSpot Artificial Intelligence Assistant in your terminal.

Usage

Run the command below to initialize the assistant:

stk ai

Then, start prompt with the assistant.

  • To access the code analysis tool. Input 'code' in your prompt and paste the source code to review;
  • Insert 'exit' or 'Ctrl+c' to end your session.

Parameters

OptionDescriptionExample
-oc, --only-codeUse this option to generate only the code without explanations from the agent.
stk ai code [your prompt here] --only-code
-o, --outputDefines a file to write the prompt exit code.
stk ai code [your prompt here] --output file.txt
-h, --helpDisplays the command help and exits.
stk ai --help

stk configure connection

warning

The stk configure connection-interface command is deprecated and will no longer be used. It has been updated to stk configure connection .

The stk configure connection command allows you to edit the connection settings required when applying an app or infra Plugin.

  • The required connection must already be registered.

Usage

Syntax

stk configure connection [OPÇÕES] [CONNECTION-ALIAS]

You can configure the connections that appear in the StackSpot Portal list.


Example

stk configure connection-interface <connection-alias> --plugin <studio>/<stack>/<plugin>@<version> --new-value <connection-to-select>

Parameters

OptionDescriptionExample
-a, --aliasThe plugin alias to be configured.
stk configure connection my-conn-alias --alias my-plugin-alias
-nv, --new-valueThe name of the new connection.
stk configure connection my-conn-alias --plugin my-studio/my-stack/my-lambda-plugin@1.0.0 --new-value my-new-conn-alias
-h, --helpDisplays the command help and exits.
stk configure connection --help

stk config locale

The stk config locale command allows you to edit the language of the STK CLI between en_US and pt_BR.

Usage

Syntax

stk config locale [OPTIONS]

Example

stk config locale

In the terminal, select between Portuguese or English.

Parameters

OptionDescriptionExample
-h, --helpIt displays the command help and exits.
stk config locale --help

stk create extension

The stk create extension command sets up a customizable Extension for StackSpot EDP using the STK CLI. You need to add your Extension code to this structure.

Usage

To create an extension, you need to run the stk create extension command and provide the data for your Extension:

  • Name of the Extension;
  • Description for the Extension;
  • Level at which your Extension will be visible. The available options are the Organization or Workspace levels;
  • Path to the folder where you will add your extension code.

Syntax

stk create extension [OPTIONS] [NAME]

Example

stk create extension dashboard-extension --level workspace

Parameters

OptionsDescriptionExample
-r, --remote GIT-REMOTE-URLURL of a Git repository as the source of an Extension's repository. When the NAME value is not provided in the Extension, in which case the NAME value will be set to the name of the Git repository provided.
stk create extension --remote https://github.com/my-gh-organization/my-extension-repository
-sgi, --skip-git-initDo not start a Git repository in the Extension's folder.
stk create extension my-extension-name --skip-git-init
-d, --descriptionDescription that explains the purpose and use of your Extension.
stk create extension my-extension-name --description "Creating my first StackSpot EDP Extension."
-l, --levelSets the levels at which the Extension will be available. Accepted levels are: organization or workspace.
stk create extension my-extension-name --description "Creating my first StackSpot EDP Extension." --level workspace
-p, --pathRelative path to the distribution folder. The distribution folder (list) is the folder that contains the optimized and ready-to-use code of your Extension for production use. The project build process generates the distribution folder.
stk create extension my-extension-name --description "Creating my first StackSpot EDP Extension." --level workspace --path /project/dist
-q, --non-interactiveDoes not prompt the user for input parameters and returns an error if any required parameter is not provided.
stk create extension my-extension-name --description "Creating my first StackSpot EDP Extension." --level workspace --non-interactive
-h, --helpDisplays command help and exits.
stk create extension --help

stk deploy status

The stk deploy status command monitors and displays the deploy status of your running Application or Infrastructure.

Before running the command, you must:

  1. Log in to your Account with the stk login command.
  2. If you do not have an active Workspace, access a Workspace with the stk use workspace command.

Usage

stk deploy status [APP-OR-INFRA_ID]
info

The deployment ID is located in the stk.yaml file of the application or infrastructure, in the spec field, in the app-id or infra-id attributes.

Parameters

OptionDescriptionExample
-w, --watchAutomatically monitors and displays the deployment status in the terminal.
stk deploy status STATUS_ID --watch
-r, --reportGenerates a status report with the specified file type. Supported file types are: json or md.
stk deploy status STATUS_ID --watch --report json
ou
stk deploy status STATUS_ID --watch --report md
-h, --helpDisplays the command help and exits.
stk deploy status --help

stk deploy plan

The stk deploy plan command generates a manifest file (manifest.yaml) used to plan an Application or Infrastructure deployment.

Before executing the command, you must:

  1. Log in to your Account with the stk login command.
  2. If you have an active Workspace, access a Workspace with the stk use workspace command.

Use

stk deploy plan --env env_name

Parameters

OptionsDescriptionExample
-e, --envIt defines the name of the Environment that will be used to deploy the Application. See the Environments available in your Workspace using the stk list env command.
stk deploy plan --env qa
-o, --targetPath where the manifest.yaml file will be generated. By default, it will be generated in the current folder.
stk deploy plan --env qa --target /home/user/app
-v, --versionIt defines the version of the deploy tag. You need to use the semantic versioning pattern. Example: "1.0.0"
stk deploy plan --version 1.0.0
-b, --branchName of the Git branch that will be used in the deployment. Optional.
stk deploy plan --branch app2-last-release
-r, --repoThe repository URL must be validated with the repository registered in the Application/Infrastructure manifest.
stk deploy plan --env development --repo https://github.com/my-org-name/org-repo-name
--open-api-pathPath to the Open API file relative to the Git repository root. Optional.
stk deploy plan --open-api-path API/my-app-folder
-h, --helpDisplays command help and exits.
stk deploy plan --help

stk destroy status

The stk destroy status command displays an Application or Infrastructure destruction status. You must use the ID returned by the stk destroy app and stk destroy infra commands.

Usage

Syntax

stk destroy status <DESTROY_ID>

Example

stk destroy status DESTROY_ID --watch --report

Parameters

OptionDescriptionExample
-w, --watchMonitors the shredding status automatically.
stk destroy status DESTROY_ID --watch
-r, --reportGenerates a status report with the specified file type. Supported file types are: json or md.
stk destroy status DESTROY_ID --watch --report json
ou
stk destroy status DESTROY_ID --watch --report md
-h, --helpDisplays the command help and exits.
stk destroy status --help

stk diff state

The stk diff state command compares an Application or Infrastructure's deployment status between a target environment and a source environment, displaying the differences in the terminal.

Usage

  1. Activate a Workspace with the stk use workspace command.
  2. Run the command inside the Application or Infrastructure folder, then specify the name(s) of the environment(s) you want to check.
  3. When you turn off the text highlight of the diff displayed in the terminal, the following symbols appear below the changed lines:
  • ---: Represents a removed section.
  • +++: Represents an added section.
  • ^^^: Represents a modified section.

Syntax

By default, the command compares the differences between the Application or Infrastructure specified in TARGET_ENV and your local environment:

stk diff state [TARGET_ENV]

Use the --origin-env option to specify the source environment you want.

stk diff state [TARGET_ENV] --origin-env [ORIGIN_ENV]

Example

Compare the state of a local Application with the Application in the production environment:

stk diff state production

Compare the state of an Application in the development environment with the Application in the production environment:

stk diff state production --origin-env development

To turn off the highlight displayed in the terminal, use the --highlight-disable option:

stk diff state development --highlight-disable

Parameters

OptionsDescriptionExample
-o, --origin-envSpecifies the environment used in deploying the Application or Infrastructure. You must provide the desired environment name. The default value is ‘local’, which compares the Application or Infrastructure in the current local folder.
stk diff state development --origin-env production
--hd, --highlight-disableTurn off the highlight of the diff displayed in the terminal.
stk diff state development --highlight-disable
-h, --helpDisplays the command help and exits.
stk diff state --help

stk init

The stk init command initializes and configures the STK CLI tool in your environment. It shows a list of all available parameters, and allows you to configure the proxy and disable certificates.

Users with the private VPN must configure the parameters manually.

Parameters

The following options are available:

OptionDescriptionExample
-k ou --disable-ssl-verifyDisables verification of SSL certificates. This is useful when the proxy in private VPN environments returns invalid certificates to GitHub.
stk init --disable-ssl-verify
-p ou --proxy <host>:<port>Configures a proxy to make HTTP connections.
stk init --proxy proxy.mycorp:8080
-c ou --cleanClears previously made settings. This is useful to remove default settings.
stk init --clean
-e ou --proxy-exclusions <url-proxy1>,<url-proxy-2>Defines a list of URLs, separated by a comma, which must not connect via the configured proxy.
stk init --proxy-exclusions proxy.mycorp1.com, proxy2.mycorp.com, proxyn.mycorp.com
-h, --helpDisplays the command help and exits.
stk init --help

stk list env

The stk list env command lists all environments available to your account.

Environments must be configured in the StackSpot Platform.
To learn how to set up an environment, see the guide to setting up your Workspace.

Before running this command, you must:

  1. Log in to your account with the stk login command.
  2. If you do not have an active workspace, access a workspace with the stk use workspace command.

Usage

stk list env

Parameters

OptionDescriptionExample
-h, --helpDisplays the command help and exits.
stk list env --help

stk list studio

The stk list studio command lists the Studios available in your StackSpot account in the terminal.

Use

stk list studio

Parameters

OptionsDescriptionExample
-h, --helpDisplays command help and exits.
stk list studio --help

stk login

The stk login command logs you into a StackSpot account. You need to enter your StackSpot account email address. The command then opens your browser and asks you to fill in your data and confirm access to generate a session.

Usage

stk login [EMAIL]

Parameters

OptionDescriptionExample
EMAILThe email address of your StackSpot account.
stk login mystackspot-account@email.com
-id, --client-idThe customer ID generated on the StackSpot platform
stk login mystackspot-account@email.com -id [ID value] -key [Client Key value]
-key, --client-keyThe customer key generated on the StackSpot platform.
stk login mystackspot-account@email.com -id [ID value] -key [Client Key value]
-r, --realmThe customer's StackSpot organization domain.
stk login mystackspot-account@email.com -id [ID value] -key [Client Key value] -r [Client realm name]
-a, --account-typeDefines the account type for the login. The available options are: enterprise or personal.
stk login mystackspot-account@email.com --account-type personal
-h, --helpDisplays the command help and exits.
stk login --help

stk logout

The stk logout command logs out a logged-in StackSpot account. It terminates the session created by the stk login command.

Usage

stk logout

stk notify

The stk notify command must be executed after using deploy commands, such as [application deployment](home/stk-cli/commands/application-commands. md#stk-deploy-app) or infrastructure deployment, when the deployment is not executed by StackSpot Deploy.

The command will notify StackSpot that a deployment has been performed.

Usage

stk notify

stk publish api

The stk publish api command updates your API in StackSpot from the "draft" state to "published". This makes your API visible for use.

Usage

Syntax

stk publish api [API_ID]

Example

stk publish api AJDt2A5pe2T

Parameters

OptionDescriptionExample
-e, --envThe name of the environment that will be updated.
stk publish api AJDt2A5pe2T --env prod
-h, --helpDisplays the command help and exits.
stk publish api --help

stk publish extension

The stk publish extension command publishes a StackSpot EDP Extension.

Usage

The command is recommended for publishing EDP Extensions through pipelines.

Syntax

stk publish extension [OPTIONS]

Example

stk publish extension --activate my-studio

Parameters

OptionsDescriptionExample
-a, --activateName of the Studio linked to the Extension.
stk publish extension --activate studio-slug-name
-q, --skip-confirmationSkips the Extension activation warning.
stk publish extension --activate studio-slug-name --skip-confirmation
-h, --helpDisplays command help and exits.
stk publish extension --help

stk rollback status

The stk rollback status command displays the rollback status of an application or Infrastructure. You must use the ID returned by the stk rollback app and stk rollback infra commands.

Usage

Syntax

stk rollback status <ROLLBACK_ID> --watch --report <report-format>

Example

stk rollback status ROLLBACK_ID --watch --report json

Parameters

OptionDescriptionExample
-w, --watchMonitors the rollback status automatically.
stk rollback status ROLLBACK_ID --watch
-r, --reportGenerates a status report with the specified file type. Supported file types are: json or md.
stk rollback status ROLLBACK_ID --watch --report json
ou
stk rollback status ROLLBACK_ID --watch --report md
-h, --helpDisplays the command help and exits.
stk rollback status --help

stk show me

The stk show me command displays your active StackSpot account user details in the STK CLI.

Use

Syntax

stk show me

Example

After the login, run the command to obtain the following data from your account:

stk show me

See the following example:

  • Name: registered username. Example: John Doe.
  • Username: registered username and/or email. Example: john.doe@github.com.
  • Email: account email address. Example: john.doe@github.com.
  • Account: your StackSpot account name. Example: John Doe.
  • Account Slug: your account slug. Example john-doe.
  • Account Type: your account type. Example: enterprise.
  • Realm: domain of your StackSpot account. Example: github.
  • Start session: start date of your session. Example: 2024-01-18 10:24:40.
  • Expiration session: session expiration date. Example: 2024-01-18 11:24:40.
  • Expiration refresh: session renewal date. Example: 2024-01-18 19:24:40.

Parameters

OptionsDescriptionExample
-h, --helpDisplays command help and exits.
stk show me --help

stk update api-definition

The stk update api-definition command updates the OpenAPI specification of your published API on StackSpot.

Usage

Syntax

stk update api-definition [API_ID]

Example

stk update api-definition AJDt2A5pe2T

Parameters

OptionDescriptionExample
-e, --envThe name of the API environment that will be updated.
stk update api-definition AJDt2A5pe2T --env prod
-c, --contractThe path to the OpenAPI specification file.
stk update api-definition AJDt2A5pe2T --contract home/user/my-apis/openapi-specs/api-spec.yaml
-g, --gateway-urlThe API base URL.
stk update api-definition AJDt2A5pe2T --env hom --gateway-url
-h, --helpDisplays the command help and exits.
stk update api-definition --help

stk update doc

The stk update doc command updates the documentation of an Action, Plugin or Stack.

Usage

Syntax

stk update doc [STUDIO-SLUG]

Inside your Stack, Plugin, or Action folder, run the command below:

Example

stk update doc

Parameters

OptionDescriptionExample
-s, --studioThe name of the Studio for which documentation will be updated.
stk update doc --studio my-studio-slug
-v, --verboseShow update doc command with more details.
stk update doc --verbose
-h, --helpDisplays the command help and exits.
stk update doc --help

stk upgrade

The stk upgrade command upgrades the STK CLI to the latest version when a new one is available.

Usage

To upgrade the STK CLI, run the following command in the terminal:

stk upgrade

If there is a new version available, the following message will be displayed:

Your STK CLI version 4.0.0 is outdated. The new version 4.1.0 is available.
To upgrade run the command: 'stk upgrade'.

Parameters

OptionDescriptionExample
--forceForces the STK CLI to upgrade to a new major version, even if it is incompatible with the current version.
stk upgrade --force
-h, --helpDisplays the command help and exits.
stk upgrade --help

A new major release brings changes from the previous release. These changes cause incompatibility between versions and make it impossible to go back to the previous version.

If a major version is available, the STK CLI will display an incompatibility warning when you try to upgrade. You can use the --force option to override the warning and upgrade to the new version.