package version displaydependencies

<!-- prettier-ignore-start -->

Display the dependency graph for an unlocked or 2GP managed package version.

Flags

Flag Name (Long) Flag Name (Short) Description
<code>‑‑api‑version</code> N/A Type: Value<br><br>Override the api version used for api requests made by this command
<code>‑‑edge‑direction</code> N/A Type: Value<br>Valid Values: root-first, root-last<br>Default value: root-first<br><br>Order (root-first or root-last) in which the dependencies are displayed.<br><br>A root-first graph declares the root as the package that must be installed last. A root-last graph is the reverse order of root-first. If you specify "--edge-direction root-last", the graph displays the packages in the order they must be installed. The root starts with the farthest leaf of the package dependencies and ends with the base package, which must be installed last.
<code>‑‑flags‑dir</code> N/A Type: Value<br><br>Import flag values from a directory.
<code>‑‑installation‑key</code> <code>‑k</code> Type: Value<br><br>Installation key for a key-protected package version (starts with 04t).
<code>‑‑json</code> N/A Type: Boolean<br><br>Format output as json.
<code>‑‑package</code> <code>‑p</code> Type: Value<br>Required<br><br>ID or alias of the package version (starts with 04t) or the package version create request (starts with 08c) to display the dependency graph for.<br><br>Before running this command, update your sfdx-project.json file to specify the calculateTransitiveDependencies attribute, and set the value to true. This command returns GraphViz code, which can be compiled to a graph using DOT code or another graph visualization software.
<code>‑‑target‑dev‑hub</code> <code>‑v</code> Type: Value<br>Required<br><br>Username or alias of the Dev Hub org. Not required if the target-dev-hub configuration variable is already set.
<code>‑‑verbose</code> N/A Type: Boolean<br><br>Display both the package version ID (starts with 04t) and the version number (major.minor.patch.build) in each node.

Examples for package version displaydependencies

Display the dependency graph for a package version with the specified alias, using your default Dev Hub org and the default edge-direction:

sf package version displaydependencies --package package_version_alias

Display the dependency graph for a package version with the specified ID and display the graph using a root-last edge direction. Use the Dev Hub org with username devhub@example.com:

sf package version displaydependencies --package 04t... --edge-direction root-last --target-dev-hub devhub@example.com

Display the dependency graph of a version create request with the specified ID, using your default Dev Hub org and the default edge-direction:

sf package version displaydependencies --package 08c...

Display the dependency graph for a key-protected package version:

sf package version displaydependencies --package 04t... --installation-key "my installation key"
<!-- prettier-ignore-end -->