Files
crewAI/lib
alex-clawd 59aa5b2243 fix: add tool repository credentials to crewai install (#5224)
* fix: add tool repository credentials to crewai install

crewai install (uv sync) was failing with 401 Unauthorized when the
project depends on tools from a private package index (e.g. AMP tool
repository). The credentials were already injected for 'crewai run'
and 'crewai tool publish' but were missing from 'crewai install'.

Reads [tool.uv.sources] from pyproject.toml and injects UV_INDEX_*
credentials into the subprocess environment, matching the pattern
already used in run_crew.py.

* refactor: extract duplicated credential-building into utility function

Create build_env_with_all_tool_credentials() in utils.py to consolidate
the ~10-line block that reads [tool.uv.sources] from pyproject.toml and
calls build_env_with_tool_repository_credentials for each index.

This eliminates code duplication across install_crew.py, run_crew.py,
and cli.py, reducing the risk of inconsistent bug fixes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: add debug logging for credential errors instead of silent swallow

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-02 17:56:36 -03:00
..
2026-04-02 22:16:05 +08:00