tree
Display resources, files and packages in a tree structure.
tree displays resources, files and packages in a tree structure.
Each package (directory containing a Kptfile) is annotated with its type:
- (independent): The package has an
upstreamsection in itsKptfile, meaning it tracks its own upstream source and can be updated independently. - (dependent): A subpackage that does not have an
upstreamsection in itsKptfile. Its upstream is implicitly inherited from its parent package.
A root package created locally (e.g. via kpt pkg init) has no annotation since
it is neither independent nor dependent — it simply has no upstream source.
Synopsis #
kpt pkg tree [DIR]
Args #
DIR:
Path to a local package directory. Defaults to the current directory.
Displays KRM resources with their Kind and Name, and non-KRM text files
as plain filenames. Dotfiles and symlinks are excluded.
Examples #
# Show resources in the current directory.
$ kpt pkg tree
# Example output showing independent and dependent packages:
$ kpt pkg tree wordpress/
Package "wordpress" (independent)
├── [Kptfile] Kptfile wordpress
├── [service.yaml] Service wordpress
├── deployment
│ ├── [deployment.yaml] Deployment wordpress
│ └── [volume.yaml] PersistentVolumeClaim wp-pv-claim
└── Package "mysql" (dependent)
├── [Kptfile] Kptfile mysql
├── [deployment.yaml] Deployment wordpress-mysql
└── [deployment.yaml] Service wordpress-mysql
Last modified July 28, 2026: Show independent/dependent package type in pkg tree output (d254d98b)