https://www.nushell.sh/
Why not
A: have a flag to the command telling it you want json output?
B: put the actual file descriptor in the environment variable rather than a flag to look for a hardcoded one?
“[…] if the environment variable STDDATA_FD is present or set to the descriptor to produce the JSON output on.”