Firebase CLI takes -j, --json option to format output in JSON rather than text.
-j, --json
Other options and commands can be listed with firebase --help.
firebase --help