vault switch
Switch which vault the current session is targeting.
vault switch
Section link for vault switchSwitches 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>]Options
Section link for Options| Option | Type | Required | Description |
|---|---|---|---|
--dns <DNS> | string | Optional | Vault 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.
Examples
Section link for ExamplesSwitch interactively
Section link for Switch interactivelyvault switchWhen 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.
Switch to a specific vault
Section link for Switch to a specific vaultvault switch --dns myorg-sandbox.veevavault.com