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

JSON Output

For commands that return structured results, passing --json writes one parseable JSON document to stdout on success. Empty successful result sets are emitted as JSON values such as [], not as human-readable text or empty stdout.

Commands that only perform side effects and do not define a structured result may leave stdout empty even when --json is passed.

Errors, warnings, progress, and diagnostic messages are written to stderr. On failure, check the non-zero exit code and read stderr; stdout is not guaranteed to contain a JSON error object.

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 deploy --env-file .env --env-file-if-exists .env.local

# Load multiple files
tailor-sdk deploy --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_SDK_DTS_PATHOutput path for generated tailor.d.ts type definition 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, machineuser token
TAILOR_PLATFORM_URLPlatform API base URL. Saved into profiles created with profile create --platform-url
TAILOR_PLATFORM_OAUTH2_CLIENT_IDOAuth2 client ID for user login. Saved into profiles created with profile create --oauth2-client-id
TAILOR_PLATFORM_CONSOLE_URLConsole base URL. Saved into profiles created with profile create --console-url
TAILOR_BUNDLE_CONCURRENCYMax concurrent bundle workers for deploy (resolvers/executors/workflows). Defaults to CPU count
TAILOR_APPLY_CONCURRENCYMax concurrent unary platform RPCs during apply/deploy (streaming uploads are not gated). Defaults to 16
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)

Config-backed login tokens are scoped to the Platform API URL. Profiles with --platform-url use the token saved for that URL, so switching profiles can also switch between Platform API environments.

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.
deployDeploy your application by applying the Tailor configuration.
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.
api inspectPrint the input message tree of an OperatorService endpoint.
api listList all invocable OperatorService methods.

TailorDB Commands

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

CommandDescription
tailordbManage TailorDB tables and data.
tailordb truncateTruncate (delete all records from) TailorDB tables.
tailordb migrationManage TailorDB schema migrations.
tailordb migration generateGenerate migration files by detecting schema differences between current local types and the previous migration snapshot.
tailordb migration scriptAdd a migration script (migrate.ts) template to an existing migration directory.
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 migration syncSync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift).
tailordb erdGenerate TailorDB ERD viewer artifacts from local TailorDB schema. (beta)
tailordb erd exportExport TailorDB ERD static viewer from local TailorDB schema.
tailordb erd diffRender TailorDB ERD schema diff HTML from exported ERD viewers.
tailordb erd serveGenerate and serve TailorDB ERD locally with watch reload. (beta)
tailordb erd deployDeploy ERD static website for TailorDB namespace(s).

Query Commands

Run ad-hoc SQL/GraphQL queries or enter the interactive REPL.

CommandDescription
queryRun SQL/GraphQL query.

User & Auth Commands

Commands for authentication and user management.

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

Organization Commands

Commands for managing organizations and folders.

CommandDescription
organizationManage Tailor Platform organizations.
organization folderManage organization folders.
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
workspaceManage Tailor Platform workspaces.
workspace appManage workspace applications
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 userManage workspace users
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
profileManage workspace profiles (user + workspace combinations).
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
authconnectionManage auth connections.
authconnection authorizeAuthorize an auth connection via OAuth2 flow.
authconnection deleteDelete an auth connection entirely.
authconnection listList all auth connections.
authconnection openOpen the auth connections page in the Tailor Platform Console.
authconnection revokeRevoke an auth connection's tokens (keeps the connection; use 'delete' to remove it).
machineuserManage machine users in your Tailor Platform application.
machineuser listList all machine users in the application.
machineuser tokenGet an access token for a machine user.
oauth2clientManage OAuth2 clients in your Tailor Platform application.
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
workflowManage workflows and workflow executions.
workflow listList all workflows in the workspace.
workflow getGet workflow details.
workflow startStart a workflow execution.
workflow waitWait for a workflow execution.
workflow executionsList or get workflow executions.
workflow resumeResume a failed or pending workflow execution.

Function Commands

Commands for managing function registries and viewing function execution logs.

CommandDescription
functionManage functions
function getGet a function registry by name
function listList function registries in a workspace
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
executorManage executors
executor listList all executors
executor getGet executor details
executor jobsList or get executor jobs.
executor triggerTrigger an executor manually.
executor webhookManage executor webhooks
executor webhook listList executors with incoming webhook triggers

Secret Commands

Commands for managing secrets and vaults.

CommandDescription
secretManage Secret Manager vaults and secrets.
secret createCreate a secret in a vault.
secret deleteDelete a secret in a vault.
secret listList all secrets in a vault.
secret updateUpdate a secret in a vault.
secret vaultManage Secret Manager vaults.
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.

Static Website Commands

Commands for managing and deploying static websites.

CommandDescription
staticwebsiteManage static websites in your workspace.
staticwebsite deployDeploy a static website from a local build directory.
staticwebsite listList all static websites in a workspace.
staticwebsite domainManage custom domains for static websites.
staticwebsite domain getGet details of a custom domain.
staticwebsite domain listList custom domains for a static website.
staticwebsite getGet details of a specific static website.

Crash Report Commands

Commands for managing crash reports.

CommandDescription
crashreportManage crash reports.
crashreport listList local crash report files.
crashreport sendSubmit a crash report to help improve the SDK.

Setup Commands

Commands for setting up project infrastructure.

CommandDescription
setupGenerate a CI deploy workflow for your project. (beta)
setup checkAudit generated workflows for drift against the current config/repo (read-only).

Upgrade Commands

Commands for upgrading SDK versions with automated code migration.

CommandDescription
upgradeRun codemods to upgrade your project to a newer SDK version.

Skills Commands

Commands for installing Tailor SDK agent skills.

CommandDescription
skillsManage Tailor SDK agent skills.
skills installInstall the tailor-sdk agent skill from the installed SDK package.

Completion

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

CommandDescription
completionGenerate shell completion script