def build_cmd(remote):
    """
    Build the command we pass the script to

    >>> build_cmd({'scheme': ''})
    ['sh']
    >>> build_cmd({'scheme': 'ssh', 'host': 'host', 'port': 80})
    ['ssh', '-p', 80, 'host', 'sh']
    """
    cmd = []
    if remote['scheme']:
        cmd.append('ssh')
        if remote['port']:
            cmd.extend(['-p', remote['port']])
        cmd.append(remote['host'])
    cmd.append('sh')
    return cmd
