Custom command for monitor


I’m currently using jlink to see my debug traces.
I have a custom debug_server command, but I don’t see an equivalent for monitor.
If it possible? I’m using ~/.platformio/packages/tool-jlink/JLinkSWOViewerCLExe -device AMA3B1KK-KBR -itmport 0 -swofreq 1000000, but it act as a terminal in itself. I think it can also redirect to a socket. But then I still need to tell platformio to start the server (like the debug server when doing gdb)