@Override
    public int apply(Arguments arguments, Command.Env env) {
        BuildOptions buildOptions = arguments.getReceiver(BuildOptions.class);
        ThreadResult threadResult = new ThreadResult();
        ConfigOptions configOptions = arguments.getReceiver(ConfigOptions.class);
        SmithyBuildConfig config = configOptions.createSmithyBuildConfig();

        runTaskWithClasspath(buildOptions, config, env, classLoader -> {
            Command.Env updatedEnv = env.withClassLoader(classLoader);
            threadResult.returnCode = action.apply(config, arguments, updatedEnv);
        });

        return threadResult.returnCode;
    }
A {@code CommandAction} that runs a wrapped action within a custom classpath.
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ClasspathAction.java