I now have an agent controller that can start an agent, run it, output a trace and terminate it.

It is really nasty, and there is probably a better way of doing it, that trying to run it in a terminal, but this is a quick and easy solution that may have to be revisited later.