You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
# Rename to `anthropic_oauth_token` if using the Oauth Token
94
112
variable "anthropic_api_key" {
95
113
type = string
96
114
description = "Generate one at: https://console.anthropic.com/settings/keys"
97
115
sensitive = true
98
116
}
99
-
100
-
resource "coder_env" "anthropic_api_key" {
101
-
agent_id = coder_agent.main.id
102
-
name = "CODER_MCP_CLAUDE_API_KEY"
103
-
value = var.anthropic_api_key
104
-
}
105
117
```
106
118
107
119
Let's break down this snippet:
108
120
109
121
- The`module "claude-code"` sets up the Task template to use Claude Code, but Coder's Registry supports many other agent modules like[OpenAI's Codex](https://registry.coder.com/modules/coder-labs/codex) or[Gemini CLI](https://registry.coder.com/modules/coder-labs/gemini)
110
-
- Each module defines its own specific inputs. Claude Code expects the`CODER_MCP_CLAUDE_API_KEY` environment variable to exist, but OpenAI based agents expect`OPENAI_API_KEY` for example. You'll want to check the specific module's defined variables to know what exactly needs to be defined
111
-
- You can define specific scripts to runat startup of the Task. For example, you could define a setup script that calls to AWS S3 and pulls specific files you want your agent to have access to
122
+
- Each module defines its own specific inputs. Claude Code expects the`claude_api_key` input, but OpenAI based agents expect`OPENAI_API_KEY` for example. You'll want to check the specific module's defined variables to know what exactly needs to be defined
123
+
- You can define specific scripts to runbefore the module is installed,`pre_install_script`, or after install,`pre_install_script`. For example, you could define a setup script that calls to AWS S3 and pulls specific files you want your agent to have access to