Jsonnet - The data templating language
It sounds like you should be using a YAML template engine of some kind. Examples include https://jsonnet.org/ and https://carvel.dev/ytt/, but you may find others. They are written by others to be somewhat generic, work with tree data natively, and should be accessible from the command line.
Jsonnet – A Data Templating Language
1 project | news.ycombinator.com | 19 Dec 2021
Alternatives to Terragrunt
1 project | reddit.com/r/devops | 8 Dec 2021
Do DevOpers Use JSONNET?
1 project | reddit.com/r/devops | 7 Dec 2021
Best struct merge function design?
1 project | reddit.com/r/golang | 30 Nov 2021
1 project | reddit.com/r/tree_notations | 28 Mar 2021