private @NonNull CompletableFuture<@Nullable Command<C>> parseDirect(
            final @NonNull CommandContext<C> commandContext,
            final @NonNull CommandInput commandInput,
            final @NonNull Executor parsingExecutor
    ) {
        // Special case for empty command trees.
        if (this.internalTree.isLeaf() && this.internalTree.component() == null) {
            return CompletableFutures.failedFuture(
                    new NoSuchCommandException(
                            commandContext.sender(),
                            new ArrayList<>(),
                            commandInput.peekString()
                    )
            );
        }

       return this.parseCommand(
                new ArrayList<>(),
                commandContext,
                commandInput,
               this.internalTree,
               parsingExecutor
        ).thenCompose(command -> {
            if (command != null
                    && command.senderType().isPresent()
                    && !GenericTypeReflector.isSuperType(command.senderType().get().getType(), commandContext.sender().getClass())) {
                return CompletableFutures.failedFuture(
                        new InvalidCommandSenderException(
                                commandContext.sender(),
                                command.senderType().get().getType(),
                                new ArrayList<>(command.components()),
                                command
                        )
                );
            }
            return CompletableFuture.completedFuture(command);
        });
    }
Attempts to parse a command from the provided input.

@param commandContext  command context instance
@param commandInput    command input
@param parsingExecutor executor to schedule parsing logic on
@return parsed command, if one could be found
cloud-core/src/main/java/org/incendo/cloud/CommandTree.java