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
localcontext — loads all configured projects from your vlt dashboard
Examples
Find malware across all projects
$ vlt query ':host(local) :malware'Query a specific project
$ vlt query ':host("file:~/my-app") :outdated'Bump version for a remote project
$ vlt version patch --scope=':host("file:~/tmp/test-vite")'Get all direct deps across local projects
$ vlt pkg pick name version --scope=':host(local) > :root > *'How it works
When you use :host(), vlt:
- Resolves the context to one or more project directories
- Loads the dependency graph for each project
- 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
:diff()— find changed packages:outdated()— find packages with newer versions