blink-so[bot] b427fe3f6a docs: Standardize module examples to use coder_agent.main
Update all module README files to use coder_agent.main instead of
coder_agent.example for consistency with existing template conventions.

Changes:
- Updated 50+ module README.md files
- Updated root README.md and CONTRIBUTING.md
- Updated examples/templates/main.tf

This ensures copy-paste examples from module docs work seamlessly
with the majority of templates that use "main" as the agent name.
2025-11-26 18:56:30 +00:00

3.8 KiB

display_name description icon verified tags
Aider Run Aider AI pair programming in your workspace ../../../../.icons/aider.svg true
agent
ai
aider

Aider

Run Aider AI pair programming in your workspace. This module installs Aider with AgentAPI for seamless Coder Tasks Support.

variable "api_key" {
  type        = string
  description = "API key"
  sensitive   = true
}

module "aider" {
  source      = "registry.coder.com/coder/aider/coder"
  version     = "2.0.0"
  agent_id    = coder_agent.main.id
  api_key     = var.api_key
  ai_provider = "google"
  model       = "gemini"
}

Prerequisites

  • pipx is automatically installed if not already available

Usage Example

data "coder_parameter" "ai_prompt" {
  name        = "AI Prompt"
  description = "Write an initial prompt for Aider to work on."
  type        = "string"
  default     = ""
  mutable     = true
}

variable "gemini_api_key" {
  type        = string
  description = "Gemini API key"
  sensitive   = true
}

module "aider" {
  source           = "registry.coder.com/coder/aider/coder"
  version          = "2.0.0"
  agent_id         = coder_agent.main.id
  api_key          = var.gemini_api_key
  install_aider    = true
  workdir          = "/home/coder"
  ai_provider      = "google"
  model            = "gemini"
  install_agentapi = true
  ai_prompt        = data.coder_parameter.ai_prompt.value
  system_prompt    = "..."
}

Using a custom provider

variable "custom_api_key" {
  type        = string
  description = "Custom provider API key"
  sensitive   = true
}

module "aider" {
  count               = data.coder_workspace.me.start_count
  source              = "registry.coder.com/coder/aider/coder"
  version             = "2.0.0"
  agent_id            = coder_agent.main.id
  workdir             = "/home/coder"
  ai_provider         = "custom"
  custom_env_var_name = "MY_CUSTOM_API_KEY"
  model               = "custom-model"
  api_key             = var.custom_api_key
}

Available AI Providers and Models

Aider supports various providers and models, and this module integrates directly with Aider's built-in model aliases:

Provider Example Models/Aliases Default Model
anthropic "sonnet" (Claude 3.7 Sonnet), "opus", "haiku" "sonnet"
openai "4o" (GPT-4o), "4" (GPT-4), "3.5-turbo" "4o"
azure Azure OpenAI models "gpt-4"
google "gemini" (Gemini Pro), "gemini-2.5-pro" "gemini-2.5-pro"
cohere "command-r-plus", etc. "command-r-plus"
mistral "mistral-large-latest" "mistral-large-latest"
ollama "llama3", etc. "llama3"
custom Any model name with custom ENV variable -

For a complete and up-to-date list of supported aliases and models, please refer to the Aider LLM documentation and the Aider LLM Leaderboards which show performance comparisons across different models.

Troubleshooting

  • If aider is not found, ensure install_aider = true and your API key is valid
  • Logs are written under /home/coder/.aider-module/ (install.log, agentapi-start.log) for debugging
  • If AgentAPI fails to start, verify that your container has network access and executable permissions for the scripts

References