Global Options
Every vault command accepts the following options. They can be passed at any position in the command.
Options
Section link for Options| Option | Type | Description |
|---|---|---|
--verbose | flag | Stream request and response diagnostics, including full headers, to stderr in real time. Adds more information to the logs written to ~/.vault/logs/vault-YYYY-MM-DD.log. Setting the environment variable VAULT_LOG=verbose has the same effect. |
-y, --yes | flag | Skip confirmation prompts. For use in non-interactive or CI environments. |
--api-version <VERSION> | string | Override the Vault API version used by the CLI for this command (for example, v24.2). Default: the version negotiated with the Vault at login. |
-h, --help | flag | Print help for the current command level. |
-V, --version | flag | Print the installed CLI version and platform. Same as vault version. Top-level only. |
Targeting a Vault
Section link for Targeting a VaultCommands that contact a Vault use the current user's active Vault.
To switch Vaults, use vault switch:
vault switch --dns myorg-sandbox.veevavault.comTo switch users, use vault user switch.
For scripted one-off calls without changing the active Vault, set VAULT_CLI_DNS and VAULT_CLI_SESSION_ID as environment variables instead.
Environment Variables
Section link for Environment VariablesEnvironment variables let you configure per-invocation behavior without passing flags on every command, which is useful in scripted or CI environments. Every variable below is optional. An empty or unset value is treated as if the variable were not set.
| Variable | Scope | Effect |
|---|---|---|
VAULT_CLI_DNS | per invocation | Target this DNS instead of the current user's active Vault. Required together with VAULT_CLI_SESSION_ID. |
VAULT_CLI_SESSION_ID | per invocation | Authenticate this invocation with this session ID. Required together with VAULT_CLI_DNS. |
VAULT_CLI_USER | per invocation | Run the command as this stored user, on that user's current Vault, without the confirmation gate. Has no effect on commands that are not gated. Ignored when VAULT_CLI_DNS and VAULT_CLI_SESSION_ID are both set. See Authentication. |
VAULT_CLI_API_VERSION | per invocation | Override the Vault API version. Same effect as --api-version, which takes precedence when both are set. |
VAULT_CLI_NO_UPDATE_CHECK | per invocation | Suppress the daily staleness check that prints A newer release is available on other commands. Set to 1. |
VAULT_LOG | per invocation | Enable verbose output. Same effect as --verbose. Set to verbose. |
Headless Authentication
Section link for Headless AuthenticationAuthenticate with vault login first, piping the access token via stdin. All subsequent commands use the stored session.
echo "$VAULT_TOKEN" | vault login --dns myorg.veevavault.com --access-token
vault config pullConfirmation & -y/--yes
Section link for Confirmation & -y/--yesCommands that delete or overwrite data prompt for confirmation in interactive mode. Pass -y or --yes to skip prompts:
vault config push --yesCommands that prompt in an interactive shell exit with code 1 in a non-interactive shell unless you pass --yes.
Verbose Output & Local Logging
Section link for Verbose Output & Local LoggingEvery CLI invocation writes a structured log to ~/.vault/logs/vault-YYYY-MM-DD.log. The log includes the command, each Vault API request with its status and timing, and the exit code. Authorization headers are always masked. When a command fails, the CLI prints the path of the log file to stderr.
Pass --verbose to stream full request and response diagnostics to stderr in real time:
vault config pull --verboseYou can also read the local logs directly from ~/.vault/logs/.