Bash
Talk about the Bash Shell and Bash scripting
When I use just the wget aspect of the command, it dumps a bunch of jargon to my terminal, so I think that means I have the "stdout" aspect of that command right.
I think you just need to redirect¹ stdout from bzip2 to a file.
wget -qO- "https://opnsense.com/.../img.bz2" | bzip2 -dv > img
1: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_07
To button this up, I didn't figure out the one-line solution. I used a script that opnsense publishes to install opnsense on top of freebsd. This is the same script used in the opnsense installer img. Wasn't hard, but I was laser-focused on figuring out the one-line solution. :(
I feel you need to save the whole file before bzip2 can open it (for decompression). Compression/decompression is done in patterns, so it can't decompress if it doesn't get the data to inflate.