I’m using the term app to mean a GUI application that a user to can run from the Finder, not as abbreviation for application. Command-line tools do not, in general, have an app-like structure and, as such, can’t host XPC Services.
Command line app is also an app!
You do have options here:
You could create a launchd daemon or agent and have it vend an XPC service (lower case S).
You could package your command-line tool in an app-like structure (see this post) and embed your XPC Services in that.
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"