Skip to content

Command Reference

Complete reference for the vault command-line tool. All commands accept the global options.

These commands are available in every Vault. All accept the global options.

CommandDescription
vault loginAuthenticate and manage stored environments and credentials
vault logoutLog out of a stored environment
vault configPull, push, and package Vault configuration
vault mdlExecute an MDL statement
vault queryExecute a VQL query
vault api <path>Call any Vault API endpoint and print the response
vault versionPrint the installed CLI version and platform
vault upgradeUpgrade the CLI to the latest version
vault uninstallRemove the CLI and all stored credentials

The CLI uses specific exit codes so scripts and CI pipelines can branch on failure type.

CodeMeaning
0Success
1General or unhandled error
2Invalid usage: bad arguments or flags
3Auth failure: not logged in, expired token, or invalid credentials
4Target vault error: no vault specified or vault unreachable
5API or validation error returned by Vault, for example a failed component deploy, invalid MDL, or VQL syntax error
6Async job failure: config pull or config push reached a failed or errors-encountered terminal state