cat
Print the contents of a package
cat prints the contents of a package to stdout. KRM resources (YAML/JSON)
are formatted as YAML, while non-KRM text files are printed raw. Outputs are
separated by document separators.
Synopsis #
kpt pkg cat [FILE | DIR]
Args #
FILE | DIR:
Path to a file or a directory containing a kpt package. Displays all
package files: KRM resources (YAML/JSON) are formatted by default,
and non-KRM text files (e.g., README.md) are shown as raw content.
Binary files are skipped. Defaults to the current directory.
Flags #
--annotate:
Annotate resources with their file origins. Defaults to false.
--format:
Format resource config YAML before printing (reorders fields to canonical
order). Defaults to true.
--recurse-subpackages, -R:
Print resources recursively in all the nested subpackages. Defaults to true.
--strip-comments:
Remove comments from yaml. Defaults to false.
--style:
yaml styles to apply. May be 'TaggedStyle', 'DoubleQuotedStyle',
'LiteralStyle', 'FoldedStyle', 'FlowStyle'.
Examples #
# Print all package contents from current directory.
$ kpt pkg cat
# Print a single resource file.
$ kpt pkg cat path/to/deployment.yaml
# Print a non-KRM file.
$ kpt pkg cat path/to/README.md
Last modified July 20, 2026: Use custom usage template to avoid duplicate flag info in help output (425fda2a)