Skip to main content

Use content without Workspace

In this section, you will find a guide on how to use content without a Workspace.


You can use content published in your Studio without having an active Workspace to create Applications locally on your machine, apply Plugins, and execute Actions. This way, it is possible to locally test Applications, Actions, and Plugins before using them within a Workspace.

Prerequisites

  • Access to a Studio;
  • Have Actions, Plugins, and Stacks in the Studio used.
tip

All the following steps are performed in the STK CLI. Since all actions are executed outside a Workspace, you must access your StackSpot account to get the name and version of the Stack, Plugin, Action, and the name of the Studio used.

Create an Application Outside a Workspace

Step 1. Access Starter in your Studio

  1. After logging in, select 'Studios' from the side menu and access your Studio;
  2. In the side menu, choose 'Stacks' to view the Stacks within the Studio;
  3. On the Stack page, click 'Starters' and then click the Starter of the Stack;
  4. Below the Starter name, copy the command code to create your Application.

The copied code contains:

# inform 'app-name', 'studio-name', 'stack-name' and 'starter-name' without curly brackets
stk create app {app-name} --starter {studio-name}/{stack-name}/{starter-name}

Example:


Animation showing how to copy the Starter command from the Studio.

The command obtained will be:

stk create app {app-name} --starter technical-writers/react-website-template/install-site-template

Step 2. Execute the command to create the Application

  1. Open the terminal and log in to your account. Execute the stk login command;
  2. If logged into your account, ensure no Workspace is active. Run the stk exit workspace command:
stk exit workspace
  1. To create your Application, execute the command from Step 1:

Replace {app-name} with a name for your Application, and enter the text without curly brackets.


# inform 'app-name', 'studio-name', 'stack-name' and 'starter-name' without curly brackets
stk create app {app-name} --starter {studio-name}/{stack-name}/{starter-name}

Example:

stk create app react-site-test --starter technical-writers/react-website-template/install-site-template
tip

To use another published version of a Stack, enter the desired version in this format: stack-name@version-number after the Stack name. Otherwise, StackSpot uses the latest published version.

# inform 'app-name', 'studio-name', 'stack-name@version' and 'starter-name' without curly brackets
stk create app {app-name} --starter {studio-name}/{stack-name@1.0.0}/{starter-name}

See the example:

stk create app react-site-test --starter technical-writers/react-website-template@1.0.0/install-site-template

After executing the command, the terminal displays the Studio, the Stack with its current version, and the Starter used.

? Name your application react-site-test
? Do you want to init a git repository? No
? App description: (Describe your app explaining its purpose)
> Fetching stacks info of account 'stk-techwriters'.
? Select the studio: technical-writers
? Select the stack: react-website-template@3.1.0
? Select the starter: install-site-template
> Creating app outside workspace.
> Fetching starter info.

Then, the Plugins from the Starter are installed. Provide the inputs, and your Application is created in the current folder.

Isolated use of Plugins

warning

When applying Infrastructure Plugins, Connectors are created from the Connection Interfaces the Plugin must generate. You must use an alias for these Connectors when applying Infrastructure Plugins, and they must follow the following rules:

  • The alias must not exist in your current Application or Infrastructure yaml file;
  • The alias must not have the same name as a Connector that exists in your account;
  • The alias must respect the following regular expression, where the minimum length is two characters and the maximum is 50 characters: ((^(?!^\d+$)[a-z\d]{2,})(-[a-z\d]+)*$).

1. Apply Local Plugin

After creating a Plugin, apply it to test its behavior and check generated files. To do this, create a new folder and run the command below within it:

# inform the absolute folder path without curly brackets
stk apply plugin {plugin-absolute-path}

Example:

Consider a Plugin in the following path: /Users/stk.techwriters/personal-plugins/doc-template-plugin. Execute the command as follows:

stk apply plugin /Users/stk.techwriters/personal-plugins/doc-template-plugin

After that, complete all the inputs requested in the Plugin application in the terminal. The Plugin files are generated in the current folder.

2. Apply Plugin without Workspace

To apply a Plugin without a Workspace, create a new folder and run the commands below within it:

  1. Open the terminal and log in to your account. Execute the stk login command;
  2. If logged into your account, ensure no Workspace is active. Run the stk exit workspace command:
stk exit workspace
  1. Run the stk apply plugin command as in the following example:
# inform 'studio-name', 'plugin-name' and 'version-number' without curly brackets
stk apply plugin {studio-name}/{plugin-name}@{version-number}

Example:

Applying 'doc-template-app@3.0.0' Plugin in 'technical-writers' Studio
stk apply plugin technical-writers/doc-template-app@3.0.0

After that, complete all the inputs requested in the Plugin application in the terminal. The Plugin files are generated in the current folder.

Isolated use of Actions

Run Local Action

Immediately after creating an Action, execute it to test its behavior and check generated files. To execute the Action, use one of the commands below:

# inform the absolute folder path without curly brackets
stk run action {action-absolute-path}

Inside the Action folder:

# run it inside the action folder
stk run action .

Example:

Consider an Action in the following path: /Users/stk.techwriters/personal-actions/install-node-action. Execute the command as follows:

stk run action /Users/stk.techwriters/personal-actions/install-node-action

You can also access the Action folder and execute the command inside that folder:

stk run action .

After that, complete all the inputs requested when executing the Action in the terminal.

Run Action without Workspace

To run an Action without a Workspace, log in to your account and ensure no active Workspace:

  1. Open the terminal, log in to your account, and execute the stk login command;
  2. If logged into your account, make sure no Workspace is active. Run the stk exit workspace command:
stk exit workspace
  1. Run the stk run action command, specifying the Studio name, Stack name, version number, and Action name:
# inform 'studio-name', 'stack-name', 'version-number' and 'action-name' without curly brackets
stk run action {studio-name}/{stack-name}@{version-number}/{action-name}

Example:

To run the install-node-action Action of the react-doc-template Stack in the technical-writers Studio, execute the following command:

Running 'install-node-action' Action of 'react-doc-template' Stack and 'technical-writers' Studio
stk run action technical-writers/react-doc-template@2.1.0/install-node-action

Afterward, complete all the inputs requested when executing the Action in the terminal.

Next Steps