Summary
When using ${ANTHROPIC_API_KEY} syntax in agent-compose.yml env section, the CLI fails to read the shell environment variable and reports "environment variable ANTHROPIC_API_KEY is required", even when the variable is properly set in the shell.
Steps to reproduce
Set environment variable: export ANTHROPIC_API_KEY="sk-ant-xxx"
Create agent-compose.yml with env section:
agents:
claude-agent:
provider: claude
env:
ANTHROPIC_API_KEY: "${ANTHROPIC_API_KEY}"
Run ./agent-compose up
Observe error: validate compose field agents.claude-agent.env.ANTHROPIC_API_KEY.value: environment variable ANTHROPIC_API_KEY is required
Expected behavior
The CLI should correctly interpolate ${ANTHROPIC_API_KEY} from the shell environment variable and apply the configuration successfully.
Actual behavior
CLI reports environment variable is required, even though it's set in the shell:
/root/agent-compose-v2606.1.0-linux-amd64/agent-compose.yml: validate compose field agents.claude-agent.env.ANTHROPIC_API_KEY.value: environment variable ANTHROPIC_API_KEY is required
Workaround: Write the value directly in YAML instead of using ${} syntax.
Version or commit
No response
Runtime driver
None
Logs
Summary
When using ${ANTHROPIC_API_KEY} syntax in agent-compose.yml env section, the CLI fails to read the shell environment variable and reports "environment variable ANTHROPIC_API_KEY is required", even when the variable is properly set in the shell.
Steps to reproduce
Set environment variable: export ANTHROPIC_API_KEY="sk-ant-xxx"
Create agent-compose.yml with env section:
agents:
claude-agent:
provider: claude
env:
ANTHROPIC_API_KEY: "${ANTHROPIC_API_KEY}"
Run ./agent-compose up
Observe error: validate compose field agents.claude-agent.env.ANTHROPIC_API_KEY.value: environment variable ANTHROPIC_API_KEY is required
Expected behavior
The CLI should correctly interpolate ${ANTHROPIC_API_KEY} from the shell environment variable and apply the configuration successfully.
Actual behavior
CLI reports environment variable is required, even though it's set in the shell:
/root/agent-compose-v2606.1.0-linux-amd64/agent-compose.yml: validate compose field agents.claude-agent.env.ANTHROPIC_API_KEY.value: environment variable ANTHROPIC_API_KEY is required
Workaround: Write the value directly in YAML instead of using ${} syntax.
Version or commit
No response
Runtime driver
None
Logs