BerriAI/litellm · error · AgentRunError

Could not find ` ` on your PATH.

Error message

Could not find `{command[0]}` on your PATH.{hint}

What it means

Raised by the CLI agent-launch pre-flight when shutil.which() cannot locate command[0] — the agent's executable binary is not on the user's PATH (common when the agent package isn't installed or the venv isn't activated). A hint (e.g. install instructions) is appended; the launcher refuses to hand off to a nonexistent binary.

Solutions

  1. Install the missing command and ensure it is on your PATH.
  2. Use an absolute path to the executable.

Example fix

which <command> to verify it is on PATH.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/client/cli/commands/agents.py:284 when the library encounters an invalid state.

Common situations: The requested executable was not found on PATH.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/2b6ff81b3a005ef2. Report an issue: GitHub.

Appendix: source

Thrown at litellm/proxy/client/cli/commands/agents.py:284

    launcher: Callable[[str, Sequence[str], Mapping[str, str]], None] = _hand_off,
    reattach_terminal: Callable[[], None] | None = None,
) -> None:
    """Validate, wire the environment, and hand off to the agent.

    On success this never returns: POSIX replaces the current process, Windows
    waits on the agent and exits with its status. Raises AgentRunError for
    missing binaries, an unreachable proxy, or a rejected key.
    reattach_terminal, when given, runs just before handoff to restore stdin.
    """
    if not command:
        raise AgentRunError("Nothing to run.")

    _, profiles = agent_profile(command[0])
    binary: Final = which(command[0])
    if binary is None:
        docs: Final = _INSTALL_DOCS.get(os.path.basename(command[0]))
        hint: Final = f" Install it first: {docs}" if docs else ""
        raise AgentRunError(f"Could not find `{command[0]}` on your PATH.{hint}")

    if not skip_verify:
        verify(base_url, api_key)

    env: Final = build_agent_env(
        base_env if base_env is not None else os.environ,
        base_url,
        api_key,
        profiles,
    )
    extra_args: Final = agent_launch_args(command[0], base_url)
    if reattach_terminal is not None:
        reattach_terminal()
    launcher(binary, [command[0], *extra_args, *command[1:]], env)


def _is_interactive() -> bool:
    return sys.stdin.isatty()

View on GitHub (pinned to 77b7c6c40c)