CLI Reference
The Tailor Platform SDK provides a command-line interface for managing projects and workspaces.
Usage
tailor-sdk <command> [options]Common Options
The following options are available for most commands:
| Option | Short | Description |
|---|---|---|
--env-file | -e | Path to environment file (error if not found) |
--env-file-if-exists | Path to environment file (ignored if not found) | |
--verbose | Enable verbose logging (show stack traces on error) | |
--json | -j | Output as JSON (where applicable) |
--workspace-id | -w | Workspace ID (for deployment commands) |
--profile | -p | Workspace profile |
--config | -c | Path to SDK config file |
--yes | -y | Skip 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-filefiles are loaded first, then--env-file-if-existsfiles
# 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.productionEnvironment Variables
You can use environment variables to configure workspace and authentication:
| Variable | Description |
|---|---|
TAILOR_PLATFORM_WORKSPACE_ID | Workspace ID for deployment commands |
TAILOR_PLATFORM_TOKEN | Authentication token (alternative to login) |
TAILOR_TOKEN | Deprecated. Use TAILOR_PLATFORM_TOKEN instead |
TAILOR_PLATFORM_PROFILE | Workspace profile name |
TAILOR_PLATFORM_SDK_CONFIG_PATH | Path to SDK config file |
EDITOR | Editor to open generated files (e.g., vim, code, nano) |
Authentication Token Priority
Token resolution follows this priority order:
TAILOR_PLATFORM_TOKENenvironment variableTAILOR_TOKENenvironment variable (deprecated)- Profile specified via
--profileoption orTAILOR_PLATFORM_PROFILE - Current user from platform config (
~/.config/tailor-platform/config.yaml)
Workspace ID Priority
Workspace ID resolution follows this priority order:
--workspace-idcommand optionTAILOR_PLATFORM_WORKSPACE_IDenvironment variable- Profile specified via
--profileoption orTAILOR_PLATFORM_PROFILE
Commands
Application Commands
Commands for managing Tailor Platform applications (work with tailor.config.ts).
| Command | Description |
|---|---|
| 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 |
TailorDB Commands
Commands for managing TailorDB tables, data, and schema migrations.
| Command | Description |
|---|---|
| tailordb truncate | Truncate TailorDB tables |
| tailordb migration generate | Generate migration files from schema snapshot |
| tailordb migration set | Set migration checkpoint manually |
| tailordb migration status | Show migration status |
| tailordb erd export | Export ERD artifacts from TailorDB schema (beta) |
| tailordb erd serve | Serve ERD locally (beta) |
| tailordb erd deploy | Deploy ERD static website (beta) |
Note: Migration scripts are automatically executed during tailor-sdk apply. See Automatic Migration Execution for details.
User & Auth Commands
Commands for authentication and user management.
| Command | Description |
|---|---|
| login | Login to Tailor Platform |
| logout | Logout from Tailor Platform |
| user current | Show current user |
| user list | List all users |
| user switch | Set current user |
| user pat list | List personal access tokens |
| user pat create | Create a personal access token |
| user pat delete | Delete a personal access token |
| user pat update | Update a personal access token |
Workspace Commands
Commands for managing workspaces and profiles.
| Command | Description |
|---|---|
| workspace create | Create a new workspace |
| workspace list | List all workspaces |
| workspace delete | Delete a workspace |
| profile create | Create a new profile |
| profile list | List all profiles |
| profile update | Update a profile |
| profile delete | Delete a profile |
Auth Resource Commands
Commands for managing Auth service resources.
| Command | Description |
|---|---|
| machineuser list | List machine users |
| machineuser token | Get machine user access token |
| oauth2client list | List OAuth2 clients |
| oauth2client get | Get OAuth2 client credentials |
Workflow Commands
Commands for managing workflows and executions.
| Command | Description |
|---|---|
| workflow list | List all workflows |
| workflow get | Get workflow details |
| workflow start | Start a workflow execution |
| workflow executions | List or get executions |
| workflow resume | Resume a failed execution |
Function Commands
Commands for viewing function execution logs.
| Command | Description |
|---|---|
| function logs | List or get function execution logs |
Executor Commands
Commands for managing executors and executor jobs.
| Command | Description |
|---|---|
| executor trigger | Trigger an executor manually |
| executor jobs | List or get executor jobs |
Secret Commands
Commands for managing secrets and vaults.
| Command | Description |
|---|---|
| secret vault create | Create a vault |
| secret vault delete | Delete a vault |
| secret vault list | List all vaults |
| secret create | Create a secret |
| secret update | Update a secret |
| secret list | List secrets in a vault |
| secret delete | Delete a secret |
Static Website Commands
Commands for managing and deploying static websites.
| Command | Description |
|---|---|
| staticwebsite deploy | Deploy a static website from a local build directory |
| staticwebsite list | List static websites in a workspace |
| staticwebsite get | Get details of a static website |
Completion
Generate shell completion scripts for bash, zsh, and fish.
| Command | Description |
|---|---|
| completion | Generate shell completion script |