Is there a way to export from Lyx to Latex using the CLI so that in only writes to stdout, and not to a file?
No this is not currently possible. You can make a feature request here. It might make sense to implement it for the -E option. So you could do something like
lyx -E latex - yourfile.lyx, where
- means output to STDOUT. I think that's consistent with what some Unix commands do (e.g.
So in the meantime, you will have to output to a file and then
cat that file to command you want to pipe to.
Note that the OP posted an enhancement that can be followed here.