---
schema_version: "1"
id: c733f8dcee49a4e81b184e70d27f32b955ddd63c205ee0dfe0fedb8a1f270478
title: View Package Ancestry
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/managed_packaging/guides/second-generation/sfdx-dev-dev2gp-view-ancestors.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg2-dev/guide/sfdx-dev-dev2gp-view-ancestors.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 13ce2407912a814e06bab38d671ec7b4e8f2e0e6b2b9261c677f7aba35f12a12
products:
  - Second-Generation Managed Packaging Developer Guide
  - merged-docs
---

# View Package Ancestry

Use Salesforce CLI commands to quickly confirm your package’s ancestor, or to create a visualization of the package ancestry tree.

## View Package Ancestor Details in Salesforce CLI

Use the `sf package version report` or `sf package version list` command to view the name and version number of the package ancestor.

Output from `sf package version report` command.

![Output from package:version:list command](https://developer.salesforce.com/media/pkg2_dev/sfdx_packaging_cli_report.png)

Output from `sf package version list` command.

![Output from package:version:report command](https://developer.salesforce.com/media/pkg2_dev/sfdx_packaging_cli_list.png)

## Visualize Package Ancestry

Use the `displayancestry` CLI command to create visualizations of your package or package version’s ancestry tree. You can view the visualization in Salesforce CLI or use the dot-code parameter to generate output that can be used in graph visualization software.

Use `sf package version displayancestry` to quickly visualize your package ancestry and understand the possible package upgrade paths.

![Graphic tree visualization for package:version:create](https://developer.salesforce.com/media/pkg2_dev/sfdx_packaging_ancestry.png)

![Graphic tree visualization for package:create](https://developer.salesforce.com/media/pkg2_dev/sfdx_packaging_package_version_ancestry.png)

To generate dotcode output, specify `sf package version displayancestry --dot-code`.
