Skip to content

vault switch

Switch which vault the current session is targeting.

Switches which vault the current session is targeting. With --dns, switches non-interactively. Without --dns, auto-selects when one vault is reachable or shows an interactive picker when more than one is available.

To change which user is current, use vault user switch instead.

AccessToken users cannot switch vaults. They are tied to the vault their token was issued for. Run vault login --dns <dns> --access-token for each vault instead.

vault switch [--dns <DNS>]
OptionTypeRequiredDescription
--dns <DNS>stringOptionalVault DNS to switch to. Must be reachable by the current user's live session. Omit to auto-select (one reachable vault) or pick interactively (multiple vaults, TTY)

This command also accepts the global options.

vault switch

When more than one reachable vault is available and the shell is a TTY, the CLI shows an interactive picker listing vault names. When only one reachable vault is available, it is selected automatically. Without a TTY and more than one reachable vault, the command errors: vault switch requires an interactive terminal; use --dns <dns> to switch non-interactively.

vault switch --dns myorg-sandbox.veevavault.com