from typing import List


def _replace_pw_references(alias_cmd: str, pw_args: List[str]) -> str:
    """Replace all occurrences of pw@ with the path to the pw script (argv[0]) plus all pw options"""
    replacement = " ".join(pw_args) + " "
    return alias_cmd.replace("pw@", replacement)