Command Reference
Complete reference for the vault command-line tool. All commands accept the global options.
Platform commands
Section link for Platform commandsThese commands are available in every Vault. All accept the global options.
| Command | Description |
|---|---|
vault login | Authenticate and manage stored environments and credentials |
vault logout | Log out of a stored environment |
vault config | Pull, push, and package Vault configuration |
vault mdl | Execute an MDL statement |
vault query | Execute a VQL query |
vault api <path> | Call any Vault API endpoint and print the response |
vault version | Print the installed CLI version and platform |
vault upgrade | Upgrade the CLI to the latest version |
vault uninstall | Remove the CLI and all stored credentials |
Exit codes
Section link for Exit codesThe CLI uses specific exit codes so scripts and CI pipelines can branch on failure type.
| Code | Meaning |
|---|---|
0 | Success |
1 | General or unhandled error |
2 | Invalid usage: bad arguments or flags |
3 | Auth failure: not logged in, expired token, or invalid credentials |
4 | Target vault error: no vault specified or vault unreachable |
5 | API or validation error returned by Vault, for example a failed component deploy, invalid MDL, or VQL syntax error |
6 | Async job failure: config pull or config push reached a failed or errors-encountered terminal state |