Skip to content

vault query

Execute a VQL query against the connected Vault and display results as a table, JSON, or CSV.

vault query <QUERY> [--dns <DNS>] [--format <FORMAT>] [--page <N>] [--all]
OptionTypeRequiredDescription
<QUERY>stringRequiredThe VQL query to execute
--dns <DNS>stringOptionalVault DNS to run against (default: the active vault)
--format <FORMAT>table | json | csvOptionalOutput format. Default: table
--page <N>integerOptionalFetch a specific 1-indexed page of results (1000 rows per page). Mutually exclusive with --all
--allflagOptionalFetch and concatenate all pages of results. Mutually exclusive with --page

This command also accepts the global options.

vault query "SELECT id__v, name__v FROM documents__v LIMIT 10"
vault query "SELECT id__v, name__v FROM documents__v" --format json
vault query "SELECT id__v, name__v, status__v FROM documents__v" --format csv > documents.csv
vault query "SELECT id__v FROM documents__v" --all
vault query "SELECT id__v FROM documents__v" --page 2

The CLI supports two pagination modes:

  • --page <N>: Fetch a specific 1-indexed page.
  • --all: Fetch every page and concatenate results.

These are mutually exclusive. There is no cross-invocation cursor. Each call independently computes its page using PAGEOFFSET.

For VQL syntax, see the VQL reference.