This is something we may be doing in the sbt-server as well.  Wonder if maybe we need to share code at some point...