Many macOS applications provide a binary that allows one to lauch it from the commandline. I don't have either of these 2 programs you mentioned.
What happens, if you run:
/Applications/Typora.app/Contents/MacOS/Typora -h
/Applications/Typora.app/Contents/MacOS/Typora --help
Sometimes a macOS app also allows to call it directly with arguments.
If not, there's something like open
that might work.
open -a Typora file.txt