{"record":{"id":"90902deb48bab38e","repo":"headroomlabs-ai/headroom","slug":"error-aider-not-found-in-path","errorCode":null,"errorMessage":"Error: 'aider' not found in PATH.","messagePattern":"Error: 'aider' not found in PATH\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"headroom/cli/wrap.py","lineNumber":6037,"sourceCode":"\n    \\b\n    Sets OPENAI_API_BASE to route all API calls through Headroom.\n\n    \\b\n    Examples:\n        headroom wrap aider                              # Start proxy + aider\n        headroom wrap aider -- --model gpt-4o            # Use GPT-4o\n        headroom wrap aider -- --model claude-sonnet-4   # Use Claude\n        headroom wrap aider --backend litellm-vertex --region us-central1\n    \"\"\"\n    if prepare_only:\n        return\n\n    aider_bin = shutil.which(\"aider\")\n    if not aider_bin:\n        click.echo(\"Error: 'aider' not found in PATH.\")\n        click.echo(\"Install aider: pip install aider-chat\")\n        raise SystemExit(1)\n\n    env, env_vars_display = _build_aider_launch_env(\n        port, os.environ, project=_project_name_from_cwd()\n    )\n\n    _launch_tool(\n        binary=aider_bin,\n        args=aider_args,\n        env=env,\n        port=port,\n        no_proxy=no_proxy,\n        tool_label=\"AIDER\",\n        env_vars_display=env_vars_display,\n        learn=learn,\n        memory=memory,\n        agent_type=\"aider\",\n        code_graph=code_graph,\n        backend=backend,","sourceCodeStart":6019,"sourceCodeEnd":6055,"githubUrl":"https://github.com/headroomlabs-ai/headroom/blob/322425c43bffde1ed0b64fecf3cf5951565dd82b/headroom/cli/wrap.py#L6019-L6055","documentation":"Before wrapping aider, Headroom resolves the `aider` binary with shutil.which('aider'). If missing, it prints this error, suggests `pip install aider-chat`, and raises SystemExit(1) before building the launch environment (_build_aider_launch_env) or starting the proxy. Guarded by the prepare_only early return.","triggerScenarios":"Running `headroom wrap aider` (without --prepare-only) on a machine where aider is not installed or its install location (often a Python user-scripts dir like ~/.local/bin or a venv bin) is not on the current shell's PATH.","commonSituations":"aider installed inside a virtualenv that isn't activated; pip user installs landing in ~/.local/bin which is missing from PATH on minimal shell setups; aider installed via the newer `aider-install`/uv tool path with a different bin location; CI images without aider.","solutions":["Install aider: pip install aider-chat (or `python -m pip install aider-chat` for the right interpreter)","If using a venv, activate it before running: source .venv/bin/activate && headroom wrap aider","Ensure the scripts dir is on PATH: export PATH=\"$HOME/.local/bin:$PATH\"","Verify with `which aider && aider --version` in the same shell"],"exampleFix":"# before\nheadroom wrap aider\n# Error: 'aider' not found in PATH.\n\n# after\npip install aider-chat\nexport PATH=\"$HOME/.local/bin:$PATH\"\nheadroom wrap aider -- --model gpt-4o","handlingStrategy":"type-guard","validationCode":"import shutil\n\nif not shutil.which(\"aider\"):\n    raise SystemExit(\"Install aider first: pip install aider-chat\")","typeGuard":"import shutil\n\ndef aider_available() -> bool:\n    \"\"\"True when the aider binary is resolvable on PATH.\"\"\"\n    return shutil.which(\"aider\") is not None","tryCatchPattern":null,"preventionTips":["Activate the venv where aider is installed before wrapping","Add ~/.local/bin to PATH for pip user installs","Check `which aider` in the launching shell, not a different terminal"],"tags":["path","installation","aider","python","cli","headroom"],"backgroundTag":null,"analyzedSha":"322425c43bffde1ed0b64fecf3cf5951565dd82b","analyzedAt":"2026-08-15T01:03:05.481Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}