From 47138e08a2798f469635b1f03e9ade045978f5a0 Mon Sep 17 00:00:00 2001 From: Hisku Date: Thu, 9 Jul 2026 15:43:53 +0100 Subject: [PATCH] Load .env at CLI startup Wallbreaker shipped .env.example but never called load_dotenv, so API keys placed in .env were ignored and had to be exported into the shell. Call it once in main() and declare python-dotenv as an explicit dependency rather than relying on it transitively. Co-Authored-By: Claude Opus 4.8 (1M context) --- pyproject.toml | 1 + wallbreaker/cli.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 6940172..7967d0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ dependencies = [ "textual>=0.79", "rich>=13.7", "mcp>=1.0", + "python-dotenv>=1.0", ] [project.urls] diff --git a/wallbreaker/cli.py b/wallbreaker/cli.py index e6ddf88..f16583b 100644 --- a/wallbreaker/cli.py +++ b/wallbreaker/cli.py @@ -4,6 +4,8 @@ import asyncio import sys +from dotenv import load_dotenv + from .config import Config, ConfigError, Endpoint, load_config from .providers.base import ProviderError @@ -240,6 +242,7 @@ def emit(text: str) -> None: def main(argv: list[str] | None = None) -> int: + load_dotenv() raw = list(sys.argv[1:] if argv is None else argv) first_pos = next((a for a in raw if not a.startswith("-")), None)