How can I pipe HTML content to Safari via the command line?
You can use something like

echo '&lt;html&gt;&lt;body&gt;&lt;h2&gt;Hi, there!&lt;/h2&gt;foo&lt;/body&gt;&lt;/html&gt;' &gt; /tmp/x.html &amp;&amp; open -a "Safari" /tmp/x.html


I entered some HTML that contains an exclamation mark to show that you need to use single quotes for the shell, otherwise it will interpret this as a history recall. Yes, longer and you need a file name, but you can use your somethingThatProducesHTMLonStdout tool from your question.