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
fix: switch aider module to use coder_env instead of inline environment variables
- Replace inline 'export API_KEY=' statements with coder_env resource
- Add coder_env resource to set AI provider API keys as environment variables
- Update README to document the new environment variable handling
- Update tests to reflect the new behavior
- Resolves issue #128
The aider module now properly uses the coder_env resource to set environment
variables instead of exporting them inline in shell commands. This reduces
cognitive load for users and follows Terraform best practices.
@@ -254,6 +255,23 @@ This is your current task: [task_prompt]
254
255
255
256
If you want to disable task reporting, set `experiment_report_tasks = false` in your module configuration.
256
257
258
+
## Environment Variables
259
+
260
+
The module automatically sets the appropriate environment variable for your selected AI provider using the `coder_env` resource:
261
+
262
+
| Provider | Environment Variable |
263
+
| ------------- | ----------------------- |
264
+
|**anthropic**|`ANTHROPIC_API_KEY`|
265
+
|**openai**|`OPENAI_API_KEY`|
266
+
|**azure**|`AZURE_OPENAI_API_KEY`|
267
+
|**google**|`GOOGLE_API_KEY`|
268
+
|**cohere**|`COHERE_API_KEY`|
269
+
|**mistral**|`MISTRAL_API_KEY`|
270
+
|**ollama**|`OLLAMA_HOST`|
271
+
|**custom**| Your custom variable |
272
+
273
+
The API key is securely set as an environment variable and will be available to Aider when it runs.
274
+
257
275
## Using Aider in Your Workspace
258
276
259
277
After the workspace starts, Aider will be installed and configured according to your parameters. A persistent session will automatically be started during workspace creation.
@@ -309,7 +327,3 @@ If you encounter issues:
309
327
3.**Browser mode issues**: If the browser interface doesn't open, check that you're accessing it from a machine that can reach your Coder workspace
310
328
311
329
For more information on using Aider, see the [Aider documentation](https://aider.chat/docs/).
0 commit comments