Usage:
$ vlt docs [<spec>] [--target=<query>]
Open documentation for a package in a web browser.
How It Works
The vlt docs
command locates and opens the documentation for any
package in your dependency graph. It follows the following resolution
strategy to find the best documentation URL:
- Homepage field – Checks the package’s
home
property in itspackage.json
- Repository Resolution – Checks the package’s
repository
field in itspackage.json
. For known git hosts (GitHub, GitLab, Bitbucket, etc.), generates the canonical documentation URL - Fallback – If no repository is found or the git host is unknown, falls back to the npm package page
This means you always get taken to the most relevant documentation.
Basic Usage
Open docs for current project
When run without arguments, vlt docs
reads your local package.json
and opens the documentation for your current project:
$ vlt docs
This is particularly useful when working on a project and you want to quickly view your own documentation or verify your repository URL is correctly configured.
Open docs for any package
Provide a package spec to open documentation for any package, whether it’s installed in your project or not:
# Open docs for a specific package$ vlt docs express
# Open docs for a specific version
# Open docs for a scoped package
$ vlt docs @vltpkg/graph
The command fetches the package manifest from the registry and determines the best documentation URL to open.
Query packages using —target
Use the --target
option with DSS query syntax to find documentation
for packages in your dependency graph:
# Open docs for a specific package in your graph$ vlt docs --target="#lodash"
# List documentation URLs for all direct dependencies
$ vlt docs --target=":root > *"
# Find docs for all packages from a specific scope
$ vlt docs --target="[name^=@types]"
Note: When the query matches multiple packages, documentation URLs are listed instead of being opened automatically.
Use Cases
Package Discovery
Quickly research packages:
# Compare test frameworks$ vlt docs tap$ vlt docs jest$ vlt docs vitest
Debugging and Support
Access documentation when troubleshooting issues:
# Error with a package? Read the docs$ vlt docs --target="#problematic-package"
# Need API reference?
$ vlt docs @vltpkg/spec
Learning and Exploration
Explore the ecosystem and learn about packages:
# Learn about vlt packages$ vlt docs @vltpkg/graph$ vlt docs @vltpkg/query
# Explore popular packages
$ vlt docs express $ vlt docs react
Options
--target=<query>
Filter packages using DSS query syntax. When a single package matches, its documentation opens in your browser. When multiple packages match, their documentation URLs are listed.
# Open docs for a single package$ vlt docs --target="#express"
# List docs for all direct dependencies
$ vlt docs --target=":root > *"
# List docs for packages with build scripts
$ vlt docs --target=":scripts"
Notes
- The command automatically opens your default web browser for single results
- Works with any valid package specifier (names, versions, tags, etc.)
- Does not require the package to be installed when using package specifiers
- With
--target
, it defaults to only searches packages in your current dependency graph - Falls back gracefully to npm package pages when repository info is unavailable
- Multiple results are displayed as a formatted list instead of opening URLs