function addCommandsDirectory(string $path) {
        $path = \realpath($path);
        if($path === false) {
            throw new \InvalidArgumentException('Invalid path specified');
        }
        
        if($path !== $this->basepath && !\in_array($path, $this->commandsDirectories, true)) {
            $this->commandsDirectories[] = $path;
        }
        
        return $this;
    }