JSON2YAML(1)
β¨ json2yaml β bestie's guide to turning JSON into conf2-compatible YAML β¨
okay so picture this: you're a json2yaml(1) girlie living in a JSON world, and you need your config files to speak YAML so conf2 modules can read them. that's literally the whole job. no cap. π¦
πΈ SYNOPSIS πΈ
json2yaml [-h] [-oOUTPUT_DIR] SOURCE...
π DESCRIPTION π
this little icon converts your JSON configuration files into YAML format that's compatible with conf2 modules. it can do the cute low-key thing where you hand it one single JSON file, or it can go full main character and recursively convert all the JSON files inside directories. either way, output files keep their original names and just get a .yaml extension slapped on the end. periodt. π
β¨ OPTIONS β¨
-h,--helpβ shows the help message and dips out. classic.-o OUTPUT_DIR,--output OUTPUT_DIRβ tell it where to drop the goods. the default is~/yamlπSOURCE...β the JSON file(s) or directory path(s) you want processed. you need at least one, bestie, it can't read your mind π
π§ CONVERSION RULES π§
- JSON objects become nested YAML structures π
- all values gain metadata fields:
_default: the original value_type: type indicator ('s'for scalar,'as'for arrays)
- array values get converted into string representations (iykyk)
- the output version is fixed to
2.0.0.0-0k0.0β not negotiable, it's giving very set-in-stone π
π OUTPUT π
files land as <original_name>.yaml in the output directory. slay.
π Structure π
<filename>:
2.0.0.0-0k0.0:
<key1>:
_default: <value>
_type: <s|as>
<key2>: ...
π± ENVIRONMENT π±
HOMEβ used when the default output directory (~/yaml) is specified π
π EXAMPLES π
convert a single file:
json2yaml /etc/app/config.json
convert a directory with a custom output:
json2yaml -o ~/converted /path/to/json_configs/
convert multiple sources:
json2yaml file1.json file2.json ~/legacy_configs
π₯ EXIT STATUS π₯
0β success π1β input errors (invalid files/paths) π2β processing errors π
β NOTES β
- original JSON arrays become string values in YAML, fr fr
- nested objects are preserved recursively β nothing gets lost, we don't do that here π«Ά
- non-JSON files are skipped with a warning. not me ignoring the irrelevant ones π
π SEE ALSO π
π AUTHOR π
UKUI Configuration Tools Team π
okay that's the whole page bestie, go forth and convert πΈ
and that's a wrap!! brought to you by v1.1, dated 2025-07-24 β the json2yaml era, iconic, no notes π
β¨
π¦ where this page comes from
- arch rolling: libkysdk-base 3.0.1.1-1 Β· Apache-2.0 AND LGPL-3.0-or-later AND MIT
- ubuntu resolute: libkysdk-base 3.0.1.2-0ubuntu1 Β· LGPL-3.0-or-later
- ubuntu stonking: libkysdk-base 3.0.1.3-1build1 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms