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.
| Command | Description |
|---|---|
vault login | Log in to a Vault and make it the active Vault |
vault logout | Log out a stored user and end their Vault session |
vault list | List the Vaults reachable by the current user |
vault switch | Switch which Vault the current session is targeting |
vault status | Print the current user and Vault connection status |
vault user | List and switch stored user identities |
vault config | Pull, push, and package Vault configuration |
vault mdl | Execute an MDL statement |
vault query | Execute a VQL query |
vault api | 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 its local files and settings |
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. vault status and vault switch exit 1 when no user is current |
2 | Invalid usage: bad arguments or options |
3 | Auth failure: session expired or invalid credentials |
4 | No Vault configured or Vault unreachable. vault api, vault query, vault mdl, and vault config commands exit 4 when not logged in |
5 | API or validation error returned by Vault, for example invalid MDL or a VQL syntax error |
6 | Job failure: vault config package deploy job failed or timed out |
vault config commands exit with code 1 when any individual asset fails to pull, push, or deploy. A vault config pull --dry-run that reports errored assets also exits with code 1, even though no changes are applied. A clean pull dry run exits 0. A vault config push --dry-run always exits 0. Push failures surface only when a real push is run.