fix(dogfood/coder): fix env var for exp mcp configure claude-code (#19404)

`coder exp mcp configure claude-code` will read the API key for
claude-code from the environment variable `CLAUDE_API_KEY`. Claude will
also happily read `ANTHROPIC_API_KEY` but will ask you to confirm first,
which is problematic in an automated setup.

Also bumps claude-code module.
This commit is contained in:
Cian Johnston
2025-08-19 09:40:49 +01:00
committed by GitHub
parent 5e4aa79a9d
commit f085c37af3
+4 -3
View File
@@ -399,7 +399,7 @@ module "devcontainers-cli" {
module "claude-code" {
count = local.has_ai_prompt ? data.coder_workspace.me.start_count : 0
source = "dev.registry.coder.com/coder/claude-code/coder"
version = "~>2.0"
version = "2.0.7"
agent_id = coder_agent.dev.id
folder = local.repo_dir
install_claude_code = true
@@ -810,10 +810,11 @@ resource "coder_env" "claude_task_prompt" {
value = data.coder_parameter.ai_prompt.value
}
resource "coder_env" "anthropic_api_key" {
# coder exp mcp configure claude-code reads from CLAUDE_API_KEY
resource "coder_env" "claude_api_key" {
count = local.has_ai_prompt ? data.coder_workspace.me.start_count : 0
agent_id = coder_agent.dev.id
name = "ANTHROPIC_API_KEY"
name = "CLAUDE_API_KEY"
value = var.anthropic_api_key
}