code: def register_precmd_hook(self, func: Callable[[plugin.PrecommandData], plugin.PrecommandData]) -> None:
          
          self._validate_prepostcmd_hook(func, plugin.PrecommandData)
          self._precmd_hooks.append(func)
docs: Register a hook to be called before the command function.