Skip to navigation

deel auth

The auth commands manage the token the CLI sends with each API request. Token resolution and storage are described in Authentication.

CommandDescription
deel auth statusValidate the current token and report its source
deel auth loginValidate a token and store it in the OS keychain
deel auth logoutRemove the stored token for the selected environment

All commands accept the global options. --env selects which environment’s token is validated, stored, or removed.

deel auth status

Validate the current token and report where it came from.

Usage
deel auth status [GLOBAL OPTIONS]

Response (data object)

FieldTypeDescription
validbooleantrue if the token was accepted
sourcestringWhere the token was read from: stdin, env, or keychain
tokenstringThe token masked to its last four characters
identityobjectIdentity fields of the token owner

Errors

CodeCause
auth.missingNo token in --token-stdin, DEEL_TOKEN, or the keychain
auth.invalidThe API rejected the token

Example

deel auth status --env demo --fields valid,source

deel auth login

Read a token, validate it against the API, and store it in the OS keychain for the selected environment. The command prompts with hidden input on an interactive terminal; otherwise it reads the token from stdin.

Usage
deel auth login [GLOBAL OPTIONS]

Response (data object)

FieldTypeDescription
storedbooleantrue when the token was written to the keychain
envstringThe environment the token was stored for
tokenstringThe token masked to its last four characters
identityobjectIdentity fields of the token owner

Errors

CodeCause
auth.keychainNo keychain backend is available, or the write failed
auth.loginNo token was provided
auth.invalidThe API rejected the token; nothing was stored

Examples

deel auth login # interactive prompt, production environment
deel auth login --env demo # store a token for the demo environment
echo "$DEEL_PAT" | deel auth login # non-interactive

deel auth logout

Remove the stored token for the selected environment from the OS keychain. Tokens supplied through DEEL_TOKEN or --token-stdin are not affected.

Usage
deel auth logout [GLOBAL OPTIONS]

Response (data object)

FieldTypeDescription
removedbooleantrue when an entry was removed
envstringThe environment whose token was removed

Example

deel auth logout --env demo