<commit_before>After you fetch a package to your local filesystem, you typically want to explore the package to
understand how it is composed and how it can be customized for your needs. Given a kpt package is
just an ordinary directory of human-readable YAML files, you can naturally use your favorite file
explorer, shell commands, or editor to explore the package.

kpt also provides the `tree` command which is handy for quickly viewing package hierarchy and the
constituent packages, files, and resources:

```shell
$ kpt pkg tree wordpress/
PKG: wordpress
├── [Kptfile]  Kptfile wordpress
├── [service.yaml]  Service wordpress
├── deployment
│   ├── [deployment.yaml]  Deployment wordpress
│   └── [volume.yaml]  PersistentVolumeClaim wp-pv-claim
└── PKG: mysql
    ├── [Kptfile]  Kptfile mysql
    ├── [deployment.yaml]  PersistentVolumeClaim mysql-pv-claim
    ├── [deployment.yaml]  Deployment wordpress-mysql
    └── [deployment.yaml]  Service wordpress-mysql
```

> Refer to the [command reference][tree-doc] for more details.

In addition, you can use a kpt function such as `search-replace` to run a query on the package.
For example, to search for resources that have a field with path `spec.selector.tier`:

```shell
$ kpt fn eval --image gcr.io/kpt-fn/search-replace:unstable -- 'by-path=spec.selector.tier'
```

TODO(#1821): search-replace doesn't work.

[tree-doc]: /reference/pkg/tree/<commit_msg>Specify package name in 02-exploring-a-package.md<commit_after>After you fetch a package to your local filesystem, you typically want to explore the package to
understand how it is composed and how it can be customized for your needs. Given a kpt package is
just an ordinary directory of human-readable YAML files, you can naturally use your favorite file
explorer, shell commands, or editor to explore the package.

kpt also provides the `tree` command which is handy for quickly viewing package hierarchy and the
constituent packages, files, and resources:

```shell
$ kpt pkg tree wordpress/
PKG: wordpress
├── [Kptfile]  Kptfile wordpress
├── [service.yaml]  Service wordpress
├── deployment
│   ├── [deployment.yaml]  Deployment wordpress
│   └── [volume.yaml]  PersistentVolumeClaim wp-pv-claim
└── PKG: mysql
    ├── [Kptfile]  Kptfile mysql
    ├── [deployment.yaml]  PersistentVolumeClaim mysql-pv-claim
    ├── [deployment.yaml]  Deployment wordpress-mysql
    └── [deployment.yaml]  Service wordpress-mysql
```

> Refer to the [command reference][tree-doc] for more details.

In addition, you can use a kpt function such as `search-replace` to run a query on the package.
For example, to search for resources that have a field with path `spec.selector.tier`:

```shell
$ kpt fn eval --image gcr.io/kpt-fn/search-replace:unstable wordpress -- 'by-path=spec.selector.tier'
```

TODO(#1821): search-replace doesn't work.

[tree-doc]: /reference/pkg/tree/
{'fraction_non_alphanumeric': 0.09937456567060458, 'fraction_numerical': 0.0034746351633078527, 'mean_word_length': 4.432075471698113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4661868', 'n_tokens_mistral': 885, 'n_tokens_neox': 864, 'n_words': 362}