Summary
Support a global .env file in the AgentBox directory (e.g., ~/.agentbox/.env) that loads before project-specific .env files.
Use Case
Configure custom API endpoints and keys for 3rd party inference providers (e.g., non-Anthropic inference services) without needing to set credentials per-project.
Current Behavior
- Only
PROJECT_DIR/.env is loaded
- Global configuration (API keys, custom endpoints, etc.) must be set per-project or via Claude auth volume
- Using 3rd party inference requires configuring
ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY in each project
Proposed Change
- Load
SCRIPT_DIR/.env first (e.g., ~/.agentbox/.env)
- Then load
PROJECT_DIR/.env if it exists
- Project env vars override global ones (Docker env-file behavior: last wins)
Security Considerations
- Low risk: Consistent with existing credential sharing via Claude auth volume
- Credential concentration: API keys shared across projects (already true for Claude auth)
- Override behavior: Project
.env takes precedence (correct behavior)
- Mitigation: Add
~/.agentbox/.env to .gitignore
Rationale
Aligns with AgentBox's simplicity philosophy - provides convenient global configuration for 3rd party inference without prompts or complex setup.
🤖 Generated by Claude Code - GLM 4.7
Summary
Support a global
.envfile in the AgentBox directory (e.g.,~/.agentbox/.env) that loads before project-specific.envfiles.Use Case
Configure custom API endpoints and keys for 3rd party inference providers (e.g., non-Anthropic inference services) without needing to set credentials per-project.
Current Behavior
PROJECT_DIR/.envis loadedANTHROPIC_BASE_URLandANTHROPIC_API_KEYin each projectProposed Change
SCRIPT_DIR/.envfirst (e.g.,~/.agentbox/.env)PROJECT_DIR/.envif it existsSecurity Considerations
.envtakes precedence (correct behavior)~/.agentbox/.envto.gitignoreRationale
Aligns with AgentBox's simplicity philosophy - provides convenient global configuration for 3rd party inference without prompts or complex setup.
🤖 Generated by Claude Code - GLM 4.7