Some alternatives
-
have your command dump all the messages that have occurred since the last invocation of the command. That way the output is finite.
-
have your cli command monitor all traffic continuously until ctrl-c (or some other key combination) is pressed then it reverts back to your application’s cli prompt.
-
have your cli command send data to a file and monitor that with a
tail
type tool