def METHOD_NAME(cmd, remote_name=None, extra_args=None):
    """
    Runs ricecooker. Should be run from a directory containing sushichef.py.template or chef.py.
    :param args: Object with passed parameters and default values.
    :return:
    """
    global jiro_config
    cmd_args = [sys.executable, get_chef_script(), cmd]
    cmd_args.extend(extra_args)
    env = os.environ.copy()
    if "tempdir" in jiro_config:
        env["TMPDIR"] = jiro_config["tempdir"].format(CHEFDIR=os.getcwd())
        print("TMPDIR = {}".format(env["TMPDIR"]))
    token = None
    if remote_name:
        if remote_name in jiro_config["remotes"]:
            remote = jiro_config["remotes"][remote_name]
            env["STUDIO_URL"] = remote["url"]
            if "token" in remote and remote["token"]:
                token = remote["token"]
            else:
                token = prompt_for_token(remote_name)
            cmd_args.extend(["--token", token])
        else:
            print(
                "ERROR: No remote with name {} found. To see available remotes, run: jiro remote list"
            )
            sys.exit(1)
    print("Running {}".format(cmd_args))
    return subprocess.call(cmd_args, env=env)