private void verifyAndRegister() {
        // All top level commands are supposed to be registered in the command manager
        this.internalTree.children().stream().map(CommandNode::component).forEach(component -> {
            if (component.type() != CommandComponent.ComponentType.LITERAL) {
                throw new IllegalStateException("Top level command argument cannot be a variable");
            }
        });

        this.checkAmbiguity(this.internalTree);

        // Verify that all leaf nodes have command registered
        this.getLeaves(this.internalTree).forEach(leaf -> {
            if (leaf.command() == null) {
                throw new NoCommandInLeafException(leaf.component());
            } else {
                final Command<C> owningCommand = leaf.command();
                this.commandManager.commandRegistrationHandler().registerCommand(owningCommand);
            }
        });

        this.getExecutorNodes(this.internalTree).forEach(this::propagateRequirements);
    }
Goes through all commands and registers them, then verifies the integrity of the command tree.
cloud-core/src/main/java/org/incendo/cloud/CommandTree.java