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>... [--format <FORMAT>] [--page <N>] [--all]
OptionTypeRequiredDescription
<QUERY>stringRequiredThe VQL query to execute. Enclose it in quotes, or pass it as several words
--format <FORMAT>table | json | csvOptionalOutput format. Default: table
--page <N>integerOptionalFetch a specific page of results (1000 rows per page), numbered from 1. Default: 1. 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"
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

By default, vault query returns only the first page of results: up to 1000 rows. To get more, use one of two mutually exclusive options:

  • --page <N>: Fetch a specific page, numbered from 1.
  • --all: Fetch every page.

If your query already contains PAGESIZE, PAGEOFFSET, LIMIT, or OFFSET, the CLI sends it to Vault unchanged and does not add its own paging.

When a query returns no rows, table output prints (no rows), json prints [], and csv prints nothing.

For VQL syntax, see the VQL reference.