Skip to content

feat: Enable Environment Variable Support and Dynamic Model Selection#614

Open
philipz wants to merge 1 commit into
mattpocock:mainfrom
philipz:main
Open

feat: Enable Environment Variable Support and Dynamic Model Selection#614
philipz wants to merge 1 commit into
mattpocock:mainfrom
philipz:main

Conversation

@philipz
Copy link
Copy Markdown

@philipz philipz commented May 9, 2026

Description:
This Pull Request introduces robust environment variable management to the project using the dotenv library. These changes enhance the project's security and flexibility by allowing sensitive configurations, such as API keys and model selection, to be managed via a .env file rather than being hardcoded in source scripts.

Key Changes:
dotenv Integration: Added dotenv as a project dependency and integrated it into all main entry points (e.g., src/templates//main.mts, .sandcastle/.ts). The configuration is set to load variables specifically from .sandcastle/.env.
Dynamic Model Selection: Refactored orchestration scripts to use process.env.ANTHROPIC_MODEL for agent definition. Existing model names (like claude-opus-4-6) are preserved as default fallbacks to ensure backward compatibility.
Environment Template: Added .sandcastle/.env.example to provide a clear template for required variables, including ANTHROPIC_API_KEY, GH_TOKEN, and ANTHROPIC_MODEL.

Enhanced Security for Tests:
Updated test-vercel.ts to utilize process.env.VERCEL_OIDC_TOKEN for secure Vercel OIDC authentication.
Standardized all test utility scripts to honor environment-based configurations.
Unified Template Updates: Applied these changes consistently across all available templates (blank, parallel-planner, sequential-reviewer, etc.) for a cohesive developer experience.

Rationale:
Adopting environment variables aligns the project with 12-factor app best practices, making the codebase more portable across different development environments and CI/CD pipelines. It also empowers users to easily experiment with different LLM models by simply updating their local configuration without modifying the underlying orchestration logic.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

@philipz is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant