Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tailor-platform/sdk/llms.txt

Use this file to discover all available pages before exploring further.

The Tailor Platform SDK provides a powerful command-line interface (CLI) for managing your Tailor Platform applications, workspaces, and resources.

Installation

The CLI is distributed as part of the @tailor-platform/sdk package:
npm install @tailor-platform/sdk
The CLI is available as the tailor-sdk command.

Basic Usage

tailor-sdk <command> [options]

Getting Help

View available commands:
tailor-sdk --help
View help for a specific command:
tailor-sdk <command> --help

Version Information

Check the installed SDK version:
tailor-sdk --version

Common Options

The following options are available across most CLI commands:
--env-file
string
default:"-e"
Path to environment file (error if not found). Can be specified multiple times.
--env-file-if-exists
string
Path to environment file (ignored if not found). Can be specified multiple times.
--verbose
boolean
default:"false"
Enable verbose logging. Shows stack traces on error for debugging.
--json
boolean
default:"false"
Output results as JSON where applicable. Short alias: -j
--workspace-id
string
Workspace ID for deployment and resource commands. Short alias: -w
--profile
string
Workspace profile name. Short alias: -p
--config
string
default:"tailor.config.ts"
Path to SDK config file. Short alias: -c
--yes
boolean
default:"false"
Skip confirmation prompts. Short alias: -y

Environment File Loading

Both --env-file and --env-file-if-exists 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
# Load .env (required)
tailor-sdk apply --env-file .env
Due to a Node.js bug (#54232), you may see warnings about --env-file flags. These can be safely ignored.

Environment Variables

You can configure workspace and authentication using environment variables:
TAILOR_PLATFORM_WORKSPACE_ID
string
Workspace ID for deployment commands. Used when --workspace-id is not specified.
TAILOR_PLATFORM_TOKEN
string
Authentication token. Alternative to using tailor-sdk login. Takes precedence over logged-in user credentials.
TAILOR_TOKEN
string
Deprecated. Use TAILOR_PLATFORM_TOKEN instead. Still supported for backward compatibility.
TAILOR_PLATFORM_PROFILE
string
Workspace profile name. Used when --profile is not specified.
TAILOR_PLATFORM_SDK_CONFIG_PATH
string
Path to SDK config file. Used when --config is not specified.
EDITOR
string
Editor to open generated files. Examples: vim, code, nano

Resolution Priority

The CLI resolves configuration from multiple sources with a specific priority order:

Authentication Token Priority

The CLI determines which authentication token to use in this order:
  1. TAILOR_PLATFORM_TOKEN environment variable
  2. TAILOR_TOKEN environment variable (deprecated)
  3. Profile specified via --profile option or TAILOR_PLATFORM_PROFILE environment variable
  4. Current user from platform config (~/.config/tailor-platform/config.yaml)
# Highest priority - token from environment
export TAILOR_PLATFORM_TOKEN="your-token-here"
tailor-sdk apply

Workspace ID Priority

The CLI determines which workspace to use in this order:
  1. --workspace-id command option
  2. TAILOR_PLATFORM_WORKSPACE_ID environment variable
  3. Profile specified via --profile option or TAILOR_PLATFORM_PROFILE environment variable
# Highest priority - explicit workspace ID
tailor-sdk apply --workspace-id abc123-def456-...

Config File Priority

The CLI locates the config file in this order:
  1. --config command option
  2. TAILOR_PLATFORM_SDK_CONFIG_PATH environment variable
  3. Search parent directories for tailor.config.ts (default)
tailor-sdk apply --config ./config/custom.config.ts

Command Categories

The CLI commands are organized into several categories:

Application Management

  • init - Initialize a new project
  • generate - Generate files from configuration
  • apply - Deploy application to workspace
  • remove - Remove application from workspace
  • show - Show deployed application info

Authentication & Users

  • login - Login to Tailor Platform
  • logout - Logout from Tailor Platform
  • user - Manage users and personal access tokens

Workspace Management

  • workspace - Manage workspaces
  • profile - Manage workspace profiles

TailorDB

  • tailordb truncate - Truncate tables
  • tailordb migration - Generate and manage migrations
  • tailordb erd - Export and serve entity-relationship diagrams

Runtime Resources

  • workflow - Manage workflows and executions
  • executor - Trigger executors and view jobs
  • function - View function execution logs
  • secret - Manage secrets and vaults
  • staticwebsite - Deploy and manage static websites

Auth Resources

  • machineuser - Manage machine users and tokens
  • oauth2client - Manage OAuth2 clients

Utilities

  • completion - Generate shell completion scripts

Shell Completion

The CLI supports shell completion for bash, zsh, and fish:
# Add to ~/.bashrc
eval "$(tailor-sdk completion bash)"

Example Workflows

Development Workflow

# Initialize a new project
tailor-sdk init my-app
cd my-app

# Generate types and code
tailor-sdk generate

# Deploy to development workspace
tailor-sdk apply --profile dev

# View deployed application
tailor-sdk show --profile dev

Production Deployment

# Load production environment variables
tailor-sdk apply \
  --env-file .env.production \
  --profile production \
  --yes

CI/CD Pipeline

# Use machine tokens for automated deployments
export TAILOR_PLATFORM_TOKEN="${CI_TAILOR_TOKEN}"
export TAILOR_PLATFORM_WORKSPACE_ID="${CI_WORKSPACE_ID}"

tailor-sdk generate
tailor-sdk apply --yes

Configuration Storage

The CLI stores user credentials and profiles in:
~/.config/tailor-platform/config.yaml
This file contains:
  • User access tokens and refresh tokens
  • Profile configurations (workspace ID + user mappings)
  • Current user selection
The CLI automatically migrates from the legacy ~/.tailorctl/config file if found.

Next Steps