I haven't taken a very close look at Swarm yet, but I assumed you start Wildfly embedded in the same JVM as your Main class. If that is the case, then there should be no problem communicating with any kind of deployed component via heap directly - just lookup some singleton ...

If that is not the case, then we would need some kind of interprocess communication going. With shell the roles of who connects where could also be reversed, and a started up Wildfly instance could have a service connecting out to local port bound by our CLI rather than the other way around.

I'm throwing out ideas here, not really knowing what are the hard constraints that we don't want to violate ...