def read_task(args: argparse.Namespace, cli_multiline_input: bool) -> str:
    """
    Read the task from the CLI args, file, or stdin.
    """

    # Determine the task
    task_str = ''
    if args.file:
        task_str = read_task_from_file(args.file)
    elif args.task:
        task_str = args.task
    elif not sys.stdin.isatty():
        task_str = read_input(cli_multiline_input)

    return task_str

    Read the task from the CLI args, file, or stdin.
    
openhands/io/io.py