**Source URL:** https://limited.veevavault.dev/vault-dx/dx-reference/command-reference/switch

Switch which vault the current session is targeting.

## vault switch

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`](/vault-dx/dx-reference/command-reference/user/) 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.

### Usage

```sh
vault switch [--dns <DNS>]
```

### 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](/vault-dx/dx-reference/command-reference/global-options/).

### Examples

#### Switch interactively

```sh
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`.

#### Switch to a specific vault

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

---

**Previous:** [vault list](/vault-dx/dx-reference/command-reference/list)  
**Next:** [vault status](/vault-dx/dx-reference/command-reference/status)