Skip to content

Conversation

@bankyadam
Copy link
Member

Users expect ANTHROPIC_API_KEY from .env in project root to be used when running weft commands from subdirectories. Previously, load_dotenv() only looked in the current working directory.

Changes:

  • Updated main.py to find project root and load .env from there
  • Falls back to current directory if project root not found
  • Maintains backward compatibility with non-weft projects

Users expect ANTHROPIC_API_KEY from .env in project root to be used
when running weft commands from subdirectories. Previously, load_dotenv()
only looked in the current working directory.

Changes:
- Updated main.py to find project root and load .env from there
- Falls back to current directory if project root not found
- Maintains backward compatibility with non-weft projects
@bankyadam bankyadam merged commit 18c90bc into main Jan 12, 2026
4 checks passed
@bankyadam bankyadam deleted the fix/env-file-loading-from-project-root branch January 14, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants