Working with Vault CLI Configuration
The Vault CLI treats Vault configuration as code. You pull configuration to your local filesystem, edit it, preview the diff, and push changes back to Vault. This workflow is the primary use case for the CLI.
Pull Configuration
Section link for Pull ConfigurationPull all components, Vault Java SDK classes, and Custom Pages from your Vault to the local workspace:
vault config pullThe first pull creates the workspace structure automatically. components/, javasdk/, custom_pages/, and .vault/ directories are created if they do not already exist.
The CLI rewrites only assets that differ from the Vault. It does not touch unchanged files. Assets that exist locally but not in the Vault are deleted from the workspace after you confirm. At the deletion prompt, answering no, pressing Ctrl+C, or otherwise escaping the prompt cancels the pull without changing the workspace.
To preview what would be pulled without writing to disk:
vault config pull --dry-runA dry run that reports any errored assets exits with code 1, even though no changes are applied. A clean dry run exits 0.
Errors for assets the CLI failed to fetch or write are collected and printed after Pull complete, grouped by asset kind, so you see the full picture of what succeeded before you read what did not.
What Gets Pulled
Section link for What Gets PulledEach component is written to components/<Type>/<name>/<name>.mdl with the following layout:
- Subcomponents stay inline. Each subcomponent, such as a
Fieldnested under anObject, appears inline in its parent component's root file, in the same relative order among the attributes and other subcomponents as in the original MDL. - XML and JSON attributes become sidecar files beside the root. The CLI extracts a component's own XML or JSON attribute into
<attribute_name>.xmlor<attribute_name>.json. It extracts a subcomponent's XML or JSON attribute into<SubType>.<sub_name>.<attribute_name>.xmlor.json. Every sidecar for a given component lives at the same level as its root file. - The root file references each sidecar with
@. For example, adescriptionattribute whose value lives in a sidecar reads asdescription(@description.xml)in the root file.
This layout keeps a component's MDL diffable in source control while surfacing structured attribute values as regular files.
On every pull, the CLI creates or updates a top-level .gitignore to include .vault/, so the workspace's CLI state and scratch files are not committed to source control.
Permissionset components are the exception. Each Permissionset is written as a single MDL statement in the component root file, with no sidecar files extracted.
Vault Java SDK classes are written to javasdk/com/veeva/vault/custom/... following standard Java package conventions.
Custom Pages are written to custom_pages/<distribution_name>/, unzipped.
Push Configuration
Section link for Push ConfigurationDeploy your local changes to a Vault:
vault config pushThe CLI compares your local workspace with the target Vault and deploys what differs. Sidecar files are re-assembled into full MDL RECREATE statements, and components are deployed in dependency order.
Push makes the Vault match your workspace. It does not check whether the Vault changed since your last pull, so changes made directly in the Vault are overwritten. Anything in the Vault that is not in your workspace is deleted. Before deleting, the CLI lists what it will delete and asks you to confirm:
2 assets will be deleted from Vault:
Picklist.old_status__c
com.veeva.vault.custom.OldTrigger
Continue?In a non-interactive shell, the push stops instead. At the prompt, pressing Ctrl+C or otherwise escaping the prompt declines the deletion and leaves the Vault unchanged. To approve deletions without a prompt, for example in CI/CD:
vault config push --yesTo preview what would change without deploying:
vault config push --dry-run--dry-run reads the Vault to compute the diff, but Vault does not validate the changes. A push can still fail for a change that appears in the dry run. A push dry run always exits 0. Deploy failures surface only when a real push is run.
Errors for assets the CLI failed to deploy are collected and printed after Push complete, grouped by asset kind, so every error is visible in one place at the end of the run.
For a step-by-step workflow that avoids overwriting or deleting configuration by accident, see Pushing Configuration Safely.
To push to a different Vault, switch Vaults first:
vault switch --dns myorg-sandbox.veevavault.com
vault config pushIgnoring Configuration
Section link for Ignoring ConfigurationUse a .vdxignore file to mark configuration as unmanaged. The CLI never pulls, diffs, pushes, or deletes matched configuration. The first pull creates a commented example at the workspace root:
# .vdxignore
components/Report/**
components/Picklist/supplier__v/The .vdxignore format follows the same rules as a .gitignore file. You can place a .vdxignore in any directory of the workspace. It applies to that directory and everything beneath it.
Exclude a whole component by matching its directory. You cannot exclude a single subcomponent or sidecar file. The CLI warns and still writes it.
Upgrading the CLI
Section link for Upgrading the CLIAfter you upgrade the CLI, the first vault config pull against an older workspace prints Workspace updated from CLI version <n> to <m>. as the first line of the summary. A --dry-run in that state prints Workspace is at CLI version <n>; run without --dry-run to update it to <m>. instead.