vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
  • bugs
  • build
  • cache
  • config
  • create
  • docs
  • exec-cache
  • exec-local
  • exec
  • help
  • init
  • install
  • list
  • login
  • logout
  • pack
  • ping
  • pkg
  • publish
  • query
  • registry
  • repo
  • run-exec
  • run
  • setup
  • token
  • uninstall
  • version
  • whoami
  • Examples
  • Options
  • view
  • expect-results
  1. Client
  2. /
  3. Commands
  4. /
  5. query

vlt query

Usage:

Terminal
$ vlt query
$ vlt query <query> --view=[human | json | mermaid | svg | png | count]

List installed dependencies matching the provided query.

The graph being queried is the one built by vlt install. In a project installed by another client (an npm install or pnpm install node_modules) there is no such graph, so the command errors instead of reporting every dependency as missing. Run vlt install first. :host() queries are the exception, since they load their graph from somewhere else.

Examples

Query packages with the name "foo"

Terminal
$ vlt query '#foo'

Query all peer dependencies of workspaces

Terminal
$ vlt query '*:workspace > *:peer'

Query all direct project dependencies with a "build" script

Terminal
$ vlt query ':project > *:attr(scripts, [build])'

Query packages with names starting with "@vltpkg"

Terminal
$ vlt query '[name^="@vltpkg"]'

Find packages with uncommitted changes

Terminal
$ vlt query ':diff()'

Find packages changed since main branch

Terminal
$ vlt query ':diff(main)'

Find workspaces changed since last commit

Terminal
$ vlt query ':workspace:diff(HEAD~1)'

Check for malware in dependencies

Terminal
$ vlt query ':malware'

Find packages with critical security issues

Terminal
$ vlt query ':malware(critical), :cve(*), :eval'

Options

view

Output format. Defaults to human-readable or json if no tty. Use svg or png to render the dependency graph as an image and open it automatically.

Text
--view=[human | json | mermaid | svg | png | count]

expect-results

Set expected result count for automation and CI/CD pipelines. Exits with error code if expectation is not met.

Text
--expect-results=<comparison>

Examples:

  • --expect-results=0 - Expect no results (useful for security checks)
  • --expect-results=">0" - Expect at least one result
  • --expect-results="<5" - Expect fewer than 5 results
  • --expect-results=">=10" - Expect 10 or more results
Terminal
# Security check that fails if malware is found
$ vlt query ':malware' --expect-results=0

# Ensure at least one workspace exists

$ vlt query ':workspace' --expect-results=">0"

PreviouspublishNextregistry

On this page

  • Examples
  • Options
  • view
  • expect-results
Edit this page

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now