General Commands
In this section, you will learn more about the general STK CLI commands.
Command | Description |
---|---|
stk --help | The --help flag shows more information about the commands and their parameters. |
stk --version | Shows the current installed version. |
stk ai | Starts StackSpot Artificial Intelligence Assistant. |
stk configure connection | Edits the required connection settings when applying an app or infra Plugin. |
stk config locale | It configures the STK CLI language. |
stk create extension | Creates an Extension for StackSpot EDP. |
stk deploy plan | Generates a manifest file used to plan a deployment of an Application or Infrastructure. |
stk deploy status | Monitors the status of the current deploy running. |
stk destroy status | Displays the status of the destroy using its ID. |
stk diff state | Displays a diff of deploying an Application or Infrastructure between two environments. |
stk init | Launches and configures the STK CLI tool in your environment. |
stk list env | Lists all environments available within a Workspace. |
stk list studio | Lists all Studios available in your StackSpot account. |
stk login | Log in to a StackSpot account. |
stk logout | Logs out of the StackSpot account. |
stk notify | Command to send a Deploy notification to StackSpot. |
stk publish api | Publishes your API on StackSpot. |
stk publish extension | Publish your Extension on StackSpot EDP. |
stk rollback status | Displays the status of the rollback using its ID. |
stk show me | Displays your StackSpot account user information on the terminal. |
stk update api-definition | Updates an API's definitions. |
stk update doc | Update the documentation of an Action, Plugin or Stack. |
stk upgrade | Updates 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
- Syntax
- stk init help
- stk create help
- stk list help
<stk command> --help
stk init --help
stk create --help
stk list --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
Option | Description | Example |
---|---|---|
--version or -v | Displays the current version of the STK CLI installed on your machine. | stk --versionor 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
Option | Description | Example |
---|---|---|
-oc , --only-code | Use this option to generate only the code without explanations from the agent. | stk ai code [your prompt here] --only-code |
-o , --output | Defines a file to write the prompt exit code. | stk ai code [your prompt here] --output file.txt |
-h , --help | Displays the command help and exits. | stk ai --help |
stk configure connection
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
Option | Description | Example |
---|---|---|
-a, --alias | The plugin alias to be configured. | stk configure connection my-conn-alias --alias my-plugin-alias |
-nv, --new-value | The 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 , --help | Displays 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
Option | Description | Example |
---|---|---|
-h , --help | It 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
Options | Description | Example |
---|---|---|
-r , --remote GIT-REMOTE-URL | URL 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-init | Do not start a Git repository in the Extension's folder. | stk create extension my-extension-name --skip-git-init |
-d , --description | Description that explains the purpose and use of your Extension. | stk create extension my-extension-name --description "Creating my first StackSpot EDP Extension." |
-l , --level | Sets 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 , --path | Relative 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-interactive | Does 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 , --help | Displays 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:
- Log in to your Account with the stk login command.
- 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]
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
Option | Description | Example |
---|---|---|
-w , --watch | Automatically monitors and displays the deployment status in the terminal. | stk deploy status STATUS_ID --watch |
-r, --report | Generates a status report with the specified file type. Supported file types are: json or md . | stk deploy status STATUS_ID --watch --report jsonou stk deploy status STATUS_ID --watch --report md |
-h , --help | Displays 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:
- Log in to your Account with the stk login command.
- If you have an active Workspace, access a Workspace with the stk use workspace command.
Use
stk deploy plan --env env_name
Parameters
Options | Description | Example |
---|---|---|
-e , --env | It 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 , --target | Path 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 , --version | It 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 , --branch | Name of the Git branch that will be used in the deployment. Optional. | stk deploy plan --branch app2-last-release |
-r , --repo | The 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-path | Path to the Open API file relative to the Git repository root. Optional. | stk deploy plan --open-api-path API/my-app-folder |
-h , --help | Displays 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
Option | Description | Example |
---|---|---|
-w, --watch | Monitors the shredding status automatically. | stk destroy status DESTROY_ID --watch |
-r, --report | Generates a status report with the specified file type. Supported file types are: json or md . | stk destroy status DESTROY_ID --watch --report jsonou stk destroy status DESTROY_ID --watch --report md |
-h , --help | Displays 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
- Activate a Workspace with the stk use workspace command.
- Run the command inside the Application or Infrastructure folder, then specify the name(s) of the environment(s) you want to check.
- 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
Options | Description | Example |
---|---|---|
-o, --origin-env | Specifies 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-disable | Turn off the highlight of the diff displayed in the terminal. | stk diff state development --highlight-disable |
-h , --help | Displays 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:
Option | Description | Example |
---|---|---|
-k ou --disable-ssl-verify | Disables 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 --clean | Clears 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 , --help | Displays 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:
- Log in to your account with the stk login command.
- If you do not have an active workspace, access a workspace with the stk use workspace command.
Usage
stk list env
Parameters
Option | Description | Example |
---|---|---|
-h , --help | Displays 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
Options | Description | Example |
---|---|---|
-h , --help | Displays 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
Option | Description | Example |
---|---|---|
EMAIL | The email address of your StackSpot account. | stk login mystackspot-account@email.com |
-id , --client-id | The customer ID generated on the StackSpot platform | stk login mystackspot-account@email.com -id [ID value] -key [Client Key value] |
-key , --client-key | The customer key generated on the StackSpot platform. | stk login mystackspot-account@email.com -id [ID value] -key [Client Key value] |
-r , --realm | The customer's StackSpot organization domain. | stk login mystackspot-account@email.com -id [ID value] -key [Client Key value] -r [Client realm name] |
-a , --account-type | Defines the account type for the login. The available options are: enterprise or personal . | stk login mystackspot-account@email.com --account-type personal |
-h , --help | Displays 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
Option | Description | Example |
---|---|---|
-e, --env | The name of the environment that will be updated. | stk publish api AJDt2A5pe2T --env prod |
-h , --help | Displays 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
Options | Description | Example |
---|---|---|
-a, --activate | Name of the Studio linked to the Extension. | stk publish extension --activate studio-slug-name |
-q, --skip-confirmation | Skips the Extension activation warning. | stk publish extension --activate studio-slug-name --skip-confirmation |
-h , --help | Displays 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
Option | Description | Example |
---|---|---|
-w, --watch | Monitors the rollback status automatically. | stk rollback status ROLLBACK_ID --watch |
-r, --report | Generates a status report with the specified file type. Supported file types are: json or md . | stk rollback status ROLLBACK_ID --watch --report jsonou stk rollback status ROLLBACK_ID --watch --report md |
-h , --help | Displays 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
Options | Description | Example |
---|---|---|
-h , --help | Displays 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
Option | Description | Example |
---|---|---|
-e, --env | The name of the API environment that will be updated. | stk update api-definition AJDt2A5pe2T --env prod |
-c, --contract | The path to the OpenAPI specification file. | stk update api-definition AJDt2A5pe2T --contract home/user/my-apis/openapi-specs/api-spec.yaml |
-g, --gateway-url | The API base URL. | stk update api-definition AJDt2A5pe2T --env hom --gateway-url |
-h , --help | Displays 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
Option | Description | Example |
---|---|---|
-s, --studio | The name of the Studio for which documentation will be updated. | stk update doc --studio my-studio-slug |
-v, --verbose | Show update doc command with more details. | stk update doc --verbose |
-h , --help | Displays 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
Option | Description | Example |
---|---|---|
--force | Forces the STK CLI to upgrade to a new major version, even if it is incompatible with the current version. | stk upgrade --force |
-h , --help | Displays 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.