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
{{ message }}
This repository was archived by the owner on May 15, 2025. It is now read-only.
-**Optional Dependencies**: Install Playwright for web page scraping and PortAudio for voice coding
28
28
-**Project Integration**: Works with any project directory, including Git repositories
29
29
-**Browser UI**: Use Aider in your browser with a modern web interface instead of the terminal
30
+
-**Non-Interactive Mode**: Automatically processes tasks when provided via the `CODER_MCP_AIDER_TASK_PROMPT` environment variable
30
31
31
32
## Module Parameters
32
33
@@ -66,7 +67,18 @@ This basic setup will:
66
67
- Create a persistent screen session named "aider"
67
68
- Enable task reporting (configures Aider to report tasks to Coder MCP)
68
69
69
-
To fully utilize the task reporting feature, you'll need to add the Coder Login module and configure environment variables as shown in the Task Reporting section below.
70
+
### With tmux instead of screen
71
+
72
+
```tf
73
+
module "aider" {
74
+
count = data.coder_workspace.me.start_count
75
+
source = "registry.coder.com/modules/aider/coder"
76
+
version = "1.0.0"
77
+
agent_id = coder_agent.example.id
78
+
folder = "/home/coder"
79
+
use_tmux = true
80
+
}
81
+
```
70
82
71
83
### With API key via environment variables
72
84
@@ -109,7 +121,9 @@ module "aider" {
109
121
}
110
122
```
111
123
112
-
### With tmux instead of screen
124
+
### Adding Custom Extensions (Experimental)
125
+
126
+
You can extend Aider's capabilities by adding custom extensions:
113
127
114
128
```tf
115
129
module "aider" {
@@ -118,11 +132,28 @@ module "aider" {
118
132
version = "1.0.0"
119
133
agent_id = coder_agent.example.id
120
134
folder = "/home/coder"
121
-
use_tmux = true
135
+
136
+
experiment_pre_install_script = <<-EOT
137
+
pip install some-custom-dependency
138
+
EOT
139
+
140
+
experiment_additional_extensions = <<-EOT
141
+
custom-extension:
142
+
args: []
143
+
cmd: custom-extension-command
144
+
description: A custom extension for Aider
145
+
enabled: true
146
+
envs: {}
147
+
name: custom-extension
148
+
timeout: 300
149
+
type: stdio
150
+
EOT
122
151
}
123
152
```
124
153
125
-
### With task reporting and initial prompt (Experimental)
154
+
Note: The indentation in the heredoc is preserved, so you can write the YAML naturally.
155
+
156
+
## Task Reporting (Experimental)
126
157
127
158
> This functionality is in early access as of Coder v2.21 and is still evolving.
128
159
> For now, we recommend testing it in a demo or staging environment,
@@ -135,6 +166,22 @@ module "aider" {
135
166
136
167
Your workspace must have either `screen` or `tmux` installed to use this.
137
168
169
+
Task reporting is **enabled by default** in this module, allowing you to:
170
+
171
+
- Send an initial prompt to Aider during workspace creation
172
+
- Monitor task progress in the Coder UI
173
+
- Use the `coder_parameter` resource to collect prompts from users
174
+
175
+
### Setting up Task Reporting
176
+
177
+
To use task reporting effectively:
178
+
179
+
1. Add the Coder Login module to your template
180
+
2. Configure the necessary environment variables to pass the task prompt and status slug
181
+
3. Optionally add a coder_parameter to collect prompts from users
182
+
183
+
Here's a complete example:
184
+
138
185
```tf
139
186
module "coder-login" {
140
187
count = data.coder_workspace.me.start_count
@@ -164,7 +211,7 @@ data "coder_parameter" "ai_prompt" {
164
211
ephemeral = true
165
212
}
166
213
167
-
# Set API key and model using coder_env resource
214
+
# Configure environment variables for API key, model and task prompt
168
215
resource "coder_env" "anthropic" {
169
216
agent_id = coder_agent.example.id
170
217
name = "ANTHROPIC_API_KEY"
@@ -198,68 +245,29 @@ module "aider" {
198
245
}
199
246
```
200
247
201
-
This example provides the full configuration needed to use task reporting with an initial AI prompt. The Aider module has task reporting enabled by default, so you only need to add the Coder Login module and configure the necessary environment variables.
202
-
203
-
### Adding Custom Extensions (Experimental)
204
-
205
-
You can extend Aider's capabilities by adding custom extensions. For example, to add a custom extension:
206
-
207
-
```tf
208
-
module "aider" {
209
-
count = data.coder_workspace.me.start_count
210
-
source = "registry.coder.com/modules/aider/coder"
211
-
version = "1.0.0"
212
-
agent_id = coder_agent.example.id
213
-
folder = "/home/coder"
214
-
215
-
experiment_report_tasks = true
216
-
217
-
experiment_pre_install_script = <<-EOT
218
-
pip install some-custom-dependency
219
-
EOT
220
-
221
-
experiment_additional_extensions = <<-EOT
222
-
custom-extension:
223
-
args: []
224
-
cmd: custom-extension-command
225
-
description: A custom extension for Aider
226
-
enabled: true
227
-
envs: {}
228
-
name: custom-extension
229
-
timeout: 300
230
-
type: stdio
231
-
EOT
232
-
}
233
-
```
248
+
When a task prompt is provided, the module automatically:
234
249
235
-
This will add your custom extension to Aider's configuration, allowing it to interact with external tools or services. The extension configuration follows the YAML format and is appended to Aider's configuration.
250
+
1. Executes the task during workspace creation using the `--message` and `--yes-always` flags
251
+
2. Creates a flag file to prevent duplicate execution if the Aider button is clicked later
252
+
3. Logs task output to `$HOME/.aider.log` for reference
236
253
237
-
Note: The indentation in the heredoc is preserved, so you can write the YAML naturally.
254
+
If you want to disable task reporting, set `experiment_report_tasks = false` in your module configuration.
238
255
239
256
## Using Aider in Your Workspace
240
257
241
258
After the workspace starts, Aider will be installed and configured according to your parameters. A persistent session will automatically be started during workspace creation.
242
259
243
-
### Accessing Aider
244
-
245
-
Click the "Aider" button in the Coder dashboard to access Aider:
246
-
247
-
- If using persistent sessions (screen/tmux), you'll be attached to the session that was created during workspace setup
248
-
- If not using persistent sessions, Aider will start directly in the configured folder
249
-
- Persistent sessions maintain context even when you disconnect
250
-
251
260
### Session Options
252
261
253
262
You can run Aider in three different ways:
254
263
255
-
1.**Direct Mode** (Default): Aider starts directly in the specified folder when you click the app button
264
+
1.**Direct Mode**: Aider starts directly in the specified folder when you click the app button
256
265
257
266
- Simple setup without persistent context
258
267
- Suitable for quick coding sessions
259
268
260
-
2.**Screen Mode**: Run Aider in a screen session that persists across connections
269
+
2.**Screen Mode** (Default): Run Aider in a screen session that persists across connections
261
270
262
-
- Set `use_screen = true` to enable
263
271
- Session name: "aider" (or configured via `session_name`)
264
272
265
273
3.**Tmux Mode**: Run Aider in a tmux session instead of screen
@@ -268,51 +276,10 @@ You can run Aider in three different ways:
268
276
269
277
Persistent sessions (screen/tmux) allow you to:
270
278
271
-
- Disconnect and reconnect to your Aider session without losing context
279
+
- Disconnect and reconnect without losing context
272
280
- Run Aider in the background while doing other work
273
281
- Switch between terminal and browser interfaces
274
282
275
-
### Task Reporting (Experimental)
276
-
277
-
When enabled, the task reporting feature allows you to:
278
-
279
-
- Send an initial prompt to Aider during workspace creation
280
-
- Monitor task progress in the Coder UI
281
-
- Use the `coder_parameter` resource to collect prompts from users
282
-
283
-
Task reporting is **enabled by default** in this module. To use it effectively:
284
-
285
-
1. Add the Coder Login module to your template
286
-
2. Configure environment variables using `coder_env`:
287
-
288
-
```tf
289
-
resource "coder_env" "task_prompt" {
290
-
agent_id = coder_agent.example.id
291
-
name = "CODER_MCP_AIDER_TASK_PROMPT"
292
-
value = data.coder_parameter.ai_prompt.value
293
-
}
294
-
295
-
resource "coder_env" "app_status" {
296
-
agent_id = coder_agent.example.id
297
-
name = "CODER_MCP_APP_STATUS_SLUG"
298
-
value = "aider"
299
-
}
300
-
```
301
-
302
-
If you want to disable task reporting, set `experiment_report_tasks = false` in your module configuration.
303
-
304
-
The module integrates Aider with Coder's MCP by:
305
-
306
-
1. Creating a config file at `~/.config/aider/config.yml` with MCP extensions
307
-
2. Configuring the Coder extension to communicate with the Coder MCP server
308
-
3. Setting up appropriate parameters like app status slug and timeout values
309
-
310
-
This enables Aider to report task progress and statuses to the Coder UI without requiring manual command execution. The extension communicates with Coder's activity endpoints to provide real-time task status updates.
311
-
312
-
You can also add custom extensions by using the `experiment_additional_extensions` parameter in your module configuration. These will be automatically added to the Aider configuration.
313
-
314
-
See the "With task reporting and initial prompt" example above for a complete configuration.
315
-
316
283
### Available AI Providers and Models
317
284
318
285
| Provider | Available Models | API Key Source |
@@ -325,25 +292,6 @@ See the "With task reporting and initial prompt" example above for a complete co
325
292
326
293
For a complete and up-to-date list of supported LLMs and models, please refer to the [Aider LLM documentation](https://aider.chat/docs/llms.html) and the [Aider LLM Leaderboards](https://aider.chat/docs/leaderboards.html) which show performance comparisons across different models.
327
294
328
-
#### Setting API Keys with coder_env
329
-
330
-
Use the `coder_env` resource to securely set API keys:
331
-
332
-
```tf
333
-
resource "coder_env" "anthropic_api_key" {
334
-
agent_id = coder_agent.example.id
335
-
name = "ANTHROPIC_API_KEY"
336
-
value = var.anthropic_api_key
337
-
}
338
-
339
-
# Set model preference as a regular environment variable
0 commit comments