The Tailor Platform CLI supports multiple authentication methods to suit different workflows, from interactive development to automated CI/CD pipelines.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.
Login
Authenticate interactively using your browser:- Starts a local OAuth2 callback server on port 8085
- Opens your default browser to the Tailor Platform login page
- Redirects back to the CLI after successful authentication
- Stores your access token and refresh token in
~/.config/tailor-platform/config.yaml - Sets you as the current user
The login process times out after 5 minutes. If your browser doesn’t open automatically, copy and paste the URL shown in the terminal.
Example Output
Logout
Revoke your current session and remove credentials:- Revokes your refresh token with the OAuth2 server
- Removes your user credentials from the config file
- Clears the current user selection
Example Output
If you’re not logged in, the logout command will inform you without raising an error.
User Management
The CLI supports multiple user accounts and allows you to switch between them.Show Current User
Display the currently active user:List All Users
View all authenticated users:Switch Users
Change the active user without logging out:The user must already be logged in. Use
tailor-sdk login to add a new user.Personal Access Tokens
Personal Access Tokens (PATs) provide programmatic access without requiring browser-based login. They’re ideal for CI/CD pipelines, scripts, and automation.List Tokens
View all your personal access tokens:Create a Token
Generate a new personal access token:Unique name for the token
Grant write permissions. Tokens are read-only by default. Short alias:
-WSave the token immediately - it will not be shown again.
Update a Token
Rotate a token by deleting and recreating it:Delete a Token
Revoke and remove a personal access token:Using Personal Access Tokens
Set theTAILOR_PLATFORM_TOKEN environment variable to authenticate:
The deprecated
TAILOR_TOKEN environment variable is still supported but will show a warning. Migrate to TAILOR_PLATFORM_TOKEN.Workspace Profiles
Profiles associate a user with a workspace ID, making it easy to switch between development, staging, and production environments.Create a Profile
Unique profile name (e.g.,
dev, staging, production)Email of an authenticated user. Short alias:
-uWorkspace ID to associate with this profile. Short alias:
-wList Profiles
View all configured profiles:Update a Profile
Change the user or workspace ID associated with a profile:Delete a Profile
Remove a profile configuration:Using Profiles
Specify a profile with the--profile flag:
Machine Users
Machine users are service accounts defined in your application’s Auth configuration. They provide scoped access tokens for server-to-server communication.List Machine Users
View machine users defined in your application:Get Machine User Token
Retrieve an access token for a machine user:Machine users must be defined in your
tailor.config.ts Auth configuration and deployed before you can retrieve tokens.Token Refresh
The CLI automatically refreshes expired access tokens using stored refresh tokens. This happens transparently when you run commands. If token refresh fails (e.g., refresh token expired):Authentication Priority
When multiple authentication methods are available, the CLI follows this priority:TAILOR_PLATFORM_TOKENenvironment variable (highest priority)TAILOR_TOKENenvironment variable (deprecated)- Profile specified via
--profileorTAILOR_PLATFORM_PROFILE - Current user from
~/.config/tailor-platform/config.yaml
Security Best Practices
- Never commit tokens to version control
- Use CI/CD secret management for
TAILOR_PLATFORM_TOKEN - Rotate personal access tokens regularly
- Use read-only tokens when write access isn’t needed
- Use profiles for local development, tokens for CI/CD
- Store
config.yamlwith restricted permissions (600)
Configuration File Structure
Credentials are stored in~/.config/tailor-platform/config.yaml:
The CLI automatically migrates legacy
~/.tailorctl/config files to the new format.Troubleshooting
Login Browser Not Opening
If the browser doesn’t open automatically:- Copy the URL from the terminal
- Paste it into your browser manually
- Complete the login flow
Port 8085 Already in Use
If port 8085 is occupied, the login will fail. Stop the conflicting process or wait for it to release the port.Profile Not Found
Ensure the profile exists:User Not Found
Ensure you’re logged in:Next Steps
- Deploy your application with Application Commands
- Manage databases with TailorDB Commands
- Create and manage workspaces (see authentication section above)