View Package Ancestry
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 sf package version list command.

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.
To generate dotcode output, specify sf package version displayancestry --dot-code.