github.com/wmuizelaar/kpt@v0.0.0-20221018115725-bd564717b2ed/site/book/03-packages/02-exploring-a-package.md (about)

     1  After you fetch a package to your local filesystem, you typically want to
     2  explore the package to understand how it is composed and how it can be
     3  customized for your needs. Given a kpt package is just an ordinary directory of
     4  human-readable YAML files, you can naturally use your favorite file explorer,
     5  shell commands, or editor to explore the package.
     6  
     7  kpt also provides the `tree` command which is handy for quickly viewing package
     8  hierarchy and the constituent packages, files, and resources:
     9  
    10  ```shell
    11  $ kpt pkg tree wordpress/
    12  Package "wordpress"
    13  ├── [Kptfile]  Kptfile wordpress
    14  ├── [service.yaml]  Service wordpress
    15  ├── deployment
    16  │   ├── [deployment.yaml]  Deployment wordpress
    17  │   └── [volume.yaml]  PersistentVolumeClaim wp-pv-claim
    18  └── Package "mysql"
    19      ├── [Kptfile]  Kptfile mysql
    20      ├── [deployment.yaml]  PersistentVolumeClaim mysql-pv-claim
    21      ├── [deployment.yaml]  Deployment wordpress-mysql
    22      └── [deployment.yaml]  Service wordpress-mysql
    23  ```
    24  
    25  ?> Refer to the [tree command reference][tree-doc] for usage.
    26  
    27  In addition, you can use a kpt function such as `search-replace` to run a query
    28  on the package. For example, to search for resources that have a field with path
    29  `spec.selector.tier`:
    30  
    31  ```shell
    32  $ kpt fn eval wordpress -i search-replace:v0.1 -- 'by-path=spec.selector.tier'
    33  ```
    34  
    35  [tree-doc]: /reference/cli/pkg/tree/