The ZeroInstall.Commands namespace provides a command-line interface for Zero Install. This both implements an actual command-line executable and provides a library for building other clients.
ProgramUtils.Init() should be called by all clients right after startup to initialize process-wide state.
Afterwards ProgramUtils.Run() can be called with the command-line arguments to be parsed along with an ICommandHandler.
ICommandHandler extends the ITaskHandler interface with various UI interactions that commands can use to display intermediate results, ask for user input, etc..
ProgramUtils.Run() parses the provided command-line arguments and selects the appropriate CliCommand to handle them.
CliCommand derives from ScopedOperation. This provides a more basic starting point, for any operation that requires scoped dependency resolution. It provides this by itself deriving from ServiceProvider.