def get_command_line(instance_type, env, message, data, mode, open_notebook, command_str):
    floyd_command = ["floyd", "run"]
    if instance_type:
        floyd_command.append('--' + INSTANCE_NAME_MAP[instance_type])
    if env and not env == DEFAULT_ENV:
        floyd_command += ["--env", env]
    if message:
        floyd_command += ["--message", shell_quote(message)]
    if data:
        for data_item in data:
            parts = data_item.split(':')
            if len(parts) > 1:
                data_item = normalize_data_name(parts[0], use_data_config=False) + ':' + parts[1]
            floyd_command += ["--data", data_item]
    if mode and mode != "job":
        floyd_command += ["--mode", mode]
        if mode == 'jupyter':
            if not open_notebook:
                floyd_command.append("--no-open")
    else:
        if command_str:
            floyd_command.append(shell_quote(command_str))
    return ' '.join(floyd_command)