Skip to content

The :host() pseudo-class switches the current graph context to a new set of graphs loaded from a specific host context. This allows querying across multiple projects or switching to different project scopes.

Syntax

:host(<context>)

The context parameter can be:

  • A specific project folder path (e.g., "file:~/my-project")
  • The special local context — loads all configured projects from your vlt dashboard

Examples

Find malware across all projects

Terminal
$ vlt query ':host(local) :malware'

Query a specific project

Terminal
$ vlt query ':host("file:~/my-app") :outdated'

Bump version for a remote project

Terminal
$ vlt version patch --scope=':host("file:~/tmp/test-vite")'

Get all direct deps across local projects

Terminal
$ vlt pkg pick name version --scope=':host(local) > :root > *'

How it works

When you use :host(), vlt:

  1. Resolves the context to one or more project directories
  2. Loads the dependency graph for each project
  3. Runs the rest of the selector against all loaded graphs

This is particularly useful for organization-wide audits and cross-project dependency analysis.

See also