Installing the latest Tailor CLI

TailorCtl is a command-line tool that helps you to design and build applications on Tailor Platform.

On macOS, tailorctl can be installed with the Homebrew package manager:

<span><span style="color: var(--shiki-token-function)">brew</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">install</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">tailor-platform/tap/tailorctl</span></span>
<span></span>

Note: other operating systems are not currently supported.

Point to your workspace

Open console.tailor.tech and log in to Tailor Platform. You will find a step-by-step guide to create a workspace and an application.

Once you have created a workspace and an application, you can point to the workspace with the following command:

<span><span style="color: var(--shiki-token-function)">tailorctl</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">config</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">set</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">workspaceId</span><span style="color: var(--shiki-color-text)"> ${WORKSPACE-ID}</span></span>
<span></span>

Replace ${WORKSPACE-ID} with the ID of your workspace. You can find the IDs of your workspace and application on console.tailor.tech.

You can use the interactive mode of tailorctl to configure the workspace by running the following command. This will provide options to describe the current workspace, switch between workspaces, set a new workspace, list existing workspaces, and delete the selected workspace.

<span><span style="color: var(--shiki-token-function)">tailorctl</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">config</span></span>
<span><span style="color: var(--shiki-token-keyword)">?</span><span style="color: var(--shiki-color-text)"> config...  [Use arrows to move, type to filter]</span></span>
<span><span style="color: var(--shiki-token-keyword)">&gt;</span><span style="color: var(--shiki-color-text)"> describe</span></span>
<span><span style="color: var(--shiki-color-text)">  </span><span style="color: var(--shiki-token-function)">switch</span></span>
<span><span style="color: var(--shiki-color-text)">  </span><span style="color: var(--shiki-token-function)">set</span></span>
<span><span style="color: var(--shiki-color-text)">  </span><span style="color: var(--shiki-token-function)">list</span></span>
<span><span style="color: var(--shiki-color-text)">  </span><span style="color: var(--shiki-token-function)">delete</span></span>
<span></span>

Anatomy of TailorCTL

Local variables

As a local development tool, here are the three of the most important variables that are stored locally in your TailorCTL. It is important to keep in mind the current state of these three variables when you are developing with TailorCTL.

VariablesDescriptionHow to set
Control Plane Access TokenUsed to authenticate your requests to create and update workspaces and applicationstailorctl auth login
Workspace IDPointer to the Workspace that you are currently working ontailorctl config set workspaceId ${WORKSPACE-ID}
Data Plane Access TokenUsed to authenticate your requests to the application API as an user of the applicationtailorctl workspace app login

Control Plane Access Token

What it does: This token is created when you log in to Tailor Platform on TailorCTL. This token is used to authenticate your requests to the Control Plane API. Control Plane API is the interface to create and update workspaces, applications and platform users, etc.

How to set it: To log in to Tailor Platform, run tailorctl auth login command. This will create a token and store it locally in your TailorCTL.

Workspace ID

What it does: This is the pointer that defines which Workspace is targeted from your TailorCTL.

How to set it: To point to a Workspace, run tailorctl config set workspaceId ${WORKSPACE-ID} command. Replace ${WORKSPACE-ID} with the ID of the Workspace you want to target. You can find the ID of your Workspace on Console, or by running tailorctl workspace list command.

Data Plane Access Token

What it does: This token allows you to access the API endpoints of your application as a certain user of the application. This is different from the Tailor Platform user, who is a developer of the application and who can modify the design of the application itself.

How to set it: To log in to the Application as an user of the application, after you point to a application, run tailorctl workspace app login command. The username and password of the Application User is different from Tailor Platform user, as in tailorctl auth login command, and it is defined in the specific application level. Find more about the application user in the README of each template. Having said that, unless intentionally disabled, workspace owner should exist as an application user with the username and password you when you created the workspace.

Directory structure

Tailor Platform uses local configuration files to express the design of your application. These files are called Manifest.

Since these Manifests can include parameters specific to each environment, it is advisable to design your application based on our recommended structure. In our structure, workspace.cue will contain the entire set of information from application manifests.

As a result, the directory structure of your application will look like this:

<span><span style="color: var(--shiki-token-function)">├──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">cue.mod</span></span>
<span><span style="color: var(--shiki-token-function)">├──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">environment</span></span>
<span><span style="color: var(--shiki-token-function)">├──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">application</span></span>
<span><span style="color: var(--shiki-token-function)">├──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">services</span></span>
<span><span style="color: var(--shiki-token-function)">│  </span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">├──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">auth</span></span>
<span><span style="color: var(--shiki-token-function)">│  </span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">├──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">pipeline</span></span>
<span><span style="color: var(--shiki-token-function)">│  </span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">│  </span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">└──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">resolvers</span></span>
<span><span style="color: var(--shiki-token-function)">│  </span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">└──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">tailordb</span></span>
<span><span style="color: var(--shiki-token-function)">│  </span><span style="color: var(--shiki-color-text)">     </span><span style="color: var(--shiki-token-string)">└──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">master</span></span>
<span><span style="color: var(--shiki-token-function)">├──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">scripts</span></span>
<span><span style="color: var(--shiki-token-function)">└──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">seed</span></span>
<span><span style="color: var(--shiki-color-text)">    </span><span style="color: var(--shiki-token-function)">└──</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">utils</span></span>
<span></span>

In the table below, we provide detailed explanations of the directories.

DirectoryDescription
cue.mod

Contains CUE modules, a set of rules that defines how to generate CUE files for Tailor Platform. This directory and the files in the directory are automatically provided by Tailor Platform when you run tailorctl manifest tidy command for the first time. These CUE modules are used to generate Manifest.

environmentContains the environment configuration files
services

Contains the template files, which is the blueprint of your application. Template files are written in CUE language. Specific design of the files within the services directory may vary depending on each application. More information can be found in the README of each template.

scriptsContains the script file to seed data to the application
seedContains the data files to seed the application

The difference between the Generated and the Manifest is that the workspace.cue file in Generated is the actual file used to deploy your application, while the files in Manifest serve as the blueprint for the generated workspace.cue. During the generation process, the variables that needs to be determined at the deployment time are replaced with the values that are specified in the Manifest.