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]Options
Section link for Options| Option | Type | Required | Description |
|---|---|---|---|
<QUERY> | string | Required | The VQL query to execute |
--dns <DNS> | string | Optional | Vault DNS to run against (default: the active vault) |
--format <FORMAT> | table | json | csv | Optional | Output format. Default: table |
--page <N> | integer | Optional | Fetch a specific 1-indexed page of results (1000 rows per page). Mutually exclusive with --all |
--all | flag | Optional | Fetch and concatenate all pages of results. Mutually exclusive with --page |
This command also accepts the global options.
Examples
Section link for ExamplesBasic query
Section link for Basic queryvault query "SELECT id__v, name__v FROM documents__v LIMIT 10"JSON output
Section link for JSON outputvault query "SELECT id__v, name__v FROM documents__v" --format jsonCSV output (for piping or import)
Section link for CSV output (for piping or import)vault query "SELECT id__v, name__v, status__v FROM documents__v" --format csv > documents.csvFetch all pages
Section link for Fetch all pagesvault query "SELECT id__v FROM documents__v" --allFetch a specific page
Section link for Fetch a specific pagevault query "SELECT id__v FROM documents__v" --page 2Pagination
Section link for PaginationThe 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