Skip to content

Commit 6795427

Browse files
docs(aider): update README to reflect changes in module parameters, enable task reporting by default, and add custom extensions configuration example
1 parent 3a05914 commit 6795427

File tree

1 file changed

+83
-25
lines changed

1 file changed

+83
-25
lines changed

aider/README.md

+83-25
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,21 @@ module "aider" {
3030

3131
## Module Parameters
3232

33-
| Parameter | Description | Type | Default |
34-
| -------------------------------- | ------------------------------------------------------------------------- | -------- | ------------------- |
35-
| `agent_id` | The ID of a Coder agent (required) | `string` | - |
36-
| `folder` | The folder to run Aider in | `string` | `/home/coder` |
37-
| `install_aider` | Whether to install Aider | `bool` | `true` |
38-
| `aider_version` | The version of Aider to install | `string` | `"latest"` |
39-
| `use_screen` | Whether to use screen for running Aider in the background | `bool` | `false` |
40-
| `use_tmux` | Whether to use tmux instead of screen for running Aider in the background | `bool` | `false` |
41-
| `session_name` | Name for the persistent session (screen or tmux) | `string` | `"aider"` |
42-
| `order` | Position of the app in the UI presentation | `number` | `null` |
43-
| `icon` | The icon to use for the app | `string` | `"/icon/aider.svg"` |
44-
| `experiment_report_tasks` | Whether to enable task reporting | `bool` | `false` |
45-
| `experiment_pre_install_script` | Custom script to run before installing Aider | `string` | `null` |
46-
| `experiment_post_install_script` | Custom script to run after installing Aider | `string` | `null` |
33+
| Parameter | Description | Type | Default |
34+
| ---------------------------------- | -------------------------------------------------------------------------- | -------- | ------------------- |
35+
| `agent_id` | The ID of a Coder agent (required) | `string` | - |
36+
| `folder` | The folder to run Aider in | `string` | `/home/coder` |
37+
| `install_aider` | Whether to install Aider | `bool` | `true` |
38+
| `aider_version` | The version of Aider to install | `string` | `"latest"` |
39+
| `use_screen` | Whether to use screen for running Aider in the background | `bool` | `true` |
40+
| `use_tmux` | Whether to use tmux instead of screen for running Aider in the background | `bool` | `false` |
41+
| `session_name` | Name for the persistent session (screen or tmux) | `string` | `"aider"` |
42+
| `order` | Position of the app in the UI presentation | `number` | `null` |
43+
| `icon` | The icon to use for the app | `string` | `"/icon/aider.svg"` |
44+
| `experiment_report_tasks` | Whether to enable task reporting | `bool` | `true` |
45+
| `experiment_pre_install_script` | Custom script to run before installing Aider | `string` | `null` |
46+
| `experiment_post_install_script` | Custom script to run after installing Aider | `string` | `null` |
47+
| `experiment_additional_extensions` | Additional extensions configuration in YAML format to append to the config | `string` | `null` |
4748

4849
## Usage Examples
4950

@@ -59,6 +60,14 @@ module "aider" {
5960
}
6061
```
6162

63+
This basic setup will:
64+
65+
- Install Aider in the workspace
66+
- Create a persistent screen session named "aider"
67+
- Enable task reporting (configures Aider to report tasks to Coder MCP)
68+
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+
6271
### With API key via environment variables
6372

6473
```tf
@@ -127,6 +136,13 @@ module "aider" {
127136
Your workspace must have either `screen` or `tmux` installed to use this.
128137

129138
```tf
139+
module "coder-login" {
140+
count = data.coder_workspace.me.start_count
141+
source = "registry.coder.com/modules/coder-login/coder"
142+
version = "1.0.15"
143+
agent_id = coder_agent.example.id
144+
}
145+
130146
variable "anthropic_api_key" {
131147
type = string
132148
description = "Anthropic API key"
@@ -139,13 +155,6 @@ variable "anthropic_model" {
139155
default = "sonnet"
140156
}
141157
142-
module "coder-login" {
143-
count = data.coder_workspace.me.start_count
144-
source = "registry.coder.com/modules/coder-login/coder"
145-
version = "1.0.15"
146-
agent_id = coder_agent.example.id
147-
}
148-
149158
data "coder_parameter" "ai_prompt" {
150159
type = "string"
151160
name = "AI Prompt"
@@ -189,6 +198,44 @@ module "aider" {
189198
}
190199
```
191200

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+
```
234+
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.
236+
237+
Note: The indentation in the heredoc is preserved, so you can write the YAML naturally.
238+
192239
## Using Aider in Your Workspace
193240

194241
After the workspace starts, Aider will be installed and configured according to your parameters. A persistent session will automatically be started during workspace creation.
@@ -233,11 +280,10 @@ When enabled, the task reporting feature allows you to:
233280
- Monitor task progress in the Coder UI
234281
- Use the `coder_parameter` resource to collect prompts from users
235282

236-
To enable task reporting:
283+
Task reporting is **enabled by default** in this module. To use it effectively:
237284

238-
1. Set `experiment_report_tasks = true` in the module configuration
239-
2. Add the Coder Login module to your template
240-
3. Configure environment variables using `coder_env`:
285+
1. Add the Coder Login module to your template
286+
2. Configure environment variables using `coder_env`:
241287

242288
```tf
243289
resource "coder_env" "task_prompt" {
@@ -253,6 +299,18 @@ To enable task reporting:
253299
}
254300
```
255301

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+
256314
See the "With task reporting and initial prompt" example above for a complete configuration.
257315

258316
### Available AI Providers and Models

0 commit comments

Comments
 (0)