tailor-sdk
Tailor Platform SDK - The SDK to work with Tailor Platform
Usage
tailor-sdk <command> [options]Global Options
| Option | Alias | Description | Required | Default |
|---|---|---|---|---|
--env-file <ENV_FILE> | -e | Path 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 logging | No | false |
--json | -j | Output as JSON | No | false |
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. After argument parsing, a command failure under --json emits a JSON error envelope to stderr. CLI errors include a stable error.code and may include structured error.next and error.context fields for automated recovery. Diagnostic lines may precede the error envelope, and stdout is not guaranteed to contain an error object.
Common Options
The following options are available for most commands:
| Option | Short | Description |
|---|---|---|
--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 deploy --env-file .env --env-file-if-exists .env.local
# Load multiple files
tailor-sdk deploy --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_ORGANIZATION_ID | Organization ID for organization commands |
TAILOR_PLATFORM_FOLDER_ID | Folder ID for folder 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 |
TAILOR_PLATFORM_SDK_DTS_PATH | Output path for generated tailor.d.ts type definition file |
TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID | Client ID for login --machine-user |
TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET | Client secret for login --machine-user |
TAILOR_PLATFORM_MACHINE_USER_NAME | Default machine user name for query, workflow start, function test-run, machineuser token |
TAILOR_PLATFORM_URL | Platform API base URL. Saved into profiles created with profile create --platform-url |
TAILOR_PLATFORM_OAUTH2_CLIENT_ID | OAuth2 client ID for user login. Saved into profiles created with profile create --oauth2-client-id |
TAILOR_PLATFORM_CONSOLE_URL | Console base URL. Saved into profiles created with profile create --console-url |
TAILOR_BUNDLE_CONCURRENCY | Max concurrent bundle workers for deploy (resolvers/executors/workflows). Defaults to CPU count |
TAILOR_APPLY_CONCURRENCY | Max concurrent platform RPCs during apply/deploy. Defaults to 16 |
VISUAL / EDITOR | Preferred editor for commands that open files (e.g., vim, code, nano) |
TAILOR_CRASH_REPORTS_LOCAL | Local crash log writing: on (default) or off |
TAILOR_CRASH_REPORTS_REMOTE | Automatic crash report submission: off (default) or on |
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)
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:
--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 using create-sdk. |
| generate | Generate files using Tailor configuration. |
| deploy | Deploy your application by applying the Tailor configuration. |
| remove | Remove all resources managed by the application from the workspace. |
| show | Show information about the deployed application. |
| open | Open Tailor Platform Console. |
| api | Call Tailor Platform API endpoints directly. |
| api inspect | Print the input message tree of an OperatorService endpoint. |
| api list | List all invocable OperatorService methods. |
TailorDB Commands
Commands for managing TailorDB tables, data, and schema migrations.
| Command | Description |
|---|---|
| tailordb | Manage TailorDB tables and data. |
| tailordb truncate | Truncate (delete all records from) TailorDB tables. |
| tailordb migration | Manage TailorDB schema migrations. |
| tailordb migration generate | Generate migration files by detecting schema differences between current local types and the previous migration snapshot. |
| tailordb migration script | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
| tailordb migration set | Set migration checkpoint to a specific number. |
| tailordb migration status | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
| tailordb migration sync | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
| tailordb erd | Generate TailorDB ERD viewer artifacts from local TailorDB schema. (beta) |
| tailordb erd export | Export TailorDB ERD static viewer from local TailorDB schema. |
| tailordb erd diff | Render TailorDB ERD schema diff HTML from exported ERD viewers. |
| tailordb erd serve | Generate and serve TailorDB ERD locally with watch reload. (beta) |
| tailordb erd deploy | Deploy ERD static website for TailorDB namespace(s). |
Query Commands
Run ad-hoc SQL/GraphQL queries or enter the interactive REPL.
| Command | Description |
|---|---|
| query | Run SQL/GraphQL query. |
User & Auth Commands
Commands for authentication and user management.
| Command | Description |
|---|---|
| login | Login to Tailor Platform. |
| logout | Logout from Tailor Platform. |
| user | Manage Tailor Platform users. |
| user current | Show current user. |
| user list | List all users. |
| user pat | Manage personal access tokens. |
| user pat create | Create a new personal access token. |
| user pat delete | Delete a personal access token. |
| user pat list | List all personal access tokens. |
| user pat update | Update a personal access token (delete and recreate). |
| user switch | Set current user. |
Organization Commands
Commands for managing organizations and folders.
| Command | Description |
|---|---|
| organization | Manage Tailor Platform organizations. |
| organization folder | Manage organization folders. |
| organization folder create | Create a new folder in an organization. |
| organization folder delete | Delete a folder from an organization. |
| organization folder get | Show detailed information about a folder. |
| organization folder list | List folders in an organization. |
| organization folder update | Update a folder's name. |
| organization get | Show detailed information about an organization. |
| organization list | List organizations you belong to. |
| organization tree | Display organization folder hierarchy as a tree. |
| organization update | Update an organization's name. |
Workspace Commands
Commands for managing workspaces and profiles.
| Command | Description |
|---|---|
| workspace | Manage Tailor Platform workspaces. |
| workspace app | Manage workspace applications |
| workspace app health | Check application schema health |
| workspace app list | List applications in a workspace |
| workspace create | Create a new Tailor Platform workspace. |
| workspace delete | Delete a Tailor Platform workspace. |
| workspace get | Show detailed information about a workspace |
| workspace list | List all Tailor Platform workspaces. |
| workspace restore | Restore a deleted workspace |
| workspace user | Manage workspace users |
| workspace user invite | Invite a user to a workspace |
| workspace user list | List users in a workspace |
| workspace user remove | Remove a user from a workspace |
| workspace user update | Update a user's role in a workspace |
| profile | Manage workspace profiles (user + workspace combinations). |
| profile create | Create a new profile. |
| profile delete | Delete a profile. |
| profile list | List all profiles. |
| profile update | Update profile properties. |
Auth Resource Commands
Commands for managing Auth service resources.
| Command | Description |
|---|---|
| authconnection | Manage auth connections. |
| authconnection authorize | Authorize an auth connection via OAuth2 flow. |
| authconnection delete | Delete an auth connection entirely. |
| authconnection list | List all auth connections. |
| authconnection open | Open the auth connections page in the Tailor Platform Console. |
| authconnection revoke | Revoke an auth connection's tokens (keeps the connection; use 'delete' to remove it). |
| machineuser | Manage machine users in your Tailor Platform application. |
| machineuser list | List all machine users in the application. |
| machineuser token | Get an access token for a machine user. |
| oauth2client | Manage OAuth2 clients in your Tailor Platform application. |
| oauth2client list | List all OAuth2 clients in the application. |
| oauth2client get | Get OAuth2 client credentials (including client secret). |
Workflow Commands
Commands for managing workflows and executions.
| Command | Description |
|---|---|
| workflow | Manage workflows and workflow executions. |
| workflow list | List all workflows in the workspace. |
| workflow get | Get workflow details. |
| workflow start | Start a workflow execution. |
| workflow wait | Wait for a workflow execution. |
| workflow executions | List or get workflow executions. |
| workflow resume | Resume a failed or pending workflow execution. |
Function Commands
Commands for managing function registries and viewing function execution logs.
| Command | Description |
|---|---|
| function | Manage functions |
| function get | Get a function registry by name |
| function list | List function registries in a workspace |
| function logs | List or get function execution logs. |
| function test-run | Run a function on the Tailor Platform server without deploying. |
Executor Commands
Commands for managing executors and executor jobs.
| Command | Description |
|---|---|
| executor | Manage executors |
| executor list | List all executors |
| executor get | Get executor details |
| executor jobs | List or get executor jobs. |
| executor trigger | Trigger an executor manually. |
| executor webhook | Manage executor webhooks |
| executor webhook list | List executors with incoming webhook triggers |
Secret Commands
Commands for managing secrets and vaults.
| Command | Description |
|---|---|
| secret | Manage Secret Manager vaults and secrets. |
| secret create | Create a secret in a vault. |
| secret delete | Delete a secret in a vault. |
| secret list | List all secrets in a vault. |
| secret update | Update a secret in a vault. |
| secret vault | Manage Secret Manager vaults. |
| secret vault create | Create a new Secret Manager vault. |
| secret vault delete | Delete a Secret Manager vault. |
| secret vault list | List all Secret Manager vaults in the workspace. |
Static Website Commands
Commands for managing and deploying static websites.
| Command | Description |
|---|---|
| staticwebsite | Manage static websites in your workspace. |
| staticwebsite deploy | Deploy a static website from a local build directory. |
| staticwebsite list | List all static websites in a workspace. |
| staticwebsite domain | Manage custom domains for static websites. |
| staticwebsite domain get | Get details of a custom domain. |
| staticwebsite domain list | List custom domains for a static website. |
| staticwebsite get | Get details of a specific static website. |
Crash Report Commands
Commands for managing crash reports.
| Command | Description |
|---|---|
| crashreport | Manage crash reports. |
| crashreport list | List local crash report files. |
| crashreport send | Submit a crash report to help improve the SDK. |
Setup Commands
Commands for setting up project infrastructure.
| Command | Description |
|---|---|
| setup | Generate CI deploy workflows for your project. (beta) |
| setup action | Generate a per-app composite action for use with setup coordinate (monorepo multi-app deploys). |
| setup branch | Generate a branch-target deploy workflow (push to branch triggers deploy). |
| setup check | Audit generated workflows for drift against the current config/repo (read-only). |
| setup coordinate | Generate a coordinator workflow that orchestrates multiple --action-generated composite actions. |
| setup delete | Delete managed workflow/action file(s) and their .github/tailor-sdk.lock entries. |
| setup preview | Generate a preview workflow (PR open/sync triggers deploy to a per-PR workspace). |
| setup tag | Generate a tag-target deploy workflow (tag push triggers deploy). |
Upgrade Commands
Commands for upgrading SDK versions with automated code migration.
| Command | Description |
|---|---|
| upgrade | Run codemods to upgrade your project to a newer SDK version. |
Skills Commands
Commands for installing Tailor SDK agent skills.
| Command | Description |
|---|---|
| skills | Manage Tailor SDK agent skills. |
| skills install | Install the tailor-sdk agent skill from the installed SDK package. |
Completion
Generate shell completion scripts for bash, zsh, and fish.
| Command | Description |
|---|---|
| completion | Generate shell completion script |