Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions coder/ai.coder.com.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,13 @@ module "ai-coder-com-coder" {
default_ttl = 2
failure_ttl = 24
time_til_dormant = 2
time_til_dormant_autodelete = 8
time_til_dormant_autodelete = 4
manual_trigger = var.manual_trigger
exclude_from_archive = local.exclude_from_archive
vars = {
gh_username = var.ai_coder_com_bot_gh_username
gh_email = var.ai_coder_com_bot_gh_email
gh_token = var.ai_coder_com_bot_gh_token
aws_region = "us-east-2"
aws_account_id = var.ai_coder_com_bot_aws_account_id
namespace = "coder-ws"
}
}
Expand All @@ -132,16 +130,11 @@ module "ai-coder-com-coder" {
manual_trigger = var.manual_trigger
exclude_from_archive = local.exclude_from_archive
vars = {
gh_username = var.ai_coder_com_bot_gh_username
gh_email = var.ai_coder_com_bot_gh_email
gh_token = var.ai_coder_com_bot_gh_token
aws_region = "us-east-2"
aws_account_id = var.ai_coder_com_bot_aws_account_id
namespace = "coder-ws"
}
}
"awshp-k8s-with-kiro-cli" = {
path = "${path.module}/../deployments/ai.coder.com/coder/memorycard"
path = "${path.module}/../deployments/ai.coder.com/coder/awshp-k8s-with-kiro-cli"
description = "Provision Kubernetes Deployments as Coder workspaces with Kiro CLI Agent."
display_name = "AWS Workshop - Kubernetes with Kiro CLI"
icon = "/icon/kiro.svg"
Expand Down
33 changes: 8 additions & 25 deletions deployments/ai.coder.com/coder/memorycard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ display_name: Memory Card Game with Vite
description: Memory Card Game with Vite
maintainer_github: jatcod3r
verified: false
tags: [kubernetes, container, ai, tasks]
tags: [kubernetes, container, ai]
---

# Work on a Memory Card Game!

This is an example app cloned from [coder-contrib/memory-card-ai-demo](https://github.com/coder-contrib/memory-card-ai-demo), deployed on Kubernetes with AI-powered development assistance. We include:

- [Anthropic - Claude Code](https://www.claude.com/product/claude-code) as the AI agent
- [Coder - AI Tasks](https://coder.com/docs/ai-coder/tasks) for task-based AI workflows
- [Coder - AI Bridge](https://coder.com/docs/ai-coder/ai-bridge) for model routing
- [Coder - Agent Boundary](https://coder.com/docs/ai-coder/agent-boundary) for network security
- [Coder - MUX](https://registry.coder.com/modules/coder/mux) for AI task management
- [Coder - MUX](https://registry.coder.com/modules/coder/mux) for AI proxy and model management

> **Note:** Coder Tasks has been removed from this template. AI agent interactions now happen directly through Claude Code rather than through the task-based workflow.

This template ships with Claude Code, but you can swap in any AI coding agent. See the [Coder Agents](https://registry.coder.com/modules?search=tag%3Aagent) registry for drop-in modules (e.g. Goose, Aider, Continue) or follow the [custom agents](https://coder.com/docs/ai-coder/custom-agents) guide to bring your own.

Try prompts such as:

Expand All @@ -35,13 +38,12 @@ This template deploys a Kubernetes pod with:

| App / Module | Description |
|---|---|
| **AI Agent** | Claude Code running behind Agent Boundary with MCP servers (GitHub, Playwright) |
| **Preview App** | Vite dev server on port 5173 with health checks |
| **VS Code Web** | Browser-based VS Code with Prettier extension |
| **VS Code Desktop** | Native VS Code via SSH |
| **File Browser** | Web-based file manager |
| **Portable Desktop** | Full desktop environment in the browser |
| **Coder MUX** | AI proxy for task management (optional, togglable) |
| **Coder MUX** | AI proxy for model management (optional, togglable) |

### Home directory seeding

Expand All @@ -51,7 +53,6 @@ Configuration files are stored in the `home/` directory and mounted into the wor

| Parameter | Description | Default |
|---|---|---|
| `select_ai` | AI companion selector | `claude-code` |
| `preview_port` | Port for the Vite dev server | `5173` |
| `use_bots_git_creds` | Use coder-contrib bot Git credentials | `true` |
| `enable_mux` | Toggle Coder MUX on/off | `true` |
Expand All @@ -63,22 +64,4 @@ A [Workspace Preset](https://coder.com/docs/admin/templates/extending-templates/
- A Coder deployment (see [install docs](https://coder.com/docs/install)) with a connected Kubernetes cluster
- [AI Bridge](https://coder.com/docs/ai-coder/ai-bridge) configured with access to Anthropic models (Claude Opus 4.5, Claude Sonnet 4.5, Claude Haiku 4.5)
- GitHub external auth configured with ID `primary-github` (optional, for user-owned Git credentials)
- Template variables set: `gh_token`, `gh_username`, `gh_email`, `namespace`

### Pushing the template

Use the Coder CLI to push the template:

```sh
# Download the CLI
curl -L https://coder.com/install.sh | sh

# Log in to your deployment
coder login https://coder.example.com

# Navigate to this template directory
cd templates/deployments/ai.coder.com/coder/memorycard

# Push the template
coder templates push
```
- Template variables set: `gh_token`, `gh_username`, `gh_email`, `namespace`
17 changes: 0 additions & 17 deletions deployments/ai.coder.com/coder/memorycard/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,6 @@ variable "namespace" {
default = ""
}

data "coder_parameter" "select_ai" {
name = "Select an AI Companion"
description = "Which AI companion would you like to assist you?"
icon = "/emojis/1f916.png"
mutable = true
type = "string"
form_type = "dropdown"
default = "claude-code"
order = 1

option {
name = "Claude"
icon = "/icon/claude.svg"
value = "claude-code"
}
}

data "coder_parameter" "preview_port" {
name = "Preview Port"
description = "The port the web app is running on to preview in Coder Tasks!"
Expand Down
100 changes: 36 additions & 64 deletions deployments/ai.coder.com/coder/realworld/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,64 @@ display_name: RealWorld App with Django
description: Run a RealWorld Django application!
maintainer_github: jatcod3r
verified: false
tags: [kubernetes, container, ai, tasks]
tags: [kubernetes, container, ai]
---

# Run a RealWorld Django Application!

This is an example app cloned from [thanhdev/realworld-django-rest-framework-angular](https://github.com/thanhdev/realworld-django-rest-framework-angular), belonging to the [`RealWorld` suite](https://realworld-docs.netlify.app/). We include:

- [Anthropic - Claude Code](https://www.claude.com/product/claude-code)
- [Coder - AI Tasks](https://coder.com/docs/ai-coder/tasks)
- [Coder - AI Bridge](https://coder.com/docs/ai-coder/ai-bridge)
- [Coder - Agent Boundary](https://coder.com/docs/ai-coder/agent-boundary)
- [Coder - AI Bridge](https://coder.com/docs/ai-coder/ai-bridge) for model routing
- [Coder - Agent Boundary](https://coder.com/docs/ai-coder/agent-boundary) for network security
- [Coder - MUX](https://registry.coder.com/modules/coder/mux) for AI proxy and model management (optional)

This is a starting point for working with AI agents in Coder Tasks and exploring AI governance. Try prompts such as:
> **Note:** Coder Tasks has been removed from this template. AI agent interactions now happen directly through the configured coding agent rather than through the task-based workflow.

This template is a starting point for working with AI agents in Coder and exploring AI governance. Any [Coder Agent](https://registry.coder.com/modules?search=tag%3Aagent) module can be used as a drop-in replacement, or you can follow the [custom agents](https://coder.com/docs/ai-coder/custom-agents) guide to bring your own.

Try prompts such as:

- `Make the background color blue`
- `Add a dark mode`
- `Rewrite the entire backend in Go`

Or, check out any [existing project issues](https://github.com/coder-contrib/realworld-django-rest-framework-angular/issues) to have Claude work on:
Or, check out any [existing project issues](https://github.com/coder-contrib/realworld-django-rest-framework-angular/issues) to have the agent work on:

- `Work on issue #1`
- `Look at "https://github.com/coder-contrib/realworld-django-rest-framework-angular/issues/30" and submit a fix.`

## Included in this template

This template is designed to be an example and a reference for building other templates with Coder Tasks. You can always run Coder Tasks on different infrastructure (e.g. as on Kubernetes, VMs) and with your own GitHub repositories, MCP servers, images, etc.

Additionally, this template uses our [Claude Code](https://registry.coder.com/modules/coder/claude-code) module, but [other agents](https://registry.coder.com/modules?search=tag%3Aagent) or even [custom agents](https://coder.com/docs/ai-coder/custom-agents) can be used in its place.

This template uses a [Workspace Preset](https://coder.com/docs/admin/templates/extending-templates/parameters#workspace-presets) that pre-defines:

- Universal Container Image (e.g. contains Node.js, Java, Python, Ruby, etc)
- MCP servers (playwright for previewing changes)
- System prompt and [repository](https://github.com/coder-contrib/realworld-django-rest-framework-angular) for the AI agent
- Startup script to initialize the repository and start the development server

### Prerequisites

Although this template runs on Kubernetes, alternatively, it can be installed onto a VM or Docker Container using our [tasks-docker](https://github.com/coder/registry/tree/main/registry/coder-labs/templates/tasks-docker) template. This is what it will require:

- Coder installed (see [our docs](https://coder.com/docs/install)), ideally a Linux VM with Docker
- Anthropic API Key (or access to Anthropic models via Bedrock or Vertex, see [Claude Code docs](https://docs.anthropic.com/en/docs/claude-code/third-party-integrations))
- Access to a Docker socket
- If on the local VM, ensure the `coder` user is added to the Docker group (docs)

```sh
# Add coder user to Docker group
sudo adduser coder docker

# Restart Coder server
sudo systemctl restart coder

# Test Docker
sudo -u coder docker ps
```
## Template architecture

- If on a remote VM, see the [Docker Terraform provider documentation](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs#remote-hosts) to configure a remote host
This template deploys a Kubernetes pod with:

To import this template into Coder, first create a template from "Scratch" in the template editor.
- A **single Coder agent** (`coder_agent.k8s-deployment`) running in a container based on `coder-aienv:1.1.4`
- A **launch script** that seeds VS Code settings, extensions, and Coder MUX configuration at startup
- Resource limits of **2 CPU / 8GB RAM / 25GB ephemeral storage**

Visit this URL for your Coder deployment:
### Apps and modules

```sh
https://coder.example.com/templates/new?exampleId=scratch
```
| App / Module | Description |
|---|---|
| **Preview App** | Web app preview on port 4200 with health checks |
| **VS Code Web** | Browser-based VS Code with Prettier extension |
| **VS Code Desktop** | Native VS Code via SSH |
| **File Browser** | Web-based file manager |
| **Coder MUX** | AI proxy for model management (optional, disabled by default) |

After creating the template, paste the contents from [main.tf](./main.tf) into the template editor and save.
### Workspace parameters

Alternatively, you can use the Coder CLI to [push the template](https://coder.com/docs/reference/cli/templates_push)
| Parameter | Description | Default |
|---|---|---|
| `launch_script` | Optional custom script to run after workspace launch | _(empty)_ |
| `preview_port` | Port for the web app preview | `4200` |
| `use_bots_git_creds` | Use coder-contrib bot Git credentials | `true` |
| `enable_mux` | Toggle Coder MUX on/off | `false` |

```sh
# Download the CLI
curl -L https://coder.com/install.sh | sh
A [Workspace Preset](https://coder.com/docs/admin/templates/extending-templates/parameters#workspace-presets) named **"Ohio Settings"** pre-configures the preview port with prebuild scheduling for weekday hours.

# Log in to your deployment
coder login https://coder.example.com

# Clone the registry
git clone https://github.com/coder/registry
cd registry

# Navigate to this template
cd registry/coder-labs/templates/tasks-docker
# OR
cd registry/coder-labs/templates/tasks-k8s
### Prerequisites

# Push the template
coder templates push
```
- A Coder deployment (see [install docs](https://coder.com/docs/install)) with a connected Kubernetes cluster
- [AI Bridge](https://coder.com/docs/ai-coder/ai-bridge) configured with access to your preferred AI models
- GitHub external auth configured with ID `primary-github` (optional, for user-owned Git credentials)
- Template variables set: `gh_token`, `gh_username`, `gh_email`, `namespace`
84 changes: 0 additions & 84 deletions deployments/ai.coder.com/coder/realworld/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -211,90 +211,6 @@ locals {
GH_USERNAME = data.coder_workspace_owner.me.email
GH_TOKEN = data.coder_external_auth.github.access_token
}
claude_settings = {
# Add additional restrictions to what commands Claude should/shouldn't run.
permissions = {
allow = [
"Bash(coder:*)",
"Bash(gh:*)",
"Bash(git:*)",
]
deny = [
"Bash(git push origin main)",
"Bash(git push origin master)",

"Bash(gh repo delete:*)",
"Bash(gh repo create:*)",
"Bash(gh repo edit:*)",

"Bash(gh ssh-key:*)",
"Bash(gh gpg-key:*)",
"Bash(gh variable:*)",
"Bash(gh token:*)",
"Bash(gh agent-task:*)",
"Bash(gh attestation:*)",
"Bash(gh cache:*)",
"Bash(gh codespace:*)",

"Bash(gh gist delete:*)",

"Bash(gh issue delete:*)",
"Bash(gh issue transfer:*)",
"Bash(gh issue reopen:*)",
"Bash(gh issue close:*)",

"Bash(coder server:*)",
"Bash(coder reset-password:*)",

"Bash(coder exp:*)",

"Bash(coder templates archive:*)",
"Bash(coder templates create:*)",
"Bash(coder templates delete:*)",
"Bash(coder templates edit:*)",
"Bash(coder templates push:*)",
"Bash(coder templates versions archive:*)",
"Bash(coder templates versions unarchive:*)",
"Bash(coder templates versions promote:*)",

"Bash(coder users active:*)",
"Bash(coder users create:*)",
"Bash(coder users delete:*)",
"Bash(coder users edit:*)",
"Bash(coder users suspend:*)",

"Bash(coder provisioner keys create:*)",
"Bash(coder provisioner keys delete:*)",

"Bash(coder groups create:*)",
"Bash(coder groups delete:*)",
"Bash(coder groups edit:*)",

"Bash(coder organizations:*)",
"Bash(coder organizations members:*)",
"Bash(coder organizations roles:*)",
"Bash(coder organizations settings:*)",
]
}
env = {
ANTHROPIC_MODEL = "claude-opus-4-5"
ANTHROPIC_SMALL_FAST_MODEL = "claude-haiku-4-5"

GIT_SSH_COMMAND = ""
GIT_ASKPASS = ""
GIT_AUTHOR_NAME = coalesce(data.coder_workspace_owner.me.full_name, data.coder_workspace_owner.me.name)
GIT_AUTHOR_EMAIL = data.coder_workspace_owner.me.email
GIT_COMMITTER_NAME = local.gh_username
GIT_COMMITTER_EMAIL = var.gh_email
GIT_CONFIG_COUNT = 1
GIT_CONFIG_KEY_0 = "user.name"
GIT_CONFIG_VALUE_0 = local.gh_username
GIT_CONFIG_KEY_1 = "user.email"
GIT_CONFIG_VALUE_1 = var.gh_email
GH_TOKEN = local.gh_token
GH_USERNAME = local.gh_username
}
}
}

module "cmux" {
Expand Down
2 changes: 1 addition & 1 deletion deployments/ai.coder.com/coder/realworld/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ locals {

data "coder_parameter" "launch_script" {
name = "Workspace Launch Script (Optional)"
description = "Script to run after workspace launch! (Runs outside of the AI context)"
description = "Script to run after workspace launch!"
icon = "/emojis/1f4dd.png"
mutable = false
type = "string"
Expand Down
Loading