Skip to main content
Sessions are stored as profiles, so several accounts and environments can be used side by side. Commands run against the active profile unless --profile names another one. Every command below also takes -h, --help.

login

Log in to a Xata account Prints a URL and a code to authorize this machine, or stores an API key with --api-key for non-interactive use. The issuer, API URL and client flags log in against a deployment other than production, which is how Enterprise customers connect the CLI to a custom deployment in their own cloud. Omit them and the CLI uses the default production values.
string
default:"default"
The profile to log in to
boolean
default:"false"
Force login even if already logged in
string
Log in non-interactively with an API key instead of the browser OAuth flow
string
Issuer URL for custom environment
string
API base URL for custom environment
string
Client ID for custom environment (defaults to “cli”)
string
Client secret for custom environment
Examples:

logout

Log out of the current account
string
default:"default"
The profile to log out of
boolean
default:"false"
Do not ask for confirmation, assume yes.

status

Display active account and authentication state
string
The profile to check

switch

Switch to a different Xata account profile
string
The profile to use
string
The profile to switch to

list

List all available Xata account profiles
boolean
Output in JSON format
string
The profile to use
Aliases: xata auth ls

access-token

Print the current access token
string
default:"default"
The profile to use

refresh-token

Print the current refresh token
string
default:"default"
The profile to use