{"record":{"id":"11f3f82b4771817a","repo":"zylon-ai/private-gpt","slug":"binary-not-found-in-path-binary-r","errorCode":null,"errorMessage":"Binary not found in PATH: {binary!r}","messagePattern":"Binary not found in PATH: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"private_gpt/cli/commands/run.py","lineNumber":305,"sourceCode":"        False, \"--auto-approve\", help=\"Skip confirmations (CI mode)\"\n    ),\n    no_server: bool = typer.Option(\n        False, \"--no-server\", help=\"Skip server detection and auto-start entirely\"\n    ),\n) -> None:\n    \"\"\"Launch a connected app (claude-code, openclaw, custom).\n\n    Pass extra arguments to the app after --:\n\n        private-gpt run claude-code -- --resume abc123\n    \"\"\"\n    extra_args: list[str] = ctx.args\n\n    binary = _APP_BINARIES.get(app_name, app_name)\n    resolved = shutil.which(binary)\n    if resolved is None:\n        typer.echo(f\"Binary not found in PATH: {binary!r}\", err=True)\n        raise SystemExit(1)\n\n    base_url = _base_url()\n    server_proc: subprocess.Popen[bytes] | None = None\n\n    if not no_server and not _is_server_up(base_url):\n        typer.echo(\"Server not reachable, starting automatically...\")\n        server_proc = _start_server_subprocess()\n        if not _wait_for_server(base_url):\n            server_proc.terminate()\n            typer.echo(\n                f\"Server did not become ready within {_HEALTH_TIMEOUT}s\", err=True\n            )\n            raise SystemExit(1)\n        typer.echo(\"Server is ready.\")\n\n    match app_name:\n        case \"opencode\":\n            _inject_opencode_env(model)","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/cli/commands/run.py#L287-L323","documentation":"CLI error from `private-gpt run <app>` (private_gpt/cli/commands/run.py). The command resolves the app binary — a known name from _APP_BINARIES or the literal argument — via shutil.which; if the executable is not on PATH, it prints 'Binary not found in PATH: <name>' to stderr and exits with code 1 before starting any server.","triggerScenarios":"Running `private-gpt run claude-code` without the claude-code CLI installed/on PATH; `private-gpt run opencode` without opencode installed; `private-gpt run my-custom-tool` where my-custom-tool is neither in _APP_BINARIES nor an executable on PATH.","commonSituations":"New machine or container without the companion CLI installed; nvm/pyenv/conda environments that shadow PATH; running inside Docker where the app image only contains private-gpt; typos in the custom binary name.","solutions":["Install the target CLI (e.g. `npm install -g @anthropic-ai/claude-code` for claude-code) and confirm with `which <binary>`.","If the binary exists but is not found, fix PATH (export PATH=\"$HOME/.local/bin:$PATH\") or use an absolute path as the app name.","For custom apps, pass the exact executable name: `private-gpt run ./node_modules/.bin/mytool`.","Verify the server side separately with `private-gpt run <app> --no-server` once the binary resolves."],"exampleFix":"// before\n$ private-gpt run claude-code\nBinary not found in PATH: 'claude-code'\n\n// after\n$ npm install -g @anthropic-ai/claude-code\n$ which claude-code && private-gpt run claude-code","handlingStrategy":"validation","validationCode":"import shutil, sys\n\nbinary = \"claude-code\"  # target app binary\nif shutil.which(binary) is None:\n    sys.exit(f\"Install {binary} first; not found in PATH\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install companion CLIs before `private-gpt run`.","Verify with `which <binary>` in the same shell/environment you run from.","Use absolute paths for custom binaries.","Document required CLIs per environment (Dockerfile, CI)."],"tags":["cli","environment","path","exit-code"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}