chore: env path refactor (#3691)

Co-authored-by: Suchintan <suchintan@users.noreply.github.com>
Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
greg niemeyer
2025-10-12 10:36:24 -07:00
committed by GitHub
parent 9b2bbda3c8
commit cf9e1c2552
11 changed files with 101 additions and 76 deletions

View File

@@ -11,6 +11,7 @@ from rich.panel import Panel
from skyvern.client import Skyvern
from skyvern.config import settings
from skyvern.utils.env_paths import resolve_backend_env_path
from .console import console
from .tasks import _list_workflow_tasks
@@ -34,8 +35,7 @@ def workflow_callback(
def _get_client(api_key: str | None = None) -> Skyvern:
"""Instantiate a Skyvern SDK client using environment variables."""
load_dotenv()
load_dotenv(".env")
load_dotenv(resolve_backend_env_path())
key = api_key or os.getenv("SKYVERN_API_KEY") or settings.SKYVERN_API_KEY
return Skyvern(base_url=settings.SKYVERN_BASE_URL, api_key=key)