Skip to main content

Overview

The tuist auth command manages authentication with Tuist Server. It allows you to log in, log out, check your current authentication status, and refresh authentication tokens.

Usage

Subcommands

tuist auth login

Log in to Tuist Server with your email and password.

tuist auth logout

Remove the existing Tuist session and log out.

tuist auth whoami

Display the user’s email identity currently authenticated and in use.

tuist auth refresh-token

Refresh the authentication token for a particular server URL. This command is typically used internally and is not displayed in help output.

Options

For tuist auth login

string
Email to authenticate with. If not provided, you will be prompted interactively.
string
Password to authenticate with. If not provided, you will be prompted interactively.
string
The URL of the server to authenticate with. Defaults to the official Tuist Server.

For tuist auth logout

string
default:"."
The path to the directory or a subdirectory of the project.
string
Short form of --path.
string
The URL of the server to log out from.

For tuist auth whoami

string
default:"."
The path to the directory or a subdirectory of the project.
string
Short form of --path.
string
The URL of the server to check authentication status.

For tuist auth refresh-token

string
required
The URL of the server the token is being refreshed for.

Examples

Log in interactively

Prompts you to enter your email and password interactively.

Log in with credentials

Logs in with the provided email and password.

Log in to a custom server

Authenticates with a custom Tuist Server instance.

Check who is logged in

Displays the email address of the currently authenticated user.

Check authentication for a custom server

Shows the authenticated user for a specific server.

Log out

Removes the authentication session and logs you out.

Log out from a custom server

Logs out from a specific server instance.

Refresh authentication token

Refreshes the authentication token for the specified server URL.

Authentication workflow

A typical authentication workflow looks like this:
  1. Login: Authenticate with your Tuist Server credentials
  2. Verify: Check your authentication status
  3. Use Tuist features: Access remote caching, analytics, and other server features
  4. Logout: Remove your session when needed

Environment variables

The tuist auth commands support environment variables for some options:
  • TUIST_LOGOUT_PATH: Sets the path for tuist auth logout
  • TUIST_WHOAMI_PATH: Sets the path for tuist auth whoami
  • TUIST_AUTH_REFRESH_TOKEN_SERVER_URL: Sets the server URL for tuist auth refresh-token

Security considerations

Credential storage

Authentication tokens are stored securely on your local machine.

Password input

When possible, use interactive login to avoid passing passwords as command-line arguments, which may be visible in shell history.

Token refresh

Tokens are automatically refreshed as needed to maintain your session.

Multiple servers

You can authenticate with multiple server instances using the --url option.

Use cases

CI/CD authentication

For continuous integration, you can use environment variables or command-line options:
Consider using secure credential storage in your CI/CD platform rather than hardcoding credentials in scripts.

Team collaboration

Authenticate to access shared remote cache and analytics:
Once authenticated, your team can benefit from shared cached binaries.

Self-hosted Tuist Server

If you’re running a self-hosted Tuist Server:

Troubleshooting

Authentication fails

If login fails, verify:
  • Your email and password are correct
  • The server URL is accessible
  • You have a stable internet connection

Token expired

If you receive authentication errors, try refreshing your token:
Or log out and log back in:

Multiple server instances

If working with multiple server instances, always specify the --url option to target the correct server: