@Override
    protected void run(final Bootstrap<Config> bootstrap,
                       final Namespace namespace,
                       final Config config) throws Exception {

        info(LOGGER, "Using application configuration file {}",
                configFile.toAbsolutePath().normalize());

        try {
            LOGGER.debug("Creating bootstrap injector");
            bootstrapInjector = BootstrapUtil.bootstrapApplication(
                    config, configFile);
            final Optional<Module> optChildInjectorModule = getChildInjectorModule();
            if (optChildInjectorModule.isPresent()) {
                final Module module = optChildInjectorModule.get();
                LOGGER.debug(() -> "Creating child injector using module " + module.getClass().getName());
                childInjector = bootstrapInjector.createChildInjector(module);
            } else {
                // No child module so just use the bootstrapInjector as our main injector
                LOGGER.debug(() -> "No child injector module provided, using bootstrapInjector");
                childInjector = bootstrapInjector;
            }
            info(LOGGER, "Running command " + commandName + " with arguments: " + argsToString(namespace));

            try {
                runCommand(bootstrap, namespace, config, childInjector);
            } catch (Exception e) {
                final String msg = "Error running command "
                        + commandName
                        + ": " + e.getMessage()
                        + ". Check logs for more detail.";
                error(LOGGER, msg, e);
                System.exit(1);
            }

            info(LOGGER, "Command " + commandName + " completed successfully");
            System.exit(0);
        } catch (Exception e) {
            final String msg = "Error initialising application";
            error(LOGGER, msg, e);
            System.exit(1);
        }
    }
This a base command class for all stroom commands to extend from. It sets up the minimal
bootstrap injector. Subclasses can optionally provide an additional guice module to create
a childInjector from.
stroom-app/src/main/java/stroom/app/commands/AbstractStroomBaseCommand.java