# This file was auto generated by Styx.
# Do not edit this file directly.

import typing
import pathlib
from styxdefs import *
import dataclasses

FS_RUN_FROM_MCR_METADATA = Metadata(
    id="cde2b930dda53cf7f6ac5ac2d3c81e82bcafc347.boutiques",
    name="fs_run_from_mcr",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class FsRunFromMcrOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fs_run_from_mcr(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def fs_run_from_mcr(
    name: str | None = None,
    command: str | None = None,
    zeroth_flag: bool = False,
    empty_env_flag: bool = False,
    runner: Runner | None = None,
) -> FsRunFromMcrOutputs:
    """
    Replace the shell with the given command.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        name: Pass NAME as the zeroth argument to COMMAND.
        command: The command to execute.
        zeroth_flag: Place a dash in the zeroth argument to COMMAND.
        empty_env_flag: Execute COMMAND with an empty environment.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FsRunFromMcrOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FS_RUN_FROM_MCR_METADATA)
    cargs = []
    cargs.append("fs_run_from_mcr")
    if name is not None:
        cargs.extend([
            "-a",
            name
        ])
    if command is not None:
        cargs.append(command)
    if zeroth_flag:
        cargs.append("-l")
    if empty_env_flag:
        cargs.append("-c")
    ret = FsRunFromMcrOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FS_RUN_FROM_MCR_METADATA",
    "FsRunFromMcrOutputs",
    "fs_run_from_mcr",
]
