Skip to content

Global Options

Every vault command accepts the following options. They can be passed at any position in the command.

OptionTypeDescription
--verboseflagStream 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, --yesflagSkip confirmation prompts. For use in non-interactive or CI environments.
--api-version <VERSION>stringOverride 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, --helpflagPrint help for the current command level.
-V, --versionflagPrint the installed CLI version and platform. Same as vault version. Top-level only.

Commands that contact a Vault use the current user's active Vault.

To switch Vaults, use vault switch:

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

To 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 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.

VariableScopeEffect
VAULT_CLI_DNSper invocationTarget this DNS instead of the current user's active Vault. Required together with VAULT_CLI_SESSION_ID.
VAULT_CLI_SESSION_IDper invocationAuthenticate this invocation with this session ID. Required together with VAULT_CLI_DNS.
VAULT_CLI_USERper invocationRun 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_VERSIONper invocationOverride the Vault API version. Same effect as --api-version, which takes precedence when both are set.
VAULT_CLI_NO_UPDATE_CHECKper invocationSuppress the daily staleness check that prints A newer release is available on other commands. Set to 1.
VAULT_LOGper invocationEnable verbose output. Same effect as --verbose. Set to verbose.

Authenticate 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 pull

Commands that delete or overwrite data prompt for confirmation in interactive mode. Pass -y or --yes to skip prompts:

vault config push --yes

Commands that prompt in an interactive shell exit with code 1 in a non-interactive shell unless you pass --yes.

Every 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 --verbose

You can also read the local logs directly from ~/.vault/logs/.