Skip to content

Templates

Dan Anstis edited this page Feb 1, 2026 · 1 revision

AI Development (ai-dev)

Quick Links — homepage · docs · repo

What this template provides

  • Universal Docker-based Coder workspace with six pre-installed CLI coding agents (Claude Code, OpenCode, Relentless, Codex, Copilot + provider support for Gemini) and VS Code Web (code-server) on port 13337.
  • Selectable development stacks (Python uv/pip, Go) and optional AI plugins (oh-my-claudecode, oh-my-opencode).
  • Persistent /home/coder Docker volume and real-time resource monitoring from the agent.
  • Node 24 and GitHub CLI preinstalled by the base startup script.

Authentication & quick usage notes

  • All pre-installed CLI agents require authentication (API keys, provider logins or subscriptions). In headless/container environments prefer environment variables for auth.
  • Common environment variables:
# example — paste into shell or workspace environment
export ANTHROPIC_API_KEY="sk-..."
export OPENAI_API_KEY="sk-..."
export GEMINI_API_KEY="your-google-key"
export GITHUB_TOKEN="ghp_..."
  • Common interactive commands:
    • Claude Code: claude login or set ANTHROPIC_API_KEY
    • OpenCode: opencode (see opencode.ai/docs) or opencode auth login
    • Codex: run codex and follow sign-in (ChatGPT/Plus/Pro or API key as documented)
    • Copilot (terminal): install gh extension gh extension install github/gh-copilot and follow gh auth
    • Gemini: follow Google/Vertex AI auth (service account, API key, or gcloud auth depending on your setup)
  • Notes: some tools have multiple auth paths (device auth, API key, hosted console). Check each tool's docs links above for the recommended/auth methods.

Where to read and edit in this repository

  • Template docs: templates/ai-dev/README.md
  • Terraform entrypoint: templates/ai-dev/main.tf
  • Startup & installers: templates/ai-dev/scripts/ (see common-deps.sh, base-ai-tools.sh, stacks/, agents/)
  • Deployment helpers: scripts/deploy-templates.sh (Linux/macOS) and .\scripts\deploy-templates.ps1 (Windows)
  • Use these files to update install steps, add stacks/plugins, or change agent choices.

Quick deploy / test steps

  1. Build/validate locally (in template dir):
cd templates/ai-dev
terraform init
terraform validate
  1. Push the template to your Coder instance:
# requires coder CLI authenticated to your Coder instance
coder templates push ai-dev --directory templates/ai-dev
  1. Create a workspace from the template in the Coder dashboard and set needed env vars (Anthropic/OpenAI/GCP/GitHub) in the workspace settings.

Troubleshooting & tips

  • If an agent fails to install non‑fatally, the startup script continues — check workspace logs to see errors from base-ai-tools.sh and installers in templates/ai-dev/scripts/.
  • For headless installs prefer exporting API keys in the workspace environment rather than interactive logins.
  • To enable Copilot features in OpenCode or other tools, ensure the workspace has a valid GITHUB_TOKEN with Copilot access and follow the tool-specific instructions.