linux yaml validator command line

C++
python -c 'import yaml, sys; yaml.safe_load(sys.stdin)' < cfg.yaml
Source

Also in C++: