Classes/Console/Mvc/Cli/Symfony/Application.php
public function isCommandAvailable(Command $command): bool
    {
        if (!$this->isFullyCapable()
            && in_array($command->getName(), [
                // Although these commands are technically available
                // they call other hidden commands in sub processes
                // that need all capabilities. Therefore we disable these commands here.
                // This can be removed, once they implement Symfony commands directly.
                'upgrade:all',
                'upgrade:list',
                'upgrade:wizard',
            ], true)
        ) {
            return false;
        }
        if ($command->getName() === 'cache:flushcomplete') {
            return true;
        }

        return $this->runLevel->isCommandAvailable($command->getName());
    }
public function isCommandAvailable(Command $command): bool
    {
        if (!$this->isFullyCapable()
            && in_array($command->getName(), [
                // Although these commands are technically available
                // they call other hidden commands in sub processes
                // that need all capabilities. Therefore we disable these commands here.
                // This can be removed, once they implement Symfony commands directly.
                'upgrade:all',
                'upgrade:list',
                'upgrade:wizard',
            ], true)
        ) {
            return false;
        }
        if ($command->getName() === 'cache:flushcomplete') {
            return true;
        }

        return $this->runLevel->isCommandAvailable($command->getName());
    }
Checks if the given command can be executed in current application state

@param Command $command
@return bool