from typing import Optional
from typing import Tuple


def get_extraction_cmd(archive_path: str, output_dir: str) -> Optional[Tuple[str, ...]]:
    """Returns a shell command to run to extract the archive to the output directory."""
    # Note that we assume that mkdir, unzip, and tar exist in the executing environment.
    if archive_path.endswith(".zip"):
        return ("unzip", "-q", archive_path, "-d", output_dir)
    elif archive_path.endswith((".tar", ".tar.gz", ".tgz", ".tar.bz2", ".tbz2", ".tar.xz", ".txz")):
        return ("mkdir", output_dir, "&&", "tar", "xf", archive_path, "-C", output_dir)
    return None