Skip to content

tailor-sdk

Tailor Platform SDK - The SDK to work with Tailor Platform

Usage

bash
tailor-sdk <command> [options]

Global Options

OptionAliasDescriptionRequiredDefault
--env-file <ENV_FILE>-ePath to the environment file (error if not found)No-
--env-file-if-exists <ENV_FILE_IF_EXISTS>-Path to the environment file (ignored if not found)No-
--verbose-Enable verbose loggingNofalse
--json-jOutput as JSONNofalse

Common Options

The following options are available for most commands:

OptionShortDescription
--workspace-id-wWorkspace ID (for deployment commands)
--profile-pWorkspace profile
--config-cPath to SDK config file
--yes-ySkip confirmation prompts

Environment File Loading

Both --env-file and --env-file-if-exists can be specified multiple times and follow Node.js --env-file behavior:

  • Variables already set in the environment are not overwritten
  • Later files override earlier files
  • --env-file files are loaded first, then --env-file-if-exists files
bash
# Load .env (required) and .env.local (optional, if exists)
tailor-sdk apply --env-file .env --env-file-if-exists .env.local

# Load multiple files
tailor-sdk apply --env-file .env --env-file .env.production

Environment Variables

You can use environment variables to configure workspace and authentication:

VariableDescription
TAILOR_PLATFORM_WORKSPACE_IDWorkspace ID for deployment commands
TAILOR_PLATFORM_ORGANIZATION_IDOrganization ID for organization commands
TAILOR_PLATFORM_FOLDER_IDFolder ID for folder commands
TAILOR_PLATFORM_TOKENAuthentication token (alternative to login)
TAILOR_TOKENDeprecated. Use TAILOR_PLATFORM_TOKEN instead
TAILOR_PLATFORM_PROFILEWorkspace profile name
TAILOR_PLATFORM_SDK_CONFIG_PATHPath to SDK config file
TAILOR_PLATFORM_MACHINE_USER_CLIENT_IDClient ID for login --machine-user
TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRETClient secret for login --machine-user
TAILOR_PLATFORM_MACHINE_USER_NAMEDefault machine user name for query, workflow start, function test-run
VISUAL / EDITORPreferred editor for commands that open files (e.g., vim, code, nano)
TAILOR_CRASH_REPORTS_LOCALLocal crash log writing: on (default) or off
TAILOR_CRASH_REPORTS_REMOTEAutomatic crash report submission: off (default) or on

Authentication Token Priority

Token resolution follows this priority order:

  1. TAILOR_PLATFORM_TOKEN environment variable
  2. TAILOR_TOKEN environment variable (deprecated)
  3. Profile specified via --profile option or TAILOR_PLATFORM_PROFILE
  4. Current user from platform config (~/.config/tailor-platform/config.yaml)

Workspace ID Priority

Workspace ID resolution follows this priority order:

  1. --workspace-id command option
  2. TAILOR_PLATFORM_WORKSPACE_ID environment variable
  3. Profile specified via --profile option or TAILOR_PLATFORM_PROFILE

Commands

Application Commands

Commands for managing Tailor Platform applications (work with tailor.config.ts).

CommandDescription
initInitialize a new project using create-sdk.
generateGenerate files using Tailor configuration.
applyApply Tailor configuration to deploy your application.
removeRemove all resources managed by the application from the workspace.
showShow information about the deployed application.
openOpen Tailor Platform Console.
apiCall Tailor Platform API endpoints directly.

TailorDB Commands

Commands for managing TailorDB tables, data, and schema migrations.

CommandDescription
tailordb truncateTruncate (delete all records from) TailorDB tables.
tailordb migration generateGenerate migration files by detecting schema differences between current local types and the previous migration snapshot.
tailordb migration setSet migration checkpoint to a specific number.
tailordb migration statusShow the current migration status for TailorDB namespaces, including applied and pending migrations.
tailordb erd exportExport Liam ERD dist from applied TailorDB schema.
tailordb erd serveGenerate and serve ERD locally (liam build + serve dist). (beta)
tailordb erd deployDeploy ERD static website for TailorDB namespace(s).

User & Auth Commands

Commands for authentication and user management.

CommandDescription
loginLogin to Tailor Platform.
logoutLogout from Tailor Platform.
user currentShow current user.
user listList all users.
user switchSet current user.
user pat listList all personal access tokens.
user pat createCreate a new personal access token.
user pat deleteDelete a personal access token.
user pat updateUpdate a personal access token (delete and recreate).

Organization Commands

Commands for managing organizations and folders.

CommandDescription
organization folder createCreate a new folder in an organization.
organization folder deleteDelete a folder from an organization.
organization folder getShow detailed information about a folder.
organization folder listList folders in an organization.
organization folder updateUpdate a folder's name.
organization getShow detailed information about an organization.
organization listList organizations you belong to.
organization treeDisplay organization folder hierarchy as a tree.
organization updateUpdate an organization's name.

Workspace Commands

Commands for managing workspaces and profiles.

CommandDescription
workspace app healthCheck application schema health
workspace app listList applications in a workspace
workspace createCreate a new Tailor Platform workspace.
workspace deleteDelete a Tailor Platform workspace.
workspace getShow detailed information about a workspace
workspace listList all Tailor Platform workspaces.
workspace restoreRestore a deleted workspace
workspace user inviteInvite a user to a workspace
workspace user listList users in a workspace
workspace user removeRemove a user from a workspace
workspace user updateUpdate a user's role in a workspace
profile createCreate a new profile.
profile deleteDelete a profile.
profile listList all profiles.
profile updateUpdate profile properties.

Auth Resource Commands

Commands for managing Auth service resources.

CommandDescription
authconnection authorizeAuthorize an auth connection via OAuth2 flow.
authconnection listList all auth connections.
authconnection revokeRevoke an auth connection.
machineuser listList all machine users in the application.
machineuser tokenGet an access token for a machine user.
oauth2client listList all OAuth2 clients in the application.
oauth2client getGet OAuth2 client credentials (including client secret).

Workflow Commands

Commands for managing workflows and executions.

CommandDescription
workflow listList all workflows in the workspace.
workflow getGet workflow details.
workflow startStart a workflow execution.
workflow executionsList or get workflow executions.
workflow resumeResume a failed or pending workflow execution.

Function Commands

Commands for viewing function execution logs.

CommandDescription
function logsList or get function execution logs.
function test-runRun a function on the Tailor Platform server without deploying.

Executor Commands

Commands for managing executors and executor jobs.

CommandDescription
executor triggerTrigger an executor manually.
executor jobsList or get executor jobs.
executor listList all executors
executor getGet executor details
executor webhook listList executors with incoming webhook triggers

Secret Commands

Commands for managing secrets and vaults.

CommandDescription
secret vault createCreate a new Secret Manager vault.
secret vault deleteDelete a Secret Manager vault.
secret vault listList all Secret Manager vaults in the workspace.
secret createCreate a secret in a vault.
secret updateUpdate a secret in a vault.
secret listList all secrets in a vault.
secret deleteDelete a secret in a vault.

Static Website Commands

Commands for managing and deploying static websites.

CommandDescription
staticwebsite deployDeploy a static website from a local build directory.
staticwebsite listList all static websites in a workspace.
staticwebsite getGet details of a specific static website.

Crash Report Commands

Commands for managing crash reports.

CommandDescription
crash-report listList local crash report files.
crash-report sendSubmit a crash report to help improve the SDK.

Setup Commands

Commands for setting up project infrastructure.

CommandDescription
setup githubGenerate GitHub Actions workflow for deployment. (beta)

Completion

Generate shell completion scripts for bash, zsh, and fish.

CommandDescription
completionGenerate shell completion script