8000 docs(aider): update README to include non-interactive mode, enhance t… · coder/modules@99aeae8 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 99aeae8

Browse files
docs(aider): update README to include non-interactive mode, enhance task reporting section, and clarify custom extensions configuration
1 parent 1572516 commit 99aeae8

File tree

1 file changed

+60
-112
lines changed

1 file changed

+60
-112
lines changed

aider/README.md

Lines changed: 60 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module "aider" {
2727
- **Optional Dependencies**: Install Playwright for web page scraping and PortAudio for voice coding
2828
- **Project Integration**: Works with any project directory, including Git repositories
2929
- **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
3031

3132
## Module Parameters
3233

@@ -66,7 +67,18 @@ This basic setup will:
6667
- Create a persistent screen session named "aider"
6768
- Enable task reporting (configures Aider to report tasks to Coder MCP)
6869

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+
```
7082

7183
### With API key via environment variables
7284

@@ -109,7 +121,9 @@ module "aider" {
109121
}
110122
```
111123

112-
### With tmux instead of screen
124+
### Adding Custom Extensions (Experimental)
125+
126+
You can extend Aider's capabilities by adding custom extensions:
113127

114128
```tf
115129
module "aider" {
@@ -118,11 +132,28 @@ module "aider" {
118132
version = "1.0.0"
119133
agent_id = coder_agent.example.id
120134
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
122151
}
123152
```
124153

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)
126157

127158
> This functionality is in early access as of Coder v2.21 and is still evolving.
128159
> For now, we recommend testing it in a demo or staging environment,
@@ -135,6 +166,22 @@ module "aider" {
135166
136167
Your workspace must have either `screen` or `tmux` installed to use this.
137168

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+
138185
```tf
139186
module "coder-login" {
140187
count = data.coder_workspace.me.start_count
@@ -164,7 +211,7 @@ data "coder_parameter" "ai_prompt" {
164211
ephemeral = true
165212
}
166213
167-
# Set API key and model using coder_env resource
214+
# Configure environment variables for API key, model and task prompt
168215
resource "coder_env" "anthropic" {
169216
agent_id = coder_agent.example.id
170217
name = "ANTHROPIC_API_KEY"
@@ -198,68 +245,29 @@ module "aider" {
198245
}
199246
```
200247

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:
234249

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
236253

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.
238255

239256
## Using Aider in Your Workspace
240257

241258
After the workspace starts, Aider will be installed and configured according to your parameters. A persistent session will automatically be started during workspace creation.
242259

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-
251260
### Session Options
252261

253262
You can run Aider in three different ways:
254263

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
256265

257266
- Simple setup without persistent context
258267
- Suitable for quick coding sessions
259268

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
261270

262-
- Set `use_screen = true` to enable
263271
- Session name: "aider" (or configured via `session_name`)
264272

265273
3. **Tmux Mode**: Run Aider in a tmux session instead of screen
@@ -268,51 +276,10 @@ You can run Aider in three different ways:
268276

269277
Persistent sessions (screen/tmux) allow you to:
270278

271-
- Disconnect and reconnect to your Aider session without losing context
279+
- Disconnect and reconnect without losing context
272280
- Run Aider in the background while doing other work
273281
- Switch between terminal and browser interfaces
274282

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-
316283
### Available AI Providers and Models
317284

318285
| Provider | Available Models | API Key Source |
@@ -325,25 +292,6 @@ See the "With task reporting and initial prompt" example above for a complete co
325292

326293
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.
327294

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
340-
resource "coder_env" "aider_model" {
341-
agent_id = coder_agent.example.id
342-
name = "AIDER_MODEL"
343-
value = "sonnet"
344-
}
345-
```
346-
347295
## Troubleshooting
348296

349297
If you encounter issues:

0 commit comments

Comments
 (0)
0