Skip to content

task_runners

Class info

Classes

Name Children Inherits
CargoRunner
anyenv.task_runners._cargo
Task runner for Cargo (Rust) aliases and xtask.
    DoitRunner
    anyenv.task_runners._python
    Task runner for doit (pydoit.org).
      DutyRunner
      anyenv.task_runners._python
      Task runner for Duty (pawamoy/duty).
        InvokeRunner
        anyenv.task_runners._python
        Task runner for Invoke (pyinvoke.org).
          JustRunner
          anyenv.task_runners._just
          Task runner for Just (casey/just).
            MakefileRunner
            anyenv.task_runners._makefile
            Task runner for GNU Make.
              PackageJsonRunner
              anyenv.task_runners._npm
              Task runner for package.json scripts.
                TaskInfo
                anyenv.task_runners._base
                Information about a single task/target.
                  TaskRunner
                  anyenv.task_runners._base
                  Base class for task runner configurations.
                  TaskfileRunner
                  anyenv.task_runners._task
                  Task runner for Taskfile (taskfile.dev).

                    🛈 DocStrings

                    Task runner abstraction for various build tools.

                    Provides a unified interface for detecting, parsing, and running tasks from various task runners like Make, Just, Task, Duty, Invoke, doit, and npm.

                    CargoRunner dataclass

                    Bases: TaskRunner

                    Task runner for Cargo (Rust) aliases and xtask.

                    Supports: - Aliases defined in .cargo/config.toml or .cargo/config - xtask convention (workspace with xtask crate)

                    Source code in src/anyenv/task_runners/_cargo.py
                    @dataclass
                    class CargoRunner(TaskRunner):
                        """Task runner for Cargo (Rust) aliases and xtask.
                    
                        Supports:
                        - Aliases defined in `.cargo/config.toml` or `.cargo/config`
                        - xtask convention (workspace with xtask crate)
                        """
                    
                        id: ClassVar = "cargo"
                        website: ClassVar = "https://doc.rust-lang.org/cargo/"
                        filenames: ClassVar = [".cargo/config.toml", ".cargo/config", "xtask/Cargo.toml"]
                        help_cmd: ClassVar = ["cargo", "--list"]
                        logo: ClassVar[str | None] = "https://www.rust-lang.org/logos/rust-logo-512x512.png"
                        # Pattern for TOML alias: name = "command" or name = ["cmd", "args"]
                    
                        async def detect(self, fs: AsyncFileSystem, cwd: str) -> bool:
                            """Check if this task runner is used in the given directory."""
                            # Check for cargo config with aliases
                            for config_name in (".cargo/config.toml", ".cargo/config"):
                                filepath = posixpath.join(cwd, config_name)
                                try:
                                    if await fs._isfile(filepath):  # noqa: SLF001
                                        content = await self._read_file(fs, filepath)
                                        if "[alias]" in content:
                                            return True
                                except Exception:  # noqa: BLE001
                                    pass
                    
                            xtask_cargo = posixpath.join(cwd, "xtask", "Cargo.toml")  # Check for xtask crate
                            try:
                                if await fs._isfile(xtask_cargo):  # noqa: SLF001
                                    return True
                            except Exception:  # noqa: BLE001
                                pass
                    
                            return False
                    
                        async def get_config_file(self, fs: AsyncFileSystem, cwd: str) -> str | None:
                            """Get the cargo config file path if it exists."""
                            for config_name in (".cargo/config.toml", ".cargo/config"):
                                filepath = posixpath.join(cwd, config_name)
                                try:
                                    if await fs._isfile(filepath):  # noqa: SLF001
                                        return filepath
                                except Exception:  # noqa: BLE001
                                    pass
                            return None
                    
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse cargo config and xtask to return available tasks."""
                            tasks: list[TaskInfo] = []
                            # Get aliases from cargo config
                            tasks.extend(await self._get_aliases(fs, cwd))
                            # Get xtask commands
                            tasks.extend(await self._get_xtask_commands(fs, cwd))
                            return sorted(tasks, key=lambda t: t.name)
                    
                        async def _get_aliases(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse aliases from .cargo/config.toml."""
                            config_file = await self.get_config_file(fs, cwd)
                            if config_file is None:
                                return []
                    
                            content = await self._read_file(fs, config_file)
                            return _parse_cargo_config(content)
                    
                        async def _get_xtask_commands(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Detect xtask commands from xtask/src/main.rs."""
                            xtask_main = posixpath.join(cwd, "xtask", "src", "main.rs")
                            try:
                                if not await fs._isfile(xtask_main):  # noqa: SLF001
                                    return []
                            except Exception:  # noqa: BLE001
                                return []
                    
                            content = await self._read_file(fs, xtask_main)
                            return _parse_xtask_main(content)
                    
                        def get_run_command(self, task_name: str, *args: str) -> list[str]:
                            """Get the cargo command for a specific task.
                    
                            Args:
                                task_name: Name of the task (alias or xtask:command)
                                *args: Additional arguments
                            """
                            if task_name.startswith("xtask:"):
                                # xtask command
                                cmd = task_name.removeprefix("xtask:")
                                return ["cargo", "xtask", cmd, *args]
                            return ["cargo", task_name, *args]  # Alias
                    

                    detect async

                    detect(fs: AsyncFileSystem, cwd: str) -> bool
                    

                    Check if this task runner is used in the given directory.

                    Source code in src/anyenv/task_runners/_cargo.py
                    async def detect(self, fs: AsyncFileSystem, cwd: str) -> bool:
                        """Check if this task runner is used in the given directory."""
                        # Check for cargo config with aliases
                        for config_name in (".cargo/config.toml", ".cargo/config"):
                            filepath = posixpath.join(cwd, config_name)
                            try:
                                if await fs._isfile(filepath):  # noqa: SLF001
                                    content = await self._read_file(fs, filepath)
                                    if "[alias]" in content:
                                        return True
                            except Exception:  # noqa: BLE001
                                pass
                    
                        xtask_cargo = posixpath.join(cwd, "xtask", "Cargo.toml")  # Check for xtask crate
                        try:
                            if await fs._isfile(xtask_cargo):  # noqa: SLF001
                                return True
                        except Exception:  # noqa: BLE001
                            pass
                    
                        return False
                    

                    get_config_file async

                    get_config_file(fs: AsyncFileSystem, cwd: str) -> str | None
                    

                    Get the cargo config file path if it exists.

                    Source code in src/anyenv/task_runners/_cargo.py
                    async def get_config_file(self, fs: AsyncFileSystem, cwd: str) -> str | None:
                        """Get the cargo config file path if it exists."""
                        for config_name in (".cargo/config.toml", ".cargo/config"):
                            filepath = posixpath.join(cwd, config_name)
                            try:
                                if await fs._isfile(filepath):  # noqa: SLF001
                                    return filepath
                            except Exception:  # noqa: BLE001
                                pass
                        return None
                    

                    get_run_command

                    get_run_command(task_name: str, *args: str) -> list[str]
                    

                    Get the cargo command for a specific task.

                    Parameters:

                    Name Type Description Default
                    task_name str

                    Name of the task (alias or xtask:command)

                    required
                    *args str

                    Additional arguments

                    ()
                    Source code in src/anyenv/task_runners/_cargo.py
                    def get_run_command(self, task_name: str, *args: str) -> list[str]:
                        """Get the cargo command for a specific task.
                    
                        Args:
                            task_name: Name of the task (alias or xtask:command)
                            *args: Additional arguments
                        """
                        if task_name.startswith("xtask:"):
                            # xtask command
                            cmd = task_name.removeprefix("xtask:")
                            return ["cargo", "xtask", cmd, *args]
                        return ["cargo", task_name, *args]  # Alias
                    

                    get_tasks async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse cargo config and xtask to return available tasks.

                    Source code in src/anyenv/task_runners/_cargo.py
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse cargo config and xtask to return available tasks."""
                        tasks: list[TaskInfo] = []
                        # Get aliases from cargo config
                        tasks.extend(await self._get_aliases(fs, cwd))
                        # Get xtask commands
                        tasks.extend(await self._get_xtask_commands(fs, cwd))
                        return sorted(tasks, key=lambda t: t.name)
                    

                    DoitRunner dataclass

                    Bases: TaskRunner

                    Task runner for doit (pydoit.org).

                    Source code in src/anyenv/task_runners/_python.py
                    @dataclass
                    class DoitRunner(TaskRunner):
                        """Task runner for doit (pydoit.org)."""
                    
                        id: ClassVar[Literal["doit"]] = "doit"
                        website: ClassVar[str] = "http://pydoit.org"
                        filenames: ClassVar[list[str]] = ["dodo.py"]
                        help_cmd: ClassVar[list[str]] = ["doit", "list"]
                        logo: ClassVar[str | None] = "https://pydoit.org/_static/doit-logo.png"
                    
                        # Pattern for task_ function definitions
                        _TASK_FUNC_PATTERN: ClassVar[re.Pattern[str]] = re.compile(r"^def\s+(task_\w+)\s*\(")
                    
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse dodo.py and return available tasks."""
                            config_file = await self.get_config_file(fs, cwd)
                            if config_file is None:
                                return []
                    
                            content = await self._read_file(fs, config_file)
                            return self._parse_dodo(content)
                    
                        def _parse_dodo(self, content: str) -> list[TaskInfo]:
                            """Parse dodo.py to extract task_ functions."""
                            try:
                                tree = ast.parse(content)
                            except SyntaxError:
                                return []
                    
                            tasks: list[TaskInfo] = []
                    
                            for node in ast.walk(tree):
                                if not isinstance(node, ast.FunctionDef):
                                    continue
                    
                                # doit tasks are functions named task_*
                                if not node.name.startswith("task_"):
                                    continue
                    
                                # Task name is function name without task_ prefix
                                task_name = node.name[5:]  # Remove "task_" prefix
                    
                                # Extract docstring as description
                                description = ast.get_docstring(node)
                    
                                tasks.append(TaskInfo(name=task_name, description=description))
                    
                            return sorted(tasks, key=lambda t: t.name)
                    
                        def get_run_command(self, task_name: str, *args: str) -> list[str]:
                            """Get the doit command for a specific task."""
                            return ["doit", "run", task_name, *args]
                    

                    get_run_command

                    get_run_command(task_name: str, *args: str) -> list[str]
                    

                    Get the doit command for a specific task.

                    Source code in src/anyenv/task_runners/_python.py
                    def get_run_command(self, task_name: str, *args: str) -> list[str]:
                        """Get the doit command for a specific task."""
                        return ["doit", "run", task_name, *args]
                    

                    get_tasks async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse dodo.py and return available tasks.

                    Source code in src/anyenv/task_runners/_python.py
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse dodo.py and return available tasks."""
                        config_file = await self.get_config_file(fs, cwd)
                        if config_file is None:
                            return []
                    
                        content = await self._read_file(fs, config_file)
                        return self._parse_dodo(content)
                    

                    DutyRunner dataclass

                    Bases: TaskRunner

                    Task runner for Duty (pawamoy/duty).

                    Source code in src/anyenv/task_runners/_python.py
                    @dataclass
                    class DutyRunner(TaskRunner):
                        """Task runner for Duty (pawamoy/duty)."""
                    
                        id: ClassVar[Literal["duty"]] = "duty"
                        website: ClassVar[str] = "https://github.com/pawamoy/duty"
                        filenames: ClassVar[list[str]] = ["duties.py"]
                        help_cmd: ClassVar[list[str]] = ["duty", "--list"]
                        logo: ClassVar[str | None] = None
                    
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse duties.py and return available tasks."""
                            config_file = await self.get_config_file(fs, cwd)
                            if config_file is None:
                                return []
                    
                            content = await self._read_file(fs, config_file)
                            return self._parse_duties(content)
                    
                        def _parse_duties(self, content: str) -> list[TaskInfo]:
                            """Parse duties.py to extract @duty decorated functions."""
                            try:
                                tree = ast.parse(content)
                            except SyntaxError:
                                return []
                    
                            tasks: list[TaskInfo] = []
                    
                            for node in ast.walk(tree):
                                if not isinstance(node, ast.FunctionDef):
                                    continue
                    
                                # Check if function has @duty decorator
                                is_duty = any(
                                    (isinstance(d, ast.Name) and d.id == "duty")
                                    or (
                                        isinstance(d, ast.Call) and isinstance(d.func, ast.Name) and d.func.id == "duty"
                                    )
                                    for d in node.decorator_list
                                )
                    
                                if not is_duty:
                                    continue
                    
                                # Extract docstring as description
                                description = ast.get_docstring(node)
                    
                                tasks.append(TaskInfo(name=node.name, description=description))
                    
                            return sorted(tasks, key=lambda t: t.name)
                    
                        def get_run_command(self, task_name: str, *args: str) -> list[str]:
                            """Get the duty command for a specific task."""
                            return ["duty", task_name, *args]
                    

                    get_run_command

                    get_run_command(task_name: str, *args: str) -> list[str]
                    

                    Get the duty command for a specific task.

                    Source code in src/anyenv/task_runners/_python.py
                    def get_run_command(self, task_name: str, *args: str) -> list[str]:
                        """Get the duty command for a specific task."""
                        return ["duty", task_name, *args]
                    

                    get_tasks async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse duties.py and return available tasks.

                    Source code in src/anyenv/task_runners/_python.py
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse duties.py and return available tasks."""
                        config_file = await self.get_config_file(fs, cwd)
                        if config_file is None:
                            return []
                    
                        content = await self._read_file(fs, config_file)
                        return self._parse_duties(content)
                    

                    InvokeRunner dataclass

                    Bases: TaskRunner

                    Task runner for Invoke (pyinvoke.org).

                    Source code in src/anyenv/task_runners/_python.py
                    @dataclass
                    class InvokeRunner(TaskRunner):
                        """Task runner for Invoke (pyinvoke.org)."""
                    
                        id: ClassVar[Literal["invoke"]] = "invoke"
                        website: ClassVar[str] = "https://www.pyinvoke.org"
                        filenames: ClassVar[list[str]] = [
                            "tasks.py",
                            "invoke.yaml",
                            "invoke.yml",
                            "invoke.json",
                            "invoke.py",
                        ]
                        help_cmd: ClassVar[list[str]] = ["invoke", "--list"]
                        logo: ClassVar[str | None] = None
                    
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse tasks.py and return available tasks."""
                            # Only parse tasks.py, not the config files
                            tasks_file = posixpath.join(cwd, "tasks.py")
                            try:
                                if not await fs._isfile(tasks_file):  # noqa: SLF001
                                    return []
                            except Exception:  # noqa: BLE001
                                return []
                    
                            content = await self._read_file(fs, tasks_file)
                            return self._parse_tasks(content)
                    
                        def _parse_tasks(self, content: str) -> list[TaskInfo]:
                            """Parse tasks.py to extract @task decorated functions."""
                            try:
                                tree = ast.parse(content)
                            except SyntaxError:
                                return []
                    
                            tasks: list[TaskInfo] = []
                    
                            for node in ast.walk(tree):
                                if not isinstance(node, ast.FunctionDef):
                                    continue
                    
                                # Check if function has @task decorator
                                is_task = any(
                                    (isinstance(d, ast.Name) and d.id == "task")
                                    or (
                                        isinstance(d, ast.Call) and isinstance(d.func, ast.Name) and d.func.id == "task"
                                    )
                                    for d in node.decorator_list
                                )
                    
                                if not is_task:
                                    continue
                    
                                # Extract docstring as description
                                description = ast.get_docstring(node)
                    
                                # Convert underscores to hyphens (invoke convention)
                                task_name = node.name.replace("_", "-")
                    
                                tasks.append(TaskInfo(name=task_name, description=description))
                    
                            return sorted(tasks, key=lambda t: t.name)
                    
                        def get_run_command(self, task_name: str, *args: str) -> list[str]:
                            """Get the invoke command for a specific task."""
                            return ["invoke", task_name, *args]
                    

                    get_run_command

                    get_run_command(task_name: str, *args: str) -> list[str]
                    

                    Get the invoke command for a specific task.

                    Source code in src/anyenv/task_runners/_python.py
                    def get_run_command(self, task_name: str, *args: str) -> list[str]:
                        """Get the invoke command for a specific task."""
                        return ["invoke", task_name, *args]
                    

                    get_tasks async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse tasks.py and return available tasks.

                    Source code in src/anyenv/task_runners/_python.py
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse tasks.py and return available tasks."""
                        # Only parse tasks.py, not the config files
                        tasks_file = posixpath.join(cwd, "tasks.py")
                        try:
                            if not await fs._isfile(tasks_file):  # noqa: SLF001
                                return []
                        except Exception:  # noqa: BLE001
                            return []
                    
                        content = await self._read_file(fs, tasks_file)
                        return self._parse_tasks(content)
                    

                    JustRunner dataclass

                    Bases: TaskRunner

                    Task runner for Just (casey/just).

                    Source code in src/anyenv/task_runners/_just.py
                    @dataclass
                    class JustRunner(TaskRunner):
                        """Task runner for Just (casey/just)."""
                    
                        id: ClassVar[Literal["just"]] = "just"
                        website: ClassVar[str] = "https://github.com/casey/just"
                        filenames: ClassVar[list[str]] = ["justfile", "Justfile", ".justfile"]
                        help_cmd: ClassVar[list[str]] = ["just", "--list"]
                        logo: ClassVar[str | None] = None
                    
                        # Pattern for recipe definitions: recipe_name arg1 arg2:
                        _RECIPE_PATTERN: ClassVar[re.Pattern[str]] = re.compile(
                            r"^(@)?([a-zA-Z_][a-zA-Z0-9_-]*)\s*[^:]*:"
                        )
                        # Pattern for comment directly above recipe (used as description)
                        _COMMENT_PATTERN: ClassVar[re.Pattern[str]] = re.compile(r"^#\s*(.*)$")
                        # Pattern for [doc('...')] attribute
                        _DOC_ATTR_PATTERN: ClassVar[re.Pattern[str]] = re.compile(r"^\[doc\(['\"](.+?)['\"]\)\]$")
                    
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse justfile and return available recipes."""
                            config_file = await self.get_config_file(fs, cwd)
                            if config_file is None:
                                return []
                    
                            content = await self._read_file(fs, config_file)
                            return self._parse_justfile(content)
                    
                        def _parse_justfile(self, content: str) -> list[TaskInfo]:
                            """Parse justfile content to extract recipes."""
                            tasks: list[TaskInfo] = []
                            lines = content.splitlines()
                            pending_comment: str | None = None
                            pending_doc: str | None = None
                    
                            for line in lines:
                                stripped = line.rstrip()
                    
                                # Skip empty lines (reset pending comment but keep doc attribute)
                                if not stripped:
                                    pending_comment = None
                                    continue
                    
                                # Check for [doc('...')] attribute
                                if doc_match := self._DOC_ATTR_PATTERN.match(stripped):
                                    pending_doc = doc_match.group(1)
                                    continue
                    
                                # Check for comment (potential description for next recipe)
                                if comment_match := self._COMMENT_PATTERN.match(stripped):
                                    pending_comment = comment_match.group(1).strip()
                                    continue
                    
                                # Check for recipe definition
                                if recipe_match := self._RECIPE_PATTERN.match(stripped):
                                    recipe_name = recipe_match.group(2)
                    
                                    # Skip private recipes (prefixed with _)
                                    if recipe_name.startswith("_"):
                                        pending_comment = None
                                        pending_doc = None
                                        continue
                    
                                    # Doc attribute takes precedence over comment
                                    description = pending_doc or pending_comment
                    
                                    tasks.append(TaskInfo(name=recipe_name, description=description))
                                    pending_comment = None
                                    pending_doc = None
                                    continue
                    
                                # Any other line resets pending comment/doc
                                pending_comment = None
                                pending_doc = None
                    
                            return sorted(tasks, key=lambda t: t.name)
                    
                        def get_run_command(self, task_name: str, *args: str) -> list[str]:
                            """Get the just command for a specific recipe."""
                            return ["just", task_name, *args]
                    

                    get_run_command

                    get_run_command(task_name: str, *args: str) -> list[str]
                    

                    Get the just command for a specific recipe.

                    Source code in src/anyenv/task_runners/_just.py
                    def get_run_command(self, task_name: str, *args: str) -> list[str]:
                        """Get the just command for a specific recipe."""
                        return ["just", task_name, *args]
                    

                    get_tasks async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse justfile and return available recipes.

                    Source code in src/anyenv/task_runners/_just.py
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse justfile and return available recipes."""
                        config_file = await self.get_config_file(fs, cwd)
                        if config_file is None:
                            return []
                    
                        content = await self._read_file(fs, config_file)
                        return self._parse_justfile(content)
                    

                    MakefileRunner dataclass

                    Bases: TaskRunner

                    Task runner for GNU Make.

                    Source code in src/anyenv/task_runners/_makefile.py
                    @dataclass
                    class MakefileRunner(TaskRunner):
                        """Task runner for GNU Make."""
                    
                        id: ClassVar[Literal["makefile"]] = "makefile"
                        website: ClassVar[str] = "https://www.gnu.org/software/make/manual/make.html"
                        filenames: ClassVar[list[str]] = ["Makefile", "makefile", "GNUmakefile"]
                        help_cmd: ClassVar[list[str]] = ["make", "help"]
                        logo: ClassVar[str | None] = (
                            "https://upload.wikimedia.org/wikipedia/commons/thumb/3/39/"
                            "Official_gnu.svg/2048px-Official_gnu.svg.png"
                        )
                    
                        # Pattern for targets with ## comments (common convention)
                        _HELP_PATTERN: ClassVar[re.Pattern[str]] = re.compile(
                            r"^([a-zA-Z_][a-zA-Z0-9_-]*)\s*:.*?##\s*(.*)$"
                        )
                        # Pattern for simple targets (without help text)
                        _TARGET_PATTERN: ClassVar[re.Pattern[str]] = re.compile(r"^([a-zA-Z_][a-zA-Z0-9_-]*)\s*:")
                        # Pattern for .PHONY declarations
                        _PHONY_PATTERN: ClassVar[re.Pattern[str]] = re.compile(r"^\.PHONY\s*:\s*(.+)$")
                    
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse Makefile and return available targets.
                    
                            Extracts targets with optional descriptions from ## comments.
                            Prioritizes .PHONY targets as they represent runnable tasks.
                            """
                            config_file = await self.get_config_file(fs, cwd)
                            if config_file is None:
                                return []
                    
                            content = await self._read_file(fs, config_file)
                            return self._parse_makefile(content)
                    
                        def _parse_makefile(self, content: str) -> list[TaskInfo]:
                            """Parse Makefile content to extract targets."""
                            tasks: dict[str, TaskInfo] = {}
                            phony_targets: set[str] = set()
                    
                            for line in content.splitlines():
                                line = line.rstrip()
                    
                                # Skip empty lines and comments
                                if not line or line.startswith("#"):
                                    continue
                    
                                # Collect .PHONY targets
                                if phony_match := self._PHONY_PATTERN.match(line):
                                    targets = phony_match.group(1).split()
                                    phony_targets.update(targets)
                                    continue
                    
                                # Try to match target with ## help comment first
                                if help_match := self._HELP_PATTERN.match(line):
                                    target, description = help_match.groups()
                                    if not target.startswith("."):
                                        tasks[target] = TaskInfo(name=target, description=description.strip())
                                    continue
                    
                                # Match simple targets
                                if target_match := self._TARGET_PATTERN.match(line):
                                    target = target_match.group(1)
                                    # Skip internal targets (starting with .) and already found ones
                                    if not target.startswith(".") and target not in tasks:
                                        tasks[target] = TaskInfo(name=target)
                    
                            # Sort: .PHONY targets first, then alphabetically
                            def sort_key(item: tuple[str, TaskInfo]) -> tuple[int, str]:
                                name = item[0]
                                return (0 if name in phony_targets else 1, name)
                    
                            return [task for _, task in sorted(tasks.items(), key=sort_key)]
                    
                        def get_run_command(self, task_name: str, *args: str) -> list[str]:
                            """Get the make command for a specific target."""
                            return ["make", task_name, *args]
                    

                    get_run_command

                    get_run_command(task_name: str, *args: str) -> list[str]
                    

                    Get the make command for a specific target.

                    Source code in src/anyenv/task_runners/_makefile.py
                    def get_run_command(self, task_name: str, *args: str) -> list[str]:
                        """Get the make command for a specific target."""
                        return ["make", task_name, *args]
                    

                    get_tasks async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse Makefile and return available targets.

                    Extracts targets with optional descriptions from ## comments. Prioritizes .PHONY targets as they represent runnable tasks.

                    Source code in src/anyenv/task_runners/_makefile.py
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse Makefile and return available targets.
                    
                        Extracts targets with optional descriptions from ## comments.
                        Prioritizes .PHONY targets as they represent runnable tasks.
                        """
                        config_file = await self.get_config_file(fs, cwd)
                        if config_file is None:
                            return []
                    
                        content = await self._read_file(fs, config_file)
                        return self._parse_makefile(content)
                    

                    PackageJsonRunner dataclass

                    Bases: TaskRunner

                    Task runner for package.json scripts.

                    Source code in src/anyenv/task_runners/_npm.py
                    @dataclass
                    class PackageJsonRunner(TaskRunner):
                        """Task runner for package.json scripts."""
                    
                        id: ClassVar[Literal["npm"]] = "npm"
                        website: ClassVar[str] = "https://docs.npmjs.com/cli/v10/using-npm/scripts"
                        filenames: ClassVar[list[str]] = ["package.json"]
                        help_cmd: ClassVar[list[str]] = ["npm", "run"]
                        logo: ClassVar[str | None] = (
                            "https://raw.githubusercontent.com/npm/logos/master/npm%20square/n-64.png"
                        )
                    
                        _detected_manager: PackageManagerStr | None = field(default=None, repr=False)
                    
                        async def detect_package_manager(self, fs: AsyncFileSystem, cwd: str) -> PackageManagerStr:
                            """Detect which package manager to use.
                    
                            Detection order:
                            1. Lock file presence
                            2. packageManager field in package.json
                            3. First available on system
                            4. Default to npm
                            """
                            # Check lock files
                            for lockfile, manager in LOCKFILE_TO_MANAGER.items():
                                filepath = posixpath.join(cwd, lockfile)
                                try:
                                    if await fs._isfile(filepath):  # noqa: SLF001
                                        return manager
                                except Exception:  # noqa: BLE001
                                    pass
                    
                            # Check packageManager field in package.json
                            package_json = posixpath.join(cwd, "package.json")
                            try:
                                if await fs._isfile(package_json):  # noqa: SLF001
                                    content = await self._read_file(fs, package_json)
                                    data = json.loads(content)
                                    if (pm_field := data.get("packageManager")) and (
                                        match := re.match(r"^(npm|pnpm|yarn|bun)", pm_field)
                                    ):
                                        match match.group(1):
                                            case "npm" | "pnpm" | "yarn" | "bun" as manager:
                                                return manager
                            except json.JSONDecodeError, OSError, Exception:  # noqa: BLE001
                                pass
                    
                            # Check what's available on the system (prefer faster ones)
                            for manager in ("bun", "pnpm", "yarn", "npm"):
                                if shutil.which(manager):
                                    return manager
                    
                            return "npm"
                    
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse package.json and return available scripts."""
                            config_file = await self.get_config_file(fs, cwd)
                            if config_file is None:
                                return []
                    
                            content = await self._read_file(fs, config_file)
                            return self._parse_package_json(content)
                    
                        def _parse_package_json(self, content: str) -> list[TaskInfo]:
                            """Parse package.json content to extract scripts."""
                            try:
                                data = json.loads(content)
                            except json.JSONDecodeError:
                                return []
                    
                            scripts = data.get("scripts", {})
                            if not isinstance(scripts, dict):
                                return []
                    
                            tasks: list[TaskInfo] = []
                            for name, command in scripts.items():
                                description = command if isinstance(command, str) else None
                                tasks.append(TaskInfo(name=name, description=description))
                    
                            return sorted(tasks, key=lambda t: t.name)
                    
                        def get_run_command(
                            self,
                            task_name: str,
                            *args: str,
                            package_manager: PackageManagerStr = "npm",
                        ) -> list[str]:
                            """Get the run command for a specific script.
                    
                            Args:
                                task_name: Name of the script to run
                                *args: Additional arguments to pass to the script
                                package_manager: Which package manager to use
                            """
                            base_cmd = MANAGER_RUN_CMD.get(package_manager, ["npm", "run"])
                            cmd = [*base_cmd, task_name]
                            if args:
                                # npm/pnpm/yarn need -- to pass args, bun doesn't
                                if package_manager != "bun":
                                    cmd.append("--")
                                cmd.extend(args)
                            return cmd
                    
                        async def run_task(
                            self,
                            env: ExecutionEnvironment,
                            task_name: str,
                            *args: str,
                            cwd: str | None = None,
                            package_manager: PackageManagerStr | None = None,
                        ) -> tuple[bool, str, str]:
                            """Run a specific script using the execution environment.
                    
                            Args:
                                env: Execution environment to run the command in
                                task_name: Name of the script to run
                                *args: Additional arguments to pass to the script
                                cwd: Working directory (optional)
                                package_manager: Override package manager detection
                            """
                            if package_manager is None:
                                # Need filesystem for detection - get from env
                                fs = env.get_fs()
                                detect_cwd = cwd or "."
                                package_manager = await self.detect_package_manager(fs, detect_cwd)
                    
                            cmd = self.get_run_command(task_name, *args, package_manager=package_manager)
                            command_str = shlex.join(cmd)
                            if cwd:
                                command_str = f"cd {shlex.quote(cwd)} && {command_str}"
                    
                            result = await env.execute_command(command_str)
                            return (
                                result.success,
                                result.stdout or "",
                                result.stderr or result.error or "",
                            )
                    
                        def is_available(self) -> bool:
                            """Check if any supported package manager is available."""
                            return any(shutil.which(pm) for pm in ("npm", "pnpm", "yarn", "bun"))
                    

                    detect_package_manager async

                    detect_package_manager(fs: AsyncFileSystem, cwd: str) -> PackageManagerStr
                    

                    Detect which package manager to use.

                    Detection order: 1. Lock file presence 2. packageManager field in package.json 3. First available on system 4. Default to npm

                    Source code in src/anyenv/task_runners/_npm.py
                    async def detect_package_manager(self, fs: AsyncFileSystem, cwd: str) -> PackageManagerStr:
                        """Detect which package manager to use.
                    
                        Detection order:
                        1. Lock file presence
                        2. packageManager field in package.json
                        3. First available on system
                        4. Default to npm
                        """
                        # Check lock files
                        for lockfile, manager in LOCKFILE_TO_MANAGER.items():
                            filepath = posixpath.join(cwd, lockfile)
                            try:
                                if await fs._isfile(filepath):  # noqa: SLF001
                                    return manager
                            except Exception:  # noqa: BLE001
                                pass
                    
                        # Check packageManager field in package.json
                        package_json = posixpath.join(cwd, "package.json")
                        try:
                            if await fs._isfile(package_json):  # noqa: SLF001
                                content = await self._read_file(fs, package_json)
                                data = json.loads(content)
                                if (pm_field := data.get("packageManager")) and (
                                    match := re.match(r"^(npm|pnpm|yarn|bun)", pm_field)
                                ):
                                    match match.group(1):
                                        case "npm" | "pnpm" | "yarn" | "bun" as manager:
                                            return manager
                        except json.JSONDecodeError, OSError, Exception:  # noqa: BLE001
                            pass
                    
                        # Check what's available on the system (prefer faster ones)
                        for manager in ("bun", "pnpm", "yarn", "npm"):
                            if shutil.which(manager):
                                return manager
                    
                        return "npm"
                    

                    get_run_command

                    get_run_command(
                        task_name: str, *args: str, package_manager: PackageManagerStr = "npm"
                    ) -> list[str]
                    

                    Get the run command for a specific script.

                    Parameters:

                    Name Type Description Default
                    task_name str

                    Name of the script to run

                    required
                    *args str

                    Additional arguments to pass to the script

                    ()
                    package_manager PackageManagerStr

                    Which package manager to use

                    'npm'
                    Source code in src/anyenv/task_runners/_npm.py
                    def get_run_command(
                        self,
                        task_name: str,
                        *args: str,
                        package_manager: PackageManagerStr = "npm",
                    ) -> list[str]:
                        """Get the run command for a specific script.
                    
                        Args:
                            task_name: Name of the script to run
                            *args: Additional arguments to pass to the script
                            package_manager: Which package manager to use
                        """
                        base_cmd = MANAGER_RUN_CMD.get(package_manager, ["npm", "run"])
                        cmd = [*base_cmd, task_name]
                        if args:
                            # npm/pnpm/yarn need -- to pass args, bun doesn't
                            if package_manager != "bun":
                                cmd.append("--")
                            cmd.extend(args)
                        return cmd
                    

                    get_tasks async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse package.json and return available scripts.

                    Source code in src/anyenv/task_runners/_npm.py
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse package.json and return available scripts."""
                        config_file = await self.get_config_file(fs, cwd)
                        if config_file is None:
                            return []
                    
                        content = await self._read_file(fs, config_file)
                        return self._parse_package_json(content)
                    

                    is_available

                    is_available() -> bool
                    

                    Check if any supported package manager is available.

                    Source code in src/anyenv/task_runners/_npm.py
                    def is_available(self) -> bool:
                        """Check if any supported package manager is available."""
                        return any(shutil.which(pm) for pm in ("npm", "pnpm", "yarn", "bun"))
                    

                    run_task async

                    run_task(
                        env: ExecutionEnvironment,
                        task_name: str,
                        *args: str,
                        cwd: str | None = None,
                        package_manager: PackageManagerStr | None = None,
                    ) -> tuple[bool, str, str]
                    

                    Run a specific script using the execution environment.

                    Parameters:

                    Name Type Description Default
                    env ExecutionEnvironment

                    Execution environment to run the command in

                    required
                    task_name str

                    Name of the script to run

                    required
                    *args str

                    Additional arguments to pass to the script

                    ()
                    cwd str | None

                    Working directory (optional)

                    None
                    package_manager PackageManagerStr | None

                    Override package manager detection

                    None
                    Source code in src/anyenv/task_runners/_npm.py
                    async def run_task(
                        self,
                        env: ExecutionEnvironment,
                        task_name: str,
                        *args: str,
                        cwd: str | None = None,
                        package_manager: PackageManagerStr | None = None,
                    ) -> tuple[bool, str, str]:
                        """Run a specific script using the execution environment.
                    
                        Args:
                            env: Execution environment to run the command in
                            task_name: Name of the script to run
                            *args: Additional arguments to pass to the script
                            cwd: Working directory (optional)
                            package_manager: Override package manager detection
                        """
                        if package_manager is None:
                            # Need filesystem for detection - get from env
                            fs = env.get_fs()
                            detect_cwd = cwd or "."
                            package_manager = await self.detect_package_manager(fs, detect_cwd)
                    
                        cmd = self.get_run_command(task_name, *args, package_manager=package_manager)
                        command_str = shlex.join(cmd)
                        if cwd:
                            command_str = f"cd {shlex.quote(cwd)} && {command_str}"
                    
                        result = await env.execute_command(command_str)
                        return (
                            result.success,
                            result.stdout or "",
                            result.stderr or result.error or "",
                        )
                    

                    TaskInfo dataclass

                    Information about a single task/target.

                    Source code in src/anyenv/task_runners/_base.py
                    @dataclass
                    class TaskInfo:
                        """Information about a single task/target."""
                    
                        name: str
                        description: str | None = None
                        dependencies: list[str] = field(default_factory=list)
                    

                    TaskRunner dataclass

                    Base class for task runner configurations.

                    Each task runner implementation provides static metadata and implements methods for detecting, parsing, and running tasks via an ExecutionEnvironment.

                    Source code in src/anyenv/task_runners/_base.py
                    @dataclass
                    class TaskRunner:
                        """Base class for task runner configurations.
                    
                        Each task runner implementation provides static metadata and implements
                        methods for detecting, parsing, and running tasks via an ExecutionEnvironment.
                        """
                    
                        id: ClassVar[TaskRunnerStr]
                        website: ClassVar[str]
                        filenames: ClassVar[list[str]]
                        help_cmd: ClassVar[list[str]]
                        logo: ClassVar[str | None] = None
                    
                        def is_available(self) -> bool:
                            """Check if the task runner command is available locally."""
                            return shutil.which(self.help_cmd[0]) is not None
                    
                        async def detect(self, fs: AsyncFileSystem, cwd: str) -> bool:
                            """Check if this task runner is used in the given directory.
                    
                            Args:
                                fs: Async filesystem to use for file operations
                                cwd: Directory to check for task runner config files
                            """
                            for filename in self.filenames:
                                filepath = posixpath.join(cwd, filename)
                                try:
                                    if await fs._isfile(filepath):  # noqa: SLF001
                                        return True
                                except Exception:  # noqa: BLE001
                                    pass
                            return False
                    
                        async def get_config_file(self, fs: AsyncFileSystem, cwd: str) -> str | None:
                            """Get the config file path if it exists.
                    
                            Args:
                                fs: Async filesystem to use for file operations
                                cwd: Directory to check
                            """
                            for filename in self.filenames:
                                filepath = posixpath.join(cwd, filename)
                                try:
                                    if await fs._isfile(filepath):  # noqa: SLF001
                                        return filepath
                                except Exception:  # noqa: BLE001
                                    pass
                            return None
                    
                        async def _read_file(self, fs: AsyncFileSystem, filepath: str) -> str:
                            """Read file content as text.
                    
                            Args:
                                fs: Async filesystem to use for file operations
                                filepath: Path to the file
                            """
                            content = await fs._cat_file(filepath)  # noqa: SLF001
                            return content.decode() if isinstance(content, bytes) else content
                    
                        @abstractmethod
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse and return available tasks from the config file.
                    
                            Args:
                                fs: Async filesystem to use for file operations
                                cwd: Directory containing the task runner config
                            """
                            ...
                    
                        def get_run_command(self, task_name: str, *args: str) -> list[str]:
                            """Get the command to run a specific task.
                    
                            Args:
                                task_name: Name of the task to run
                                *args: Additional arguments to pass to the task
                            """
                            return [self.help_cmd[0], task_name, *args]
                    
                        async def run_task(
                            self,
                            env: ExecutionEnvironment,
                            task_name: str,
                            *args: str,
                            cwd: str | None = None,
                        ) -> tuple[bool, str, str]:
                            """Run a specific task using the execution environment.
                    
                            Args:
                                env: Execution environment to run the command in
                                task_name: Name of the task to run
                                *args: Additional arguments to pass to the task
                                cwd: Working directory (optional)
                    
                            Returns:
                                Tuple of (success, stdout, stderr)
                            """
                            cmd = self.get_run_command(task_name, *args)
                            command_str = shlex.join(cmd)
                            if cwd:
                                command_str = f"cd {shlex.quote(cwd)} && {command_str}"
                    
                            result = await env.execute_command(command_str)
                            return (
                                result.success,
                                result.stdout or "",
                                result.stderr or result.error or "",
                            )
                    
                        async def list_tasks_via_cli(
                            self,
                            env: ExecutionEnvironment,
                            *,
                            cwd: str | None = None,
                        ) -> str:
                            """Get task list by running the help command.
                    
                            Fallback when file parsing isn't possible (e.g., remote without file access).
                    
                            Args:
                                env: Execution environment to run the command in
                                cwd: Working directory (optional)
                    
                            Returns:
                                Raw output from the help command
                            """
                            command_str = shlex.join(self.help_cmd)
                            if cwd:
                                command_str = f"cd {shlex.quote(cwd)} && {command_str}"
                    
                            result = await env.execute_command(command_str)
                            return result.stdout or ""
                    

                    detect async

                    detect(fs: AsyncFileSystem, cwd: str) -> bool
                    

                    Check if this task runner is used in the given directory.

                    Parameters:

                    Name Type Description Default
                    fs AsyncFileSystem

                    Async filesystem to use for file operations

                    required
                    cwd str

                    Directory to check for task runner config files

                    required
                    Source code in src/anyenv/task_runners/_base.py
                    async def detect(self, fs: AsyncFileSystem, cwd: str) -> bool:
                        """Check if this task runner is used in the given directory.
                    
                        Args:
                            fs: Async filesystem to use for file operations
                            cwd: Directory to check for task runner config files
                        """
                        for filename in self.filenames:
                            filepath = posixpath.join(cwd, filename)
                            try:
                                if await fs._isfile(filepath):  # noqa: SLF001
                                    return True
                            except Exception:  # noqa: BLE001
                                pass
                        return False
                    

                    get_config_file async

                    get_config_file(fs: AsyncFileSystem, cwd: str) -> str | None
                    

                    Get the config file path if it exists.

                    Parameters:

                    Name Type Description Default
                    fs AsyncFileSystem

                    Async filesystem to use for file operations

                    required
                    cwd str

                    Directory to check

                    required
                    Source code in src/anyenv/task_runners/_base.py
                    async def get_config_file(self, fs: AsyncFileSystem, cwd: str) -> str | None:
                        """Get the config file path if it exists.
                    
                        Args:
                            fs: Async filesystem to use for file operations
                            cwd: Directory to check
                        """
                        for filename in self.filenames:
                            filepath = posixpath.join(cwd, filename)
                            try:
                                if await fs._isfile(filepath):  # noqa: SLF001
                                    return filepath
                            except Exception:  # noqa: BLE001
                                pass
                        return None
                    

                    get_run_command

                    get_run_command(task_name: str, *args: str) -> list[str]
                    

                    Get the command to run a specific task.

                    Parameters:

                    Name Type Description Default
                    task_name str

                    Name of the task to run

                    required
                    *args str

                    Additional arguments to pass to the task

                    ()
                    Source code in src/anyenv/task_runners/_base.py
                    def get_run_command(self, task_name: str, *args: str) -> list[str]:
                        """Get the command to run a specific task.
                    
                        Args:
                            task_name: Name of the task to run
                            *args: Additional arguments to pass to the task
                        """
                        return [self.help_cmd[0], task_name, *args]
                    

                    get_tasks abstractmethod async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse and return available tasks from the config file.

                    Parameters:

                    Name Type Description Default
                    fs AsyncFileSystem

                    Async filesystem to use for file operations

                    required
                    cwd str

                    Directory containing the task runner config

                    required
                    Source code in src/anyenv/task_runners/_base.py
                    @abstractmethod
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse and return available tasks from the config file.
                    
                        Args:
                            fs: Async filesystem to use for file operations
                            cwd: Directory containing the task runner config
                        """
                        ...
                    

                    is_available

                    is_available() -> bool
                    

                    Check if the task runner command is available locally.

                    Source code in src/anyenv/task_runners/_base.py
                    def is_available(self) -> bool:
                        """Check if the task runner command is available locally."""
                        return shutil.which(self.help_cmd[0]) is not None
                    

                    list_tasks_via_cli async

                    list_tasks_via_cli(env: ExecutionEnvironment, *, cwd: str | None = None) -> str
                    

                    Get task list by running the help command.

                    Fallback when file parsing isn't possible (e.g., remote without file access).

                    Parameters:

                    Name Type Description Default
                    env ExecutionEnvironment

                    Execution environment to run the command in

                    required
                    cwd str | None

                    Working directory (optional)

                    None

                    Returns:

                    Type Description
                    str

                    Raw output from the help command

                    Source code in src/anyenv/task_runners/_base.py
                    async def list_tasks_via_cli(
                        self,
                        env: ExecutionEnvironment,
                        *,
                        cwd: str | None = None,
                    ) -> str:
                        """Get task list by running the help command.
                    
                        Fallback when file parsing isn't possible (e.g., remote without file access).
                    
                        Args:
                            env: Execution environment to run the command in
                            cwd: Working directory (optional)
                    
                        Returns:
                            Raw output from the help command
                        """
                        command_str = shlex.join(self.help_cmd)
                        if cwd:
                            command_str = f"cd {shlex.quote(cwd)} && {command_str}"
                    
                        result = await env.execute_command(command_str)
                        return result.stdout or ""
                    

                    run_task async

                    run_task(
                        env: ExecutionEnvironment, task_name: str, *args: str, cwd: str | None = None
                    ) -> tuple[bool, str, str]
                    

                    Run a specific task using the execution environment.

                    Parameters:

                    Name Type Description Default
                    env ExecutionEnvironment

                    Execution environment to run the command in

                    required
                    task_name str

                    Name of the task to run

                    required
                    *args str

                    Additional arguments to pass to the task

                    ()
                    cwd str | None

                    Working directory (optional)

                    None

                    Returns:

                    Type Description
                    tuple[bool, str, str]

                    Tuple of (success, stdout, stderr)

                    Source code in src/anyenv/task_runners/_base.py
                    async def run_task(
                        self,
                        env: ExecutionEnvironment,
                        task_name: str,
                        *args: str,
                        cwd: str | None = None,
                    ) -> tuple[bool, str, str]:
                        """Run a specific task using the execution environment.
                    
                        Args:
                            env: Execution environment to run the command in
                            task_name: Name of the task to run
                            *args: Additional arguments to pass to the task
                            cwd: Working directory (optional)
                    
                        Returns:
                            Tuple of (success, stdout, stderr)
                        """
                        cmd = self.get_run_command(task_name, *args)
                        command_str = shlex.join(cmd)
                        if cwd:
                            command_str = f"cd {shlex.quote(cwd)} && {command_str}"
                    
                        result = await env.execute_command(command_str)
                        return (
                            result.success,
                            result.stdout or "",
                            result.stderr or result.error or "",
                        )
                    

                    TaskfileRunner dataclass

                    Bases: TaskRunner

                    Task runner for Taskfile (taskfile.dev).

                    Source code in src/anyenv/task_runners/_task.py
                    @dataclass
                    class TaskfileRunner(TaskRunner):
                        """Task runner for Taskfile (taskfile.dev)."""
                    
                        id: ClassVar[Literal["task"]] = "task"
                        website: ClassVar[str] = "https://taskfile.dev/"
                        filenames: ClassVar[list[str]] = [
                            "Taskfile.yml",
                            "taskfile.yml",
                            "Taskfile.yaml",
                            "taskfile.yaml",
                            "Taskfile.dist.yml",
                            "taskfile.dist.yml",
                            "Taskfile.dist.yaml",
                            "taskfile.dist.yaml",
                        ]
                        help_cmd: ClassVar[list[str]] = ["task", "--list"]
                        logo: ClassVar[str | None] = "https://taskfile.dev/img/logo.svg"
                    
                        async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                            """Parse Taskfile and return available tasks."""
                            config_file = await self.get_config_file(fs, cwd)
                            if config_file is None:
                                return []
                    
                            content = await self._read_file(fs, config_file)
                            return self._parse_taskfile(content)
                    
                        def _parse_taskfile(self, content: str) -> list[TaskInfo]:
                            """Parse Taskfile YAML content to extract tasks."""
                            import yaml
                    
                            try:
                                data = yaml.safe_load(content)
                            except yaml.YAMLError:
                                return []
                    
                            if not isinstance(data, dict):
                                return []
                    
                            tasks_section = data.get("tasks", {})
                            if not isinstance(tasks_section, dict):
                                return []
                    
                            tasks: list[TaskInfo] = []
                            for name, task_def in tasks_section.items():
                                # Skip internal tasks (prefixed with _)
                                if name.startswith("_"):
                                    continue
                    
                                description = None
                                deps: list[str] = []
                    
                                if isinstance(task_def, dict):
                                    description = task_def.get("desc") or task_def.get("summary")
                                    raw_deps = task_def.get("deps", [])
                                    if isinstance(raw_deps, list):
                                        deps = [
                                            d if isinstance(d, str) else d.get("task", "")
                                            for d in raw_deps
                                            if isinstance(d, str | dict)
                                        ]
                    
                                tasks.append(TaskInfo(name=name, description=description, dependencies=deps))
                    
                            return sorted(tasks, key=lambda t: t.name)
                    
                        def get_run_command(self, task_name: str, *args: str) -> list[str]:
                            """Get the task command for a specific task."""
                            return ["task", task_name, *args]
                    

                    get_run_command

                    get_run_command(task_name: str, *args: str) -> list[str]
                    

                    Get the task command for a specific task.

                    Source code in src/anyenv/task_runners/_task.py
                    def get_run_command(self, task_name: str, *args: str) -> list[str]:
                        """Get the task command for a specific task."""
                        return ["task", task_name, *args]
                    

                    get_tasks async

                    get_tasks(fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]
                    

                    Parse Taskfile and return available tasks.

                    Source code in src/anyenv/task_runners/_task.py
                    async def get_tasks(self, fs: AsyncFileSystem, cwd: str) -> list[TaskInfo]:
                        """Parse Taskfile and return available tasks."""
                        config_file = await self.get_config_file(fs, cwd)
                        if config_file is None:
                            return []
                    
                        content = await self._read_file(fs, config_file)
                        return self._parse_taskfile(content)
                    

                    get_runner

                    get_runner(runner_id: TaskRunnerStr) -> TaskRunner
                    

                    Get a task runner by ID.

                    Parameters:

                    Name Type Description Default
                    runner_id TaskRunnerStr

                    The task runner identifier

                    required

                    Raises:

                    Type Description
                    KeyError

                    If the runner ID is not found

                    Source code in src/anyenv/task_runners/__init__.py
                    def get_runner(runner_id: TaskRunnerStr) -> TaskRunner:
                        """Get a task runner by ID.
                    
                        Args:
                            runner_id: The task runner identifier
                    
                        Raises:
                            KeyError: If the runner ID is not found
                        """
                        return RUNNERS_BY_ID[runner_id]