fix(cli): restore parity with main

This commit is contained in:
Greyson Lalonde
2026-05-05 04:35:26 +08:00
parent 778130cfc7
commit 48fa7dcc9b
9 changed files with 40 additions and 19 deletions

View File

@@ -22,10 +22,9 @@ class PlusAPI:
EPHEMERAL_TRACING_RESOURCE = "/crewai_plus/api/v1/tracing/ephemeral"
INTEGRATIONS_RESOURCE = "/crewai_plus/api/v1/integrations"
def __init__(self, api_key: str) -> None:
def __init__(self, api_key: str | None = None) -> None:
self.api_key = api_key
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
"User-Agent": f"CrewAI-CLI/{get_crewai_version()}",
"X-Crewai-Version": get_crewai_version(),
@@ -34,6 +33,9 @@ class PlusAPI:
if settings.org_uuid:
self.headers["X-Crewai-Organization-Id"] = settings.org_uuid
if api_key:
self.headers["Authorization"] = f"Bearer {api_key}"
self.base_url = (
os.getenv("CREWAI_PLUS_URL")
or str(settings.enterprise_base_url)