| display_name | Aider | ||
|---|---|---|---|
| description | Run Aider AI pair programming in your workspace | ||
| icon | ../.icons/aider.svg | ||
| maintainer_github | coder | ||
| verified | true | ||
| tags |
|
Run Aider AI pair programming in your workspace. This module installs Aider and provides a persistent session using screen or tmux.
module "aider" {
source = "registry.coder.com/modules/aider/coder"
version = "1.0.0"
agent_id = coder_agent.example.id
}- Interactive Parameter Selection: Choose your AI provider, model, and configuration options when creating the workspace
- Multiple AI Providers: Supports Anthropic (Claude), OpenAI, DeepSeek, GROQ, and OpenRouter
- Persistent Sessions: Uses screen (default) or tmux to keep Aider running in the background
- Optional Dependencies: Install Playwright for web page scraping and PortAudio for voice coding
- Project Integration: Works with any project directory, including Git repositories
- Browser UI: Use Aider in your browser with a modern web interface instead of the terminal
- Non-Interactive Mode: Automatically processes tasks when provided via the
CODER_MCP_AIDER_TASK_PROMPTenvironment variable
| Parameter | Description | Type | Default |
|---|---|---|---|
agent_id |
The ID of a Coder agent (required) | string |
- |
folder |
The folder to run Aider in | string |
/home/coder |
install_aider |
Whether to install Aider | bool |
true |
aider_version |
The version of Aider to install | string |
"latest" |
use_screen |
Whether to use screen for running Aider in the background | bool |
true |
use_tmux |
Whether to use tmux instead of screen for running Aider in the background | bool |
false |
session_name |
Name for the persistent session (screen or tmux) | string |
"aider" |
order |
Position of the app in the UI presentation | number |
null |
icon |
The icon to use for the app | string |
"/icon/aider.svg" |
experiment_report_tasks |
Whether to enable task reporting | bool |
true |
experiment_task_conventions |
Custom conventions for task reporting to be written to CONVENTIONS.md | string |
See default in code |
experiment_pre_install_script |
Custom script to run before installing Aider | string |
null |
experiment_post_install_script |
Custom script to run after installing Aider | string |
null |
experiment_additional_extensions |
Additional extensions configuration in YAML format to append to the config | string |
null |
module "aider" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/aider/coder"
version = "1.0.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
}This basic setup will:
- Install Aider in the workspace
- Create a persistent screen session named "aider"
- Enable task reporting (configures Aider to report tasks to Coder MCP)
module "aider" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/aider/coder"
version = "1.0.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
use_tmux = true
}variable "anthropic_api_key" {
type = string
description = "Anthropic API key"
sensitive = true
}
variable "anthropic_model" {
type = string
description = "Anthropic Model"
default = "sonnet"
}
resource "coder_agent" "main" {
# ...
}
# Set API key and model using coder_env resource
resource "coder_env" "anthropic" {
agent_id = coder_agent.example.id
name = "ANTHROPIC_API_KEY"
value = var.anthropic_api_key
}
resource "coder_env" "aider_model" {
agent_id = coder_agent.example.id
name = "AIDER_MODEL"
value = var.anthropic_model
}
module "aider" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/aider/coder"
version = "1.0.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
}You can extend Aider's capabilities by adding custom extensions:
module "aider" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/aider/coder"
version = "1.0.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
experiment_pre_install_script = <<-EOT
pip install some-custom-dependency
EOT
experiment_additional_extensions = <<-EOT
custom-extension:
args: []
cmd: custom-extension-command
description: A custom extension for Aider
enabled: true
envs: {}
name: custom-extension
timeout: 300
type: stdio
EOT
}Note: The indentation in the heredoc is preserved, so you can write the YAML naturally.
This functionality is in early access as of Coder v2.21 and is still evolving. For now, we recommend testing it in a demo or staging environment, rather than deploying to production
Learn more in the Coder documentation
Join our Discord channel or contact us to get help or share feedback.
Your workspace must have either screen or tmux installed to use this.
Task reporting is enabled by default in this module, allowing you to:
- Send an initial prompt to Aider during workspace creation
- Monitor task progress in the Coder UI
- Use the
coder_parameterresource to collect prompts from users
To use task reporting effectively:
- Add the Coder Login module to your template
- Configure the necessary environment variables to pass the task prompt and status slug
- Optionally add a coder_parameter to collect prompts from users
Here's a complete example:
module "coder-login" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/coder-login/coder"
version = "1.0.15"
agent_id = coder_agent.example.id
}
variable "anthropic_api_key" {
type = string
description = "Anthropic API key"
sensitive = true
}
variable "anthropic_model" {
type = string
description = "Anthropic Model"
default = "sonnet"
}
data "coder_parameter" "ai_prompt" {
type = "string"
name = "AI Prompt"
default = ""
description = "Write a prompt for Aider"
mutable = true
ephemeral = true
}
# Configure environment variables for API key, model and task prompt
resource "coder_env" "anthropic" {
agent_id = coder_agent.example.id
name = "ANTHROPIC_API_KEY"
value = var.anthropic_api_key
}
resource "coder_env" "aider_model" {
agent_id = coder_agent.example.id
name = "AIDER_MODEL"
value = var.anthropic_model
}
resource "coder_env" "task_prompt" {
agent_id = coder_agent.example.id
name = "CODER_MCP_AIDER_TASK_PROMPT"
value = data.coder_parameter.ai_prompt.value
}
resource "coder_env" "app_status" {
agent_id = coder_agent.example.id
name = "CODER_MCP_APP_STATUS_SLUG"
value = "aider"
}
module "aider" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/aider/coder"
version = "1.0.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
}When a task prompt is provided, the module automatically:
- Executes the task during workspace creation using the
--messageand--yes-alwaysflags - Creates a flag file to prevent duplicate execution if the Aider button is clicked later
- Logs task output to
$HOME/.aider.logfor reference
If you want to disable task reporting, set experiment_report_tasks = false in your module configuration.
After the workspace starts, Aider will be installed and configured according to your parameters. A persistent session will automatically be started during workspace creation.
You can run Aider in three different ways:
-
Direct Mode: Aider starts directly in the specified folder when you click the app button
- Simple setup without persistent context
- Suitable for quick coding sessions
-
Screen Mode (Default): Run Aider in a screen session that persists across connections
- Session name: "aider" (or configured via
session_name)
- Session name: "aider" (or configured via
-
Tmux Mode: Run Aider in a tmux session instead of screen
- Set
use_tmux = trueto enable - Session name: "aider" (or configured via
session_name)
- Set
Persistent sessions (screen/tmux) allow you to:
- Disconnect and reconnect without losing context
- Run Aider in the background while doing other work
- Switch between terminal and browser interfaces
| Provider | Available Models | API Key Source |
|---|---|---|
| Anthropic | Claude 3.7 Sonnet, Claude 3.7 Haiku | console.anthropic.com |
| OpenAI | o3-mini, o1, GPT-4o | platform.openai.com |
| DeepSeek | DeepSeek R1, DeepSeek Chat V3 | platform.deepseek.com |
| GROQ | Mixtral, Llama 3 | console.groq.com |
| OpenRouter | OpenRouter | openrouter.ai |
For a complete and up-to-date list of supported LLMs and models, please refer to the Aider LLM documentation and the Aider LLM Leaderboards which show performance comparisons across different models.
If you encounter issues:
- Screen/Tmux issues: If you can't reconnect to your session, check if the session exists with
screen -listortmux list-sessions - API key issues: Ensure you've entered the correct API key for your selected provider
- 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
For more information on using Aider, see the Aider documentation.