3 ms·
Also if you don't want `jq` installed, `python` will also do it with `cat your.json | python -m json.tool`
by Macha 2y ago
Also if you don't want `jq` installed, `python` will also do it with `cat your.json | python -m json.tool`
- latexr 2y agoPython no longer comes preinstalled with macOS. Though running any command against /usr/bin/python3 will make macOS prompt you about installing the Xcode Developer Tools (takes two clicks), which does get you Python. Anyway, jq now ships with macOS Sequoia. For older versions of macOS, using JavaScript for Automation is preinstalled and gets the job done with a bit more verbosity: osascript -l JavaScript -e 'function run(argv) { return JSON.stringify(JSON.parse(argv[0]),null,2) }' '{"key": "value"}'