From 71423c7c1db714e759f18f076ea1ac835ded8abe Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 10:29:50 +0000 Subject: [PATCH 01/34] feat(claude-code): add Claude Code module with installation and background execution support Introduces a new module for running Claude Code in workspaces, including configuration for installation, background execution using screen, and task reporting. Also adds an SVG icon for the module and a README with usage examples. --- .icons/claude.svg | 4 + claude-code/README.md | 83 ++++++++++++++++++ claude-code/main.tf | 193 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 280 insertions(+) create mode 100644 .icons/claude.svg create mode 100644 claude-code/README.md create mode 100644 claude-code/main.tf diff --git a/.icons/claude.svg b/.icons/claude.svg new file mode 100644 index 00000000..998fb0d5 --- /dev/null +++ b/.icons/claude.svg @@ -0,0 +1,4 @@ + + + + diff --git a/claude-code/README.md b/claude-code/README.md new file mode 100644 index 00000000..61a61e49 --- /dev/null +++ b/claude-code/README.md @@ -0,0 +1,83 @@ +--- +display_name: Claude Code +description: Run Claude Code in your workspace +icon: ../.icons/claude.svg +maintainer_github: coder +verified: true +tags: [agent, claude-code] +--- + +# Claude Code + +Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview) agent in your workspace to generate code and perform tasks. + +### Prerequisites + +- Node.js and npm must be installed in your workspace to install Claude Code +- `screen` must be installed in your workspace to run Claude Code in the background + +## Examples + +### Run in the background and report tasks (Experimental) +Your workspace must have `screen` installed to use this. In this example, we'll attempt to install `screen` if it's not already installed. + +```tf +data "coder_parameter" "ai_prompt" { + type = "string" + name = "AI Prompt" + default = "" + description = "Write a prompt for Claude Code" + mutable = true +} + +# Set the prompt and system prompt for Claude Code via environment variables +resource "coder_agent" "main" { + env = { + CLAUDE_TASK_PROMPT = data.coder_parameter.ai_prompt.value + SYSTEM_PROMPT =<<-EOT + You are a helpful assistant that can help with code. + EOT + } +} + +module "claude-code" { + count = data.coder_workspace.me.start_count + source = "registry.coder.com/modules/claude-code/coder" + version = "1.0.29" + agent_id = coder_agent.example.id + folder = "/home/coder" + install_claude_code = true + claude_code_version = "0.2.57" + + # Enable experimental features + experiment_use_screen = true + experiment_report_tasks = true + experiment_init_script =<<-EOT + #!/bin/bash + # Install `screen` if it's not already installed. + # This specific script only works on Debian-based systems. + if ! command -v screen &> /dev/null; then + echo "Installing screen..." + sudo apt-get update && sudo apt-get install -y screen + fi + EOT +} +``` + +## Run as a standalone app + +Run Claude Code as a standalone app in your workspace. This will install Claude Code and run it directly without using screen. + +```tf +module "claude-code" { + source = "registry.coder.com/modules/claude-code/coder" + version = "1.0.29" + agent_id = coder_agent.example.id + folder = "/home/coder" + install_claude_code = true + claude_code_version = "latest" + + # Icon is not available in Coder v2.20 and below, so we'll use a custom icon URL + icon = "https://uxwing.com/wp-content/themes/uxwing/download/brands-and-social-media/claude-ai-icon.png" +} +``` \ No newline at end of file diff --git a/claude-code/main.tf b/claude-code/main.tf new file mode 100644 index 00000000..16e0b482 --- /dev/null +++ b/claude-code/main.tf @@ -0,0 +1,193 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + coder = { + source = "coder/coder" + version = ">= 0.17" + } + } +} + +variable "agent_id" { + type = string + description = "The ID of a Coder agent." +} + +data "coder_workspace" "me" {} + +data "coder_workspace_owner" "me" {} + +variable "order" { + type = number + description = "The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order)." + default = null +} + +variable "icon" { + type = string + description = "The icon to use for the app." + default = "/icon/claude.svg" +} + +variable "folder" { + type = string + description = "The folder to run Claude Code in." + default = "/home/coder" +} + +variable "install_claude_code" { + type = bool + description = "Whether to install Claude Code." + default = true +} + +variable "claude_code_version" { + type = string + description = "The version of Claude Code to install." + default = "latest" +} + +variable "experiment_use_screen" { + type = bool + description = "Whether to use screen for running Claude Code in the background." + default = false +} + +variable "experiment_report_tasks" { + type = bool + description = "Whether to enable task reporting." + default = false +} + +variable "experiment_init_script" { + type = string + description = "Additional initialization script to run before starting Claude Code." + default = "" +} + +# Install and Initialize Claude Code +resource "coder_script" "claude_code" { + agent_id = var.agent_id + display_name = "Claude Code" + icon = var.icon + script = <<-EOT + #!/bin/bash + set -e + + # Function to check if a command exists + command_exists() { + command -v "$1" >/dev/null 2>&1 + } + + # Run init script if provided + if [ -n "${var.experiment_init_script}" ]; then + echo "Running init script..." + ${var.experiment_init_script} + fi + + # Install Claude Code if enabled + if [ "${var.install_claude_code}" = "true" ]; then + if ! command_exists npm; then + echo "Error: npm is not installed. Please install Node.js and npm first." + exit 1 + fi + echo "Installing Claude Code version ${var.claude_code_version}..." + npm install -g @anthropic-ai/claude-code@${var.claude_code_version} + fi + + # Run with screen if enabled + if [ "${var.experiment_use_screen}" = "true" ]; then + echo "Running Claude Code in the background..." + + # Check if screen is installed + if ! command_exists screen; then + echo "Error: screen is not installed. Please install screen manually." + exit 1 + fi + + SCREENRC="$HOME/.screenrc" + LOG_FILE="$HOME/.claude-code.log" + touch "$LOG_FILE" + + # Ensure the screenrc exists + if [ ! -f "$SCREENRC" ]; then + echo "Creating ~/.screenrc and adding multiuser settings..." | tee -a "$LOG_FILE" + echo -e "multiuser on\nacladd $(whoami)" > "$SCREENRC" + fi + + if ! grep -q "^multiuser on$" "$SCREENRC"; then + echo "Adding 'multiuser on' to ~/.screenrc..." | tee -a "$LOG_FILE" + echo "multiuser on" >> "$SCREENRC" + fi + + if ! grep -q "^acladd $(whoami)$" "$SCREENRC"; then + echo "Adding 'acladd $(whoami)' to ~/.screenrc..." | tee -a "$LOG_FILE" + echo "acladd $(whoami)" >> "$SCREENRC" + fi + + screen -U -dmS claude-code bash -c ' + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + cd ${var.folder} + claude | tee -a "$LOG_FILE" + exec bash + ' + else + # Check if claude is installed before running + if ! command_exists claude; then + echo "Error: Claude Code is not installed. Please enable install_claude_code or install it manually." + exit 1 + fi + + cd ${var.folder} + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + claude + fi + EOT + run_on_start = true +} + +resource "coder_app" "claude_code" { + slug = "claude-code" + display_name = "Claude Code" + agent_id = var.agent_id + command = <<-EOT + #!/bin/bash + set -e + + # Function to check if a command exists + command_exists() { + command -v "$1" >/dev/null 2>&1 + } + + # Check if claude is installed + if ! command_exists claude; then + echo "Error: Claude Code is not installed. Please enable install_claude_code or install it manually." + exit 1 + fi + + if [ "${var.experiment_use_screen}" = "true" ]; then + # Check if screen is installed + if ! command_exists screen; then + echo "Error: screen is not installed. Please install screen manually." + exit 1 + fi + + if screen -list | grep -q "claude-code"; then + echo "Attaching to existing Claude Code session." | tee -a "$LOG_FILE" + screen -xRR claude-code + else + echo "Starting a new Claude Code session." | tee -a "$LOG_FILE" + screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$LOG_FILE"; exec bash' + fi + else + cd ${var.folder} + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + claude + fi + EOT + icon = var.icon +} From aacd1a1e6fc0c2133ea870ee226ae7ae4d68cd6a Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 10:35:46 +0000 Subject: [PATCH 02/34] fix(claude-code): update installation message and icon URL Revised the installation message for clarity and updated the icon URL in the README to a new source. This enhances user experience and ensures the correct visual representation of the module. --- claude-code/README.md | 2 +- claude-code/main.tf | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index 61a61e49..0713694f 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -78,6 +78,6 @@ module "claude-code" { claude_code_version = "latest" # Icon is not available in Coder v2.20 and below, so we'll use a custom icon URL - icon = "https://uxwing.com/wp-content/themes/uxwing/download/brands-and-social-media/claude-ai-icon.png" + icon = "https://registry.npmmirror.com/@lobehub/icons-static-png/1.24.0/files/dark/claude-color.png" } ``` \ No newline at end of file diff --git a/claude-code/main.tf b/claude-code/main.tf index 16e0b482..ca7541a3 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -92,7 +92,7 @@ resource "coder_script" "claude_code" { echo "Error: npm is not installed. Please install Node.js and npm first." exit 1 fi - echo "Installing Claude Code version ${var.claude_code_version}..." + echo "Installing Claude Code..." npm install -g @anthropic-ai/claude-code@${var.claude_code_version} fi @@ -139,11 +139,6 @@ resource "coder_script" "claude_code" { echo "Error: Claude Code is not installed. Please enable install_claude_code or install it manually." exit 1 fi - - cd ${var.folder} - export LANG=en_US.UTF-8 - export LC_ALL=en_US.UTF-8 - claude fi EOT run_on_start = true From d18b8adec220012a6bd019648a486dc27fda9b31 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 10:40:39 +0000 Subject: [PATCH 03/34] chore(claude-code): add logging functionality to main script Introduces a log file path variable in the main script for the Claude Code module, enhancing the ability to track execution and debug issues. This change sets the groundwork for improved monitoring and error handling in future updates. --- claude-code/main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/claude-code/main.tf b/claude-code/main.tf index ca7541a3..3b6dd367 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -152,6 +152,8 @@ resource "coder_app" "claude_code" { #!/bin/bash set -e + LOG_FILE="$HOME/.claude-code.log" + # Function to check if a command exists command_exists() { command -v "$1" >/dev/null 2>&1 From c143e0b6bf719e45c6a4cee14bf679d7c641da0e Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 10:51:48 +0000 Subject: [PATCH 04/34] testing --- claude-code/README.md | 9 --------- claude-code/main.tf | 21 ++++++++------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index 0713694f..39a133fe 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -52,15 +52,6 @@ module "claude-code" { # Enable experimental features experiment_use_screen = true experiment_report_tasks = true - experiment_init_script =<<-EOT - #!/bin/bash - # Install `screen` if it's not already installed. - # This specific script only works on Debian-based systems. - if ! command -v screen &> /dev/null; then - echo "Installing screen..." - sudo apt-get update && sudo apt-get install -y screen - fi - EOT } ``` diff --git a/claude-code/main.tf b/claude-code/main.tf index 3b6dd367..74372923 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -60,12 +60,6 @@ variable "experiment_report_tasks" { default = false } -variable "experiment_init_script" { - type = string - description = "Additional initialization script to run before starting Claude Code." - default = "" -} - # Install and Initialize Claude Code resource "coder_script" "claude_code" { agent_id = var.agent_id @@ -80,12 +74,6 @@ resource "coder_script" "claude_code" { command -v "$1" >/dev/null 2>&1 } - # Run init script if provided - if [ -n "${var.experiment_init_script}" ]; then - echo "Running init script..." - ${var.experiment_init_script} - fi - # Install Claude Code if enabled if [ "${var.install_claude_code}" = "true" ]; then if ! command_exists npm; then @@ -96,6 +84,9 @@ resource "coder_script" "claude_code" { npm install -g @anthropic-ai/claude-code@${var.claude_code_version} fi + # Debug output + echo "experiment_use_screen value: `${var.experiment_use_screen}`" + # Run with screen if enabled if [ "${var.experiment_use_screen}" = "true" ]; then echo "Running Claude Code in the background..." @@ -165,6 +156,9 @@ resource "coder_app" "claude_code" { exit 1 fi + # Debug output + echo "experiment_use_screen value: ${var.experiment_use_screen}" + if [ "${var.experiment_use_screen}" = "true" ]; then # Check if screen is installed if ! command_exists screen; then @@ -177,9 +171,10 @@ resource "coder_app" "claude_code" { screen -xRR claude-code else echo "Starting a new Claude Code session." | tee -a "$LOG_FILE" - screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$LOG_FILE"; exec bash' + screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$HOME/.claude-code.log"; exec bash' fi else + echo "Running Claude Code in foreground..." cd ${var.folder} export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 From 9f2edf7ccdf88f9f4ea1b8c24882057b62cdf9a5 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 10:55:12 +0000 Subject: [PATCH 05/34] fixes --- claude-code/main.tf | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index 74372923..baa067e4 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -143,38 +143,15 @@ resource "coder_app" "claude_code" { #!/bin/bash set -e - LOG_FILE="$HOME/.claude-code.log" - - # Function to check if a command exists - command_exists() { - command -v "$1" >/dev/null 2>&1 - } - - # Check if claude is installed - if ! command_exists claude; then - echo "Error: Claude Code is not installed. Please enable install_claude_code or install it manually." - exit 1 - fi - - # Debug output - echo "experiment_use_screen value: ${var.experiment_use_screen}" - if [ "${var.experiment_use_screen}" = "true" ]; then - # Check if screen is installed - if ! command_exists screen; then - echo "Error: screen is not installed. Please install screen manually." - exit 1 - fi - if screen -list | grep -q "claude-code"; then - echo "Attaching to existing Claude Code session." | tee -a "$LOG_FILE" + echo "Attaching to existing Claude Code session." | tee -a "$HOME/.claude-code.log" screen -xRR claude-code else - echo "Starting a new Claude Code session." | tee -a "$LOG_FILE" - screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$HOME/.claude-code.log"; exec bash' + echo "Starting a new Claude Code session." | tee -a "$HOME/.claude-code.log" + screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$LOG_FILE"; exec bash' fi else - echo "Running Claude Code in foreground..." cd ${var.folder} export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 From a1f018c24947d8f4eacd268d6aa1d112b1aaa11c Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 10:57:22 +0000 Subject: [PATCH 06/34] fix: claude-code --- claude-code/main.tf | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index baa067e4..10d6c888 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -97,31 +97,29 @@ resource "coder_script" "claude_code" { exit 1 fi - SCREENRC="$HOME/.screenrc" - LOG_FILE="$HOME/.claude-code.log" - touch "$LOG_FILE" + touch "$HOME/.claude-code.log" # Ensure the screenrc exists - if [ ! -f "$SCREENRC" ]; then - echo "Creating ~/.screenrc and adding multiuser settings..." | tee -a "$LOG_FILE" - echo -e "multiuser on\nacladd $(whoami)" > "$SCREENRC" + if [ ! -f "$HOME/.screenrc" ]; then + echo "Creating ~/.screenrc and adding multiuser settings..." | tee -a "$HOME/.claude-code.log" + echo -e "multiuser on\nacladd $(whoami)" > "$HOME/.screenrc" fi - if ! grep -q "^multiuser on$" "$SCREENRC"; then - echo "Adding 'multiuser on' to ~/.screenrc..." | tee -a "$LOG_FILE" - echo "multiuser on" >> "$SCREENRC" + if ! grep -q "^multiuser on$" "$HOME/.screenrc"; then + echo "Adding 'multiuser on' to ~/.screenrc..." | tee -a "$HOME/.claude-code.log" + echo "multiuser on" >> "$HOME/.screenrc" fi - if ! grep -q "^acladd $(whoami)$" "$SCREENRC"; then - echo "Adding 'acladd $(whoami)' to ~/.screenrc..." | tee -a "$LOG_FILE" - echo "acladd $(whoami)" >> "$SCREENRC" + if ! grep -q "^acladd $(whoami)$" "$HOME/.screenrc"; then + echo "Adding 'acladd $(whoami)' to ~/.screenrc..." | tee -a "$HOME/.claude-code.log" + echo "acladd $(whoami)" >> "$HOME/.screenrc" fi screen -U -dmS claude-code bash -c ' export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 cd ${var.folder} - claude | tee -a "$LOG_FILE" + claude | tee -a "$HOME/.claude-code.log" exec bash ' else @@ -149,7 +147,7 @@ resource "coder_app" "claude_code" { screen -xRR claude-code else echo "Starting a new Claude Code session." | tee -a "$HOME/.claude-code.log" - screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$LOG_FILE"; exec bash' + screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$HOME/.claude-code.log"; exec bash' fi else cd ${var.folder} From 43a9d2fb3a485132e286d865dd7466dc0595710b Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 11:11:01 +0000 Subject: [PATCH 07/34] fix lang --- claude-code/main.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/claude-code/main.tf b/claude-code/main.tf index 10d6c888..eb8183bd 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -114,6 +114,8 @@ resource "coder_script" "claude_code" { echo "Adding 'acladd $(whoami)' to ~/.screenrc..." | tee -a "$HOME/.claude-code.log" echo "acladd $(whoami)" >> "$HOME/.screenrc" fi + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 screen -U -dmS claude-code bash -c ' export LANG=en_US.UTF-8 @@ -143,6 +145,8 @@ resource "coder_app" "claude_code" { if [ "${var.experiment_use_screen}" = "true" ]; then if screen -list | grep -q "claude-code"; then + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 echo "Attaching to existing Claude Code session." | tee -a "$HOME/.claude-code.log" screen -xRR claude-code else From b5cb2aee1b1d0f39f6945a15175e92571c6a0ff5 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 11:12:19 +0000 Subject: [PATCH 08/34] test --- claude-code/main.tf | 2 -- 1 file changed, 2 deletions(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index eb8183bd..af9574bb 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -118,8 +118,6 @@ resource "coder_script" "claude_code" { export LC_ALL=en_US.UTF-8 screen -U -dmS claude-code bash -c ' - export LANG=en_US.UTF-8 - export LC_ALL=en_US.UTF-8 cd ${var.folder} claude | tee -a "$HOME/.claude-code.log" exec bash From 4a5f1f3b84644338f88d782cc504a379dd02e1f2 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 11:14:35 +0000 Subject: [PATCH 09/34] fix(claude-code): update standalone app instructions for clarity Revised the README to clarify the instructions for running Claude Code as a standalone app, specifying that it operates without using screen or task reporting to the Coder UI. This enhances user understanding of the module's functionality. --- claude-code/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index 39a133fe..088e52fd 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -55,9 +55,9 @@ module "claude-code" { } ``` -## Run as a standalone app +## Run standalone -Run Claude Code as a standalone app in your workspace. This will install Claude Code and run it directly without using screen. +Run Claude Code as a standalone app in your workspace. This will install Claude Code and run it directly without using screen or any task reporting to the Coder UI. ```tf module "claude-code" { From b58b0769269b262e88a5976db75f5deaaebc9616 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 16:23:07 +0000 Subject: [PATCH 10/34] goose goose --- .icons/goose.svg | 4 ++ claude-code/README.md | 3 +- goose/README.md | 74 +++++++++++++++++++ goose/main.tf | 162 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 .icons/goose.svg create mode 100644 goose/README.md create mode 100644 goose/main.tf diff --git a/.icons/goose.svg b/.icons/goose.svg new file mode 100644 index 00000000..cbbe8419 --- /dev/null +++ b/.icons/goose.svg @@ -0,0 +1,4 @@ + + + + diff --git a/claude-code/README.md b/claude-code/README.md index 088e52fd..f3c34c91 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -19,7 +19,8 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude ## Examples ### Run in the background and report tasks (Experimental) -Your workspace must have `screen` installed to use this. In this example, we'll attempt to install `screen` if it's not already installed. + +Your workspace must have `screen` installed to use this. ```tf data "coder_parameter" "ai_prompt" { diff --git a/goose/README.md b/goose/README.md new file mode 100644 index 00000000..f1d665e5 --- /dev/null +++ b/goose/README.md @@ -0,0 +1,74 @@ +--- +display_name: Goose +description: Run Goose in your workspace +icon: ../.icons/goose.svg +maintainer_github: coder +verified: true +tags: [agent, goose] +--- + +# Goose + +Run the [Goose](https://block.github.io/goose/) agent in your workspace to generate code and perform tasks. + +### Prerequisites + +- `screen` must be installed in your workspace to run Goose in the background + +## Examples + +Your workspace must have `screen` installed to use this. + +### Run in the background and report tasks (Experimental) + +```tf +data "coder_parameter" "ai_prompt" { + type = "string" + name = "AI Prompt" + default = "" + description = "Write a prompt for Goose" + mutable = true +} + +# Set the prompt and system prompt for Goose via environment variables +resource "coder_agent" "main" { + env = { + GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value + SYSTEM_PROMPT =<<-EOT + You are a helpful assistant that can help with code. + EOT + } +} + +module "goose" { + count = data.coder_workspace.me.start_count + source = "registry.coder.com/modules/goose/coder" + version = "1.0.29" + agent_id = coder_agent.example.id + folder = "/home/coder" + install_goose = true + goose_version = "v1.0.16" + + # Enable experimental features + experiment_use_screen = true + experiment_report_tasks = true +} +``` + +## Run standalone + +Run Goose as a standalone app in your workspace. This will install Goose and run it directly without using screen or any task reporting to the Coder UI. + +```tf +module "goose" { + source = "registry.coder.com/modules/goose/coder" + version = "1.0.29" + agent_id = coder_agent.example.id + folder = "/home/coder" + install_goose = true + goose_version = "v1.0.16" + + # Icon is not available in Coder v2.20 and below, so we'll use a custom icon URL + icon = "https://raw.githubusercontent.com/block/goose/refs/heads/main/ui/desktop/src/images/icon.svg" +} +``` \ No newline at end of file diff --git a/goose/main.tf b/goose/main.tf new file mode 100644 index 00000000..b914293e --- /dev/null +++ b/goose/main.tf @@ -0,0 +1,162 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + coder = { + source = "coder/coder" + version = ">= 0.17" + } + } +} + +variable "agent_id" { + type = string + description = "The ID of a Coder agent." +} + +data "coder_workspace" "me" {} + +data "coder_workspace_owner" "me" {} + +variable "order" { + type = number + description = "The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order)." + default = null +} + +variable "icon" { + type = string + description = "The icon to use for the app." + default = "/icon/claude.svg" +} + +variable "folder" { + type = string + description = "The folder to run Goose in." + default = "/home/coder" +} + +variable "install_goose" { + type = bool + description = "Whether to install Goose." + default = true +} + +variable "goose_version" { + type = string + description = "The version of Goose to install." + default = "stable" +} + +variable "experiment_use_screen" { + type = bool + description = "Whether to use screen for running Goose in the background." + default = false +} + +variable "experiment_report_tasks" { + type = bool + description = "Whether to enable task reporting." + default = false +} + +# Install and Initialize Goose +resource "coder_script" "goose" { + agent_id = var.agent_id + display_name = "Goose" + icon = var.icon + script = <<-EOT + #!/bin/bash + set -e + + # Function to check if a command exists + command_exists() { + command -v "$1" >/dev/null 2>&1 + } + + # Install Goose if enabled + if [ "${var.install_goose}" = "true" ]; then + if ! command_exists npm; then + echo "Error: npm is not installed. Please install Node.js and npm first." + exit 1 + fi + echo "Installing Goose..." + RELEASE_TAG=v${var.goose_version} curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | CONFIGURE=false bash + fi + + # Debug output + echo "experiment_use_screen value: `${var.experiment_use_screen}`" + + # Run with screen if enabled + if [ "${var.experiment_use_screen}" = "true" ]; then + echo "Running Goose in the background..." + + # Check if screen is installed + if ! command_exists screen; then + echo "Error: screen is not installed. Please install screen manually." + exit 1 + fi + + touch "$HOME/.goose.log" + + # Ensure the screenrc exists + if [ ! -f "$HOME/.screenrc" ]; then + echo "Creating ~/.screenrc and adding multiuser settings..." | tee -a "$HOME/.goose.log" + echo -e "multiuser on\nacladd $(whoami)" > "$HOME/.screenrc" + fi + + if ! grep -q "^multiuser on$" "$HOME/.screenrc"; then + echo "Adding 'multiuser on' to ~/.screenrc..." | tee -a "$HOME/.goose.log" + echo "multiuser on" >> "$HOME/.screenrc" + fi + + if ! grep -q "^acladd $(whoami)$" "$HOME/.screenrc"; then + echo "Adding 'acladd $(whoami)' to ~/.screenrc..." | tee -a "$HOME/.goose.log" + echo "acladd $(whoami)" >> "$HOME/.screenrc" + fi + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + + screen -U -dmS goose bash -c ' + cd ${var.folder} + claude | tee -a "$HOME/.goose.log" + exec bash + ' + else + # Check if claude is installed before running + if ! command_exists claude; then + echo "Error: Goose is not installed. Please enable install_goose or install it manually." + exit 1 + fi + fi + EOT + run_on_start = true +} + +resource "coder_app" "goose" { + slug = "goose" + display_name = "Goose" + agent_id = var.agent_id + command = <<-EOT + #!/bin/bash + set -e + + if [ "${var.experiment_use_screen}" = "true" ]; then + if screen -list | grep -q "goose"; then + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + echo "Attaching to existing Goose session." | tee -a "$HOME/.goose.log" + screen -xRR goose + else + echo "Starting a new Goose session." | tee -a "$HOME/.goose.log" + screen -S goose bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$HOME/.goose.log"; exec bash' + fi + else + cd ${var.folder} + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + claude + fi + EOT + icon = var.icon +} From d2c16d8a7c729eeafa6d34ff21527aa83814c64c Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 16:23:52 +0000 Subject: [PATCH 11/34] goose --- goose/main.tf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/goose/main.tf b/goose/main.tf index b914293e..71c58002 100644 --- a/goose/main.tf +++ b/goose/main.tf @@ -27,7 +27,7 @@ variable "order" { variable "icon" { type = string description = "The icon to use for the app." - default = "/icon/claude.svg" + default = "/icon/goose.svg" } variable "folder" { @@ -119,12 +119,12 @@ resource "coder_script" "goose" { screen -U -dmS goose bash -c ' cd ${var.folder} - claude | tee -a "$HOME/.goose.log" + goose | tee -a "$HOME/.goose.log" exec bash ' else - # Check if claude is installed before running - if ! command_exists claude; then + # Check if goose is installed before running + if ! command_exists goose; then echo "Error: Goose is not installed. Please enable install_goose or install it manually." exit 1 fi @@ -149,13 +149,13 @@ resource "coder_app" "goose" { screen -xRR goose else echo "Starting a new Goose session." | tee -a "$HOME/.goose.log" - screen -S goose bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$HOME/.goose.log"; exec bash' + screen -S goose bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; goose | tee -a "$HOME/.goose.log"; exec bash' fi else cd ${var.folder} export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 - claude + goose fi EOT icon = var.icon From d4af9172983678418e4444a275deb23b8a0c6a90 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 16:29:01 +0000 Subject: [PATCH 12/34] absolute path --- goose/main.tf | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/goose/main.tf b/goose/main.tf index 71c58002..90da6f54 100644 --- a/goose/main.tf +++ b/goose/main.tf @@ -83,9 +83,6 @@ resource "coder_script" "goose" { echo "Installing Goose..." RELEASE_TAG=v${var.goose_version} curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | CONFIGURE=false bash fi - - # Debug output - echo "experiment_use_screen value: `${var.experiment_use_screen}`" # Run with screen if enabled if [ "${var.experiment_use_screen}" = "true" ]; then @@ -119,12 +116,12 @@ resource "coder_script" "goose" { screen -U -dmS goose bash -c ' cd ${var.folder} - goose | tee -a "$HOME/.goose.log" + $HOME/.local/bin/goose | tee -a "$HOME/.goose.log" exec bash ' else # Check if goose is installed before running - if ! command_exists goose; then + if ! command_exists $HOME/.local/bin/goose; then echo "Error: Goose is not installed. Please enable install_goose or install it manually." exit 1 fi From 6fb9b0dbfa24d24dbb9a1a21df1106e80535c65f Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 16:35:23 +0000 Subject: [PATCH 13/34] fix --- goose/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goose/main.tf b/goose/main.tf index 90da6f54..16aa2cda 100644 --- a/goose/main.tf +++ b/goose/main.tf @@ -152,7 +152,7 @@ resource "coder_app" "goose" { cd ${var.folder} export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 - goose + $HOME/.local/bin/goose fi EOT icon = var.icon From 21c36fcfd87cb513cf2bdcd824ca419307397f88 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 20:22:41 +0000 Subject: [PATCH 14/34] add auto config --- claude-code/README.md | 3 ++- goose/README.md | 21 +++++++++++++++++-- goose/main.tf | 48 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 3 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index f3c34c91..dd8c4e1c 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -33,9 +33,10 @@ data "coder_parameter" "ai_prompt" { # Set the prompt and system prompt for Claude Code via environment variables resource "coder_agent" "main" { + # ... env = { CLAUDE_TASK_PROMPT = data.coder_parameter.ai_prompt.value - SYSTEM_PROMPT =<<-EOT + SYSTEM_PROMPT = <<-EOT You are a helpful assistant that can help with code. EOT } diff --git a/goose/README.md b/goose/README.md index f1d665e5..5d35a61e 100644 --- a/goose/README.md +++ b/goose/README.md @@ -22,6 +22,12 @@ Your workspace must have `screen` installed to use this. ### Run in the background and report tasks (Experimental) ```tf +variable "anthropic_api_key" { + type = string + description = "The Anthropic API key" + sensitive = true +} + data "coder_parameter" "ai_prompt" { type = "string" name = "AI Prompt" @@ -32,11 +38,16 @@ data "coder_parameter" "ai_prompt" { # Set the prompt and system prompt for Goose via environment variables resource "coder_agent" "main" { + # ... env = { GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value SYSTEM_PROMPT =<<-EOT You are a helpful assistant that can help with code. EOT + + # An API key is required for experiment_auto_configure + # See https://block.github.io/goose/docs/getting-started/providers + ANTHROPIC_API_KEY = var.anthropic_api_key } } @@ -50,8 +61,14 @@ module "goose" { goose_version = "v1.0.16" # Enable experimental features - experiment_use_screen = true - experiment_report_tasks = true + experiment_report_tasks = true + + # Avoid configuring Goose manually + experiment_auto_configure = true + + # Required for experiment_auto_configure + experiment_goose_provider = "anthropic" + experiment_goose_model = "claude-3-5-sonnet-latest" } ``` diff --git a/goose/main.tf b/goose/main.tf index 16aa2cda..8fc3734e 100644 --- a/goose/main.tf +++ b/goose/main.tf @@ -60,6 +60,24 @@ variable "experiment_report_tasks" { default = false } +variable "experiment_auto_configure" { + type = bool + description = "Whether to automatically configure Goose." + default = false +} + +variable "experiment_goose_provider" { + type = string + description = "The provider to use for Goose (e.g., anthropic)." + default = null +} + +variable "experiment_goose_model" { + type = string + description = "The model to use for Goose (e.g., claude-3-5-sonnet-latest)." + default = null +} + # Install and Initialize Goose resource "coder_script" "goose" { agent_id = var.agent_id @@ -83,6 +101,36 @@ resource "coder_script" "goose" { echo "Installing Goose..." RELEASE_TAG=v${var.goose_version} curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | CONFIGURE=false bash fi + + # Configure Goose if auto-configure is enabled + if [ "${var.experiment_auto_configure}" = "true" ]; then + echo "Configuring Goose..." + mkdir -p "$HOME/.config/goose" + cat > "$HOME/.config/goose/config.yaml" << EOL +GOOSE_PROVIDER: ${var.experiment_goose_provider} +GOOSE_MODEL: ${var.experiment_goose_model} +extensions: + coder: + args: + - exp + - mcp + - server + cmd: coder + description: Report ALL tasks and statuses (in progress, done, failed) before and after starting + enabled: true + envs: + CODER_MCP_APP_STATUS_SLUG: goose + name: Coder + timeout: 3000 + type: stdio + developer: + display_name: Developer + enabled: true + name: developer + timeout: 300 + type: builtin +EOL + fi # Run with screen if enabled if [ "${var.experiment_use_screen}" = "true" ]; then From cf178d4879743d682b2b7f02c390fe8e5dda4ff0 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 20:38:31 +0000 Subject: [PATCH 15/34] goose --- goose/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goose/main.tf b/goose/main.tf index 8fc3734e..41ee7580 100644 --- a/goose/main.tf +++ b/goose/main.tf @@ -164,7 +164,7 @@ EOL screen -U -dmS goose bash -c ' cd ${var.folder} - $HOME/.local/bin/goose | tee -a "$HOME/.goose.log" + $HOME/.local/bin/goose --text "Always report status and instructions to Coder, before and after your steps. Your task: $GOOSE_PROMPT" --interactive | tee -a "$HOME/.goose.log" exec bash ' else @@ -194,7 +194,7 @@ resource "coder_app" "goose" { screen -xRR goose else echo "Starting a new Goose session." | tee -a "$HOME/.goose.log" - screen -S goose bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; goose | tee -a "$HOME/.goose.log"; exec bash' + screen -S goose bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; $HOME/.local/bin/goose --text "Always report status and instructions to Coder, before and after your steps" --interactive | tee -a "$HOME/.goose.log"; exec bash' fi else cd ${var.folder} From 11a191f9822e24e159a288beabd891d253be7072 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 20:42:42 +0000 Subject: [PATCH 16/34] fix --- goose/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goose/main.tf b/goose/main.tf index 41ee7580..a577107f 100644 --- a/goose/main.tf +++ b/goose/main.tf @@ -164,7 +164,7 @@ EOL screen -U -dmS goose bash -c ' cd ${var.folder} - $HOME/.local/bin/goose --text "Always report status and instructions to Coder, before and after your steps. Your task: $GOOSE_PROMPT" --interactive | tee -a "$HOME/.goose.log" + $HOME/.local/bin/goose run --text "Always report status and instructions to Coder, before and after your steps. Your task: $GOOSE_PROMPT" --interactive | tee -a "$HOME/.goose.log" exec bash ' else @@ -194,7 +194,7 @@ resource "coder_app" "goose" { screen -xRR goose else echo "Starting a new Goose session." | tee -a "$HOME/.goose.log" - screen -S goose bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; $HOME/.local/bin/goose --text "Always report status and instructions to Coder, before and after your steps" --interactive | tee -a "$HOME/.goose.log"; exec bash' + screen -S goose bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; $HOME/.local/bin/goose run --text "Always report status and instructions to Coder, before and after your steps" --interactive | tee -a "$HOME/.goose.log"; exec bash' fi else cd ${var.folder} From b738bc3ac33392b62bf2b27e998f043a89cc08a9 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 20:46:18 +0000 Subject: [PATCH 17/34] fix --- goose/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goose/main.tf b/goose/main.tf index a577107f..8da8ca3b 100644 --- a/goose/main.tf +++ b/goose/main.tf @@ -164,7 +164,7 @@ EOL screen -U -dmS goose bash -c ' cd ${var.folder} - $HOME/.local/bin/goose run --text "Always report status and instructions to Coder, before and after your steps. Your task: $GOOSE_PROMPT" --interactive | tee -a "$HOME/.goose.log" + $HOME/.local/bin/goose run --text "Always report status and instructions to Coder, before and after your steps. Your task: $GOOSE_TASK_PROMPT" --interactive | tee -a "$HOME/.goose.log" exec bash ' else From ce83031dc0a020b9ebf9a968d2b32cc164216951 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 20:58:05 +0000 Subject: [PATCH 18/34] clean up goose --- claude-code/README.md | 7 +++++++ goose/README.md | 15 +++++++++++---- goose/main.tf | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index dd8c4e1c..80c25d34 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -20,6 +20,13 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude ### Run in the background and report tasks (Experimental) +> This functionality is in early access and subject to change. Do not run in +> production as it is unstable. Instead, deploy these changes into a demo or +> staging environment. +> +> Join our [Discord channel](https://discord.gg/coder) or +> [contact us](https://coder.com/contact) to get help or share feedback. + Your workspace must have `screen` installed to use this. ```tf diff --git a/goose/README.md b/goose/README.md index 5d35a61e..0a769551 100644 --- a/goose/README.md +++ b/goose/README.md @@ -21,6 +21,13 @@ Your workspace must have `screen` installed to use this. ### Run in the background and report tasks (Experimental) +> This functionality is in early access and subject to change. Do not run in +> production as it is unstable. Instead, deploy these changes into a demo or +> staging environment. +> +> Join our [Discord channel](https://discord.gg/coder) or +> [contact us](https://coder.com/contact) to get help or share feedback. + ```tf variable "anthropic_api_key" { type = string @@ -40,14 +47,14 @@ data "coder_parameter" "ai_prompt" { resource "coder_agent" "main" { # ... env = { - GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value - SYSTEM_PROMPT =<<-EOT - You are a helpful assistant that can help with code. + GOOSE_SYSTEM_PROMPT = <<-EOT + You are a helpful assistant that can help with code. Run long running tasks in the background and not in the foreground. Notify Coder of the status of the task before and after your steps. EOT + GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value # An API key is required for experiment_auto_configure # See https://block.github.io/goose/docs/getting-started/providers - ANTHROPIC_API_KEY = var.anthropic_api_key + ANTHROPIC_API_KEY = var.anthropic_api_key # or use a coder_parameter } } diff --git a/goose/main.tf b/goose/main.tf index 8da8ca3b..fcb6baaa 100644 --- a/goose/main.tf +++ b/goose/main.tf @@ -164,7 +164,7 @@ EOL screen -U -dmS goose bash -c ' cd ${var.folder} - $HOME/.local/bin/goose run --text "Always report status and instructions to Coder, before and after your steps. Your task: $GOOSE_TASK_PROMPT" --interactive | tee -a "$HOME/.goose.log" + $HOME/.local/bin/goose run --text "$GOOSE_SYSTEM_PROMPT. Your task: $GOOSE_TASK_PROMPT" --interactive | tee -a "$HOME/.goose.log" exec bash ' else From dd303470497e95f9ab28fe6b3ca195cac2bef02b Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 21:06:47 +0000 Subject: [PATCH 19/34] fix prompt --- goose/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/goose/README.md b/goose/README.md index 0a769551..e899b430 100644 --- a/goose/README.md +++ b/goose/README.md @@ -48,7 +48,13 @@ resource "coder_agent" "main" { # ... env = { GOOSE_SYSTEM_PROMPT = <<-EOT - You are a helpful assistant that can help with code. Run long running tasks in the background and not in the foreground. Notify Coder of the status of the task before and after your steps. + You are a helpful assistant that can help write code. + + Run all long running tasks (e.g. npm run dev) in the background and not in the foreground. + + Periodically check in on background tasks. + + Notify Coder of the status of the task before and after your steps. EOT GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value From d8cc782c06b96cc4a22dcf7937aa55e748053350 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 21:19:04 +0000 Subject: [PATCH 20/34] fixes --- claude-code/README.md | 5 +++-- claude-code/main.tf | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index 80c25d34..9df0915e 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -42,8 +42,9 @@ data "coder_parameter" "ai_prompt" { resource "coder_agent" "main" { # ... env = { - CLAUDE_TASK_PROMPT = data.coder_parameter.ai_prompt.value - SYSTEM_PROMPT = <<-EOT + CLAUDE_TASK_PROMPT = data.coder_parameter.ai_prompt.value + CODER_MCP_APP_STATUS_SLUG = "claude-code" + CODER_MCP_CLAUDE_SYSTEM_PROMPT = <<-EOT You are a helpful assistant that can help with code. EOT } diff --git a/claude-code/main.tf b/claude-code/main.tf index af9574bb..787d54ad 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -84,9 +84,11 @@ resource "coder_script" "claude_code" { npm install -g @anthropic-ai/claude-code@${var.claude_code_version} fi - # Debug output - echo "experiment_use_screen value: `${var.experiment_use_screen}`" - + if [ "${var.experiment_report_tasks}" = "true" ]; then + echo "Configuring Claude Code to report tasks via Coder MCP..." + coder exp mcp configure claude-code ${var.folder} + fi + # Run with screen if enabled if [ "${var.experiment_use_screen}" = "true" ]; then echo "Running Claude Code in the background..." @@ -119,7 +121,7 @@ resource "coder_script" "claude_code" { screen -U -dmS claude-code bash -c ' cd ${var.folder} - claude | tee -a "$HOME/.claude-code.log" + claude --dangerously-skip-permissions | tee -a "$HOME/.claude-code.log" exec bash ' else @@ -149,7 +151,7 @@ resource "coder_app" "claude_code" { screen -xRR claude-code else echo "Starting a new Claude Code session." | tee -a "$HOME/.claude-code.log" - screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude | tee -a "$HOME/.claude-code.log"; exec bash' + screen -S claude-code bash -c 'export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; claude --dangerously-skip-permissions | tee -a "$HOME/.claude-code.log"; exec bash' fi else cd ${var.folder} From 56f02af86e18db8ff779effc9585d8c6f4060e3f Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 21:27:29 +0000 Subject: [PATCH 21/34] fix --- claude-code/README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index 9df0915e..9ce59a38 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -30,6 +30,12 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude Your workspace must have `screen` installed to use this. ```tf +variable "anthropic_api_key" { + type = string + description = "The Anthropic API key" + sensitive = true +} + data "coder_parameter" "ai_prompt" { type = "string" name = "AI Prompt" @@ -42,9 +48,10 @@ data "coder_parameter" "ai_prompt" { resource "coder_agent" "main" { # ... env = { - CLAUDE_TASK_PROMPT = data.coder_parameter.ai_prompt.value - CODER_MCP_APP_STATUS_SLUG = "claude-code" - CODER_MCP_CLAUDE_SYSTEM_PROMPT = <<-EOT + CODER_MCP_CLAUDE_API_KEY = var.anthropic_api_key # or use a coder_parameter + CODER_MCP_CLAUDE_TASK_PROMPT = data.coder_parameter.ai_prompt.value + CODER_MCP_APP_STATUS_SLUG = "claude-code" + CODER_MCP_CLAUDE_SYSTEM_PROMPT = <<-EOT You are a helpful assistant that can help with code. EOT } From 66998cdd6e30b0c4c950c58f36f05f402672a301 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 21:32:59 +0000 Subject: [PATCH 22/34] start the task --- claude-code/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index 787d54ad..62447273 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -121,7 +121,7 @@ resource "coder_script" "claude_code" { screen -U -dmS claude-code bash -c ' cd ${var.folder} - claude --dangerously-skip-permissions | tee -a "$HOME/.claude-code.log" + claude --dangerously-skip-permissions "$CODER_MCP_CLAUDE_TASK_PROMPT" | tee -a "$HOME/.claude-code.log" exec bash ' else From be0256499bd02a1ba1901b556e7516a778bfafa4 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 22:31:06 +0000 Subject: [PATCH 23/34] stuff --- claude-code/main.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index 62447273..6c7d62f6 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -121,9 +121,11 @@ resource "coder_script" "claude_code" { screen -U -dmS claude-code bash -c ' cd ${var.folder} - claude --dangerously-skip-permissions "$CODER_MCP_CLAUDE_TASK_PROMPT" | tee -a "$HOME/.claude-code.log" + claude --dangerously-skip-permissions | tee -a "$HOME/.claude-code.log" exec bash ' + screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT" + screen -S claude-code -X stuff "^M" else # Check if claude is installed before running if ! command_exists claude; then From d6813611714343a466e594de967f655eab355be0 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 22:32:44 +0000 Subject: [PATCH 24/34] ok --- claude-code/main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/claude-code/main.tf b/claude-code/main.tf index 6c7d62f6..69247f4f 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -124,7 +124,9 @@ resource "coder_script" "claude_code" { claude --dangerously-skip-permissions | tee -a "$HOME/.claude-code.log" exec bash ' + # Extremely hacky way to send the prompt to the screen session screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT" + sleep 0.5 screen -S claude-code -X stuff "^M" else # Check if claude is installed before running From 15b7b4b9636a30a90ec21854f6eb35ddf6d05756 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 22:36:11 +0000 Subject: [PATCH 25/34] test --- claude-code/main.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index 69247f4f..41785233 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -125,8 +125,7 @@ resource "coder_script" "claude_code" { exec bash ' # Extremely hacky way to send the prompt to the screen session - screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT" - sleep 0.5 + screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT^M" screen -S claude-code -X stuff "^M" else # Check if claude is installed before running From 5f35f9495d8750656106eb5e14c0a8876c7432c9 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 22:38:48 +0000 Subject: [PATCH 26/34] test --- claude-code/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index 41785233..31a8c95e 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -124,9 +124,9 @@ resource "coder_script" "claude_code" { claude --dangerously-skip-permissions | tee -a "$HOME/.claude-code.log" exec bash ' - # Extremely hacky way to send the prompt to the screen session + # Extremely hackys way to send the prompt to the screen session screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT^M" - screen -S claude-code -X stuff "^M" + screen -S claude-code -X stuff '^M' else # Check if claude is installed before running if ! command_exists claude; then From f8c837e9a954ce13b678c761b6e4e40f41788a9c Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 22:44:22 +0000 Subject: [PATCH 27/34] random test --- claude-code/main.tf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index 31a8c95e..1f7ce1ad 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -125,8 +125,9 @@ resource "coder_script" "claude_code" { exec bash ' # Extremely hackys way to send the prompt to the screen session - screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT^M" - screen -S claude-code -X stuff '^M' + screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT" + sleep 5 + screen -S claude-code -X stuff "^M" else # Check if claude is installed before running if ! command_exists claude; then From da3e80e273960fb831a0572ebca5b9297460c498 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 22:46:21 +0000 Subject: [PATCH 28/34] no sleep --- claude-code/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index 1f7ce1ad..b9491f5f 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -126,7 +126,7 @@ resource "coder_script" "claude_code" { ' # Extremely hackys way to send the prompt to the screen session screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT" - sleep 5 + # sleep 5 screen -S claude-code -X stuff "^M" else # Check if claude is installed before running From fa946ae78b6abe250ede10665754b5bce0d9d4e1 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Tue, 1 Apr 2025 22:48:49 +0000 Subject: [PATCH 29/34] tough sleep --- claude-code/main.tf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/claude-code/main.tf b/claude-code/main.tf index b9491f5f..349af17f 100644 --- a/claude-code/main.tf +++ b/claude-code/main.tf @@ -124,9 +124,11 @@ resource "coder_script" "claude_code" { claude --dangerously-skip-permissions | tee -a "$HOME/.claude-code.log" exec bash ' - # Extremely hackys way to send the prompt to the screen session + # Extremely hacky way to send the prompt to the screen session + # This will be fixed in the future, but `claude` was not sending MCP + # tasks when an initial prompt is provided. screen -S claude-code -X stuff "$CODER_MCP_CLAUDE_TASK_PROMPT" - # sleep 5 + sleep 5 screen -S claude-code -X stuff "^M" else # Check if claude is installed before running From e55d672ac1ecd77f314ebb11d0ee7bc19a7ca131 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 2 Apr 2025 00:09:16 +0000 Subject: [PATCH 30/34] fixes --- claude-code/README.md | 10 ++++++++++ goose/README.md | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/claude-code/README.md b/claude-code/README.md index 9ce59a38..d13a55c6 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -15,6 +15,9 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude - Node.js and npm must be installed in your workspace to install Claude Code - `screen` must be installed in your workspace to run Claude Code in the background +- You must add the [Coder Login](https://registry.coder.com/modules/coder-login) module to your template + +The `codercom/oss-dogfood:latest` container image can be used for testing on container-based workspaces. ## Examples @@ -36,6 +39,13 @@ variable "anthropic_api_key" { sensitive = true } +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 +} + data "coder_parameter" "ai_prompt" { type = "string" name = "AI Prompt" diff --git a/goose/README.md b/goose/README.md index e899b430..3a45dc0a 100644 --- a/goose/README.md +++ b/goose/README.md @@ -14,6 +14,9 @@ Run the [Goose](https://block.github.io/goose/) agent in your workspace to gener ### Prerequisites - `screen` must be installed in your workspace to run Goose in the background +- You must add the [Coder Login](https://registry.coder.com/modules/coder-login) module to your template + +The `codercom/oss-dogfood:latest` container image can be used for testing on container-based workspaces. ## Examples @@ -29,6 +32,13 @@ Your workspace must have `screen` installed to use this. > [contact us](https://coder.com/contact) to get help or share feedback. ```tf +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 = "The Anthropic API key" From 6339b9cbbc5f171dc01877ea93120ca236e3901c Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 2 Apr 2025 00:17:32 +0000 Subject: [PATCH 31/34] remove test --- filebrowser/main.test.ts | 114 --------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 filebrowser/main.test.ts diff --git a/filebrowser/main.test.ts b/filebrowser/main.test.ts deleted file mode 100644 index 368075b2..00000000 --- a/filebrowser/main.test.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { describe, expect, it } from "bun:test"; -import { - executeScriptInContainer, - runTerraformApply, - runTerraformInit, - testRequiredVariables, -} from "../test"; - -describe("filebrowser", async () => { - await runTerraformInit(import.meta.dir); - - testRequiredVariables(import.meta.dir, { - agent_id: "foo", - }); - - it("fails with wrong database_path", async () => { - const state = await runTerraformApply(import.meta.dir, { - agent_id: "foo", - database_path: "nofb", - }).catch((e) => { - if (!e.message.startsWith("\nError: Invalid value for variable")) { - throw e; - } - }); - }); - - it("runs with default", async () => { - const state = await runTerraformApply(import.meta.dir, { - agent_id: "foo", - }); - const output = await executeScriptInContainer(state, "alpine"); - expect(output.exitCode).toBe(0); - expect(output.stdout).toEqual([ - "\u001b[0;1mInstalling filebrowser ", - "", - "🥳 Installation complete! ", - "", - "👷 Starting filebrowser in background... ", - "", - "📂 Serving /root at http://localhost:13339 ", - "", - "Running 'filebrowser --noauth --root /root --port 13339 --baseurl ' ", - "", - "📝 Logs at /tmp/filebrowser.log", - ]); - }); - - it("runs with database_path var", async () => { - const state = await runTerraformApply(import.meta.dir, { - agent_id: "foo", - database_path: ".config/filebrowser.db", - }); - const output = await executeScriptInContainer(state, "alpine"); - expect(output.exitCode).toBe(0); - expect(output.stdout).toEqual([ - "\u001b[0;1mInstalling filebrowser ", - "", - "🥳 Installation complete! ", - "", - "👷 Starting filebrowser in background... ", - "", - "📂 Serving /root at http://localhost:13339 ", - "", - "Running 'filebrowser --noauth --root /root --port 13339 -d .config/filebrowser.db --baseurl ' ", - "", - "📝 Logs at /tmp/filebrowser.log", - ]); - }); - - it("runs with folder var", async () => { - const state = await runTerraformApply(import.meta.dir, { - agent_id: "foo", - folder: "/home/coder/project", - }); - const output = await executeScriptInContainer(state, "alpine"); - expect(output.exitCode).toBe(0); - expect(output.stdout).toEqual([ - "\u001b[0;1mInstalling filebrowser ", - "", - "🥳 Installation complete! ", - "", - "👷 Starting filebrowser in background... ", - "", - "📂 Serving /home/coder/project at http://localhost:13339 ", - "", - "Running 'filebrowser --noauth --root /home/coder/project --port 13339 --baseurl ' ", - "", - "📝 Logs at /tmp/filebrowser.log", - ]); - }); - - it("runs with subdomain=false", async () => { - const state = await runTerraformApply(import.meta.dir, { - agent_id: "foo", - agent_name: "main", - subdomain: false, - }); - const output = await executeScriptInContainer(state, "alpine"); - expect(output.exitCode).toBe(0); - expect(output.stdout).toEqual([ - "\u001B[0;1mInstalling filebrowser ", - "", - "🥳 Installation complete! ", - "", - "👷 Starting filebrowser in background... ", - "", - "📂 Serving /root at http://localhost:13339 ", - "", - "Running 'filebrowser --noauth --root /root --port 13339 --baseurl /@default/default.main/apps/filebrowser' ", - "", - "📝 Logs at /tmp/filebrowser.log", - ]); - }); -}); From fe0ba587fa56d839e0a8ac8d330e0bbf7c39e565 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 2 Apr 2025 00:43:33 +0000 Subject: [PATCH 32/34] fmt --- claude-code/README.md | 16 ++++++++-------- filebrowser/run.sh | 6 +++--- goose/README.md | 34 +++++++++++++++++----------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index d13a55c6..9ef8de10 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -58,10 +58,10 @@ data "coder_parameter" "ai_prompt" { resource "coder_agent" "main" { # ... env = { - CODER_MCP_CLAUDE_API_KEY = var.anthropic_api_key # or use a coder_parameter - CODER_MCP_CLAUDE_TASK_PROMPT = data.coder_parameter.ai_prompt.value - CODER_MCP_APP_STATUS_SLUG = "claude-code" - CODER_MCP_CLAUDE_SYSTEM_PROMPT = <<-EOT + CODER_MCP_CLAUDE_API_KEY = var.anthropic_api_key # or use a coder_parameter + CODER_MCP_CLAUDE_TASK_PROMPT = data.coder_parameter.ai_prompt.value + CODER_MCP_APP_STATUS_SLUG = "claude-code" + CODER_MCP_CLAUDE_SYSTEM_PROMPT = <<-EOT You are a helpful assistant that can help with code. EOT } @@ -77,8 +77,8 @@ module "claude-code" { claude_code_version = "0.2.57" # Enable experimental features - experiment_use_screen = true - experiment_report_tasks = true + experiment_use_screen = true + experiment_report_tasks = true } ``` @@ -96,6 +96,6 @@ module "claude-code" { claude_code_version = "latest" # Icon is not available in Coder v2.20 and below, so we'll use a custom icon URL - icon = "https://registry.npmmirror.com/@lobehub/icons-static-png/1.24.0/files/dark/claude-color.png" + icon = "https://registry.npmmirror.com/@lobehub/icons-static-png/1.24.0/files/dark/claude-color.png" } -``` \ No newline at end of file +``` diff --git a/filebrowser/run.sh b/filebrowser/run.sh index b8927582..84810e4e 100644 --- a/filebrowser/run.sh +++ b/filebrowser/run.sh @@ -22,11 +22,11 @@ export FB_DATABASE="${DB_PATH}" # Check if filebrowser db exists if [[ ! -f "${DB_PATH}" ]]; then - filebrowser config init 2>&1 | tee -a ${LOG_PATH} - filebrowser users add admin "" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH} + filebrowser config init 2>&1 | tee -a ${LOG_PATH} + filebrowser users add admin "" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH} fi -filebrowser config set --baseurl=${SERVER_BASE_PATH} --port=${PORT} --auth.method=noauth --root=$ROOT_DIR 2>&1 | tee -a ${LOG_PATH} +filebrowser config set --baseurl=${SERVER_BASE_PATH} --port=${PORT} --auth.method=noauth --root=$ROOT_DIR 2>&1 | tee -a ${LOG_PATH} printf "👷 Starting filebrowser in background... \n\n" diff --git a/goose/README.md b/goose/README.md index 3a45dc0a..bee81178 100644 --- a/goose/README.md +++ b/goose/README.md @@ -66,7 +66,7 @@ resource "coder_agent" "main" { Notify Coder of the status of the task before and after your steps. EOT - GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value + GOOSE_TASK_PROMPT = data.coder_parameter.ai_prompt.value # An API key is required for experiment_auto_configure # See https://block.github.io/goose/docs/getting-started/providers @@ -75,16 +75,16 @@ resource "coder_agent" "main" { } module "goose" { - count = data.coder_workspace.me.start_count - source = "registry.coder.com/modules/goose/coder" - version = "1.0.29" - agent_id = coder_agent.example.id - folder = "/home/coder" - install_goose = true - goose_version = "v1.0.16" + count = data.coder_workspace.me.start_count + source = "registry.coder.com/modules/goose/coder" + version = "1.0.29" + agent_id = coder_agent.example.id + folder = "/home/coder" + install_goose = true + goose_version = "v1.0.16" # Enable experimental features - experiment_report_tasks = true + experiment_report_tasks = true # Avoid configuring Goose manually experiment_auto_configure = true @@ -101,14 +101,14 @@ Run Goose as a standalone app in your workspace. This will install Goose and run ```tf module "goose" { - source = "registry.coder.com/modules/goose/coder" - version = "1.0.29" - agent_id = coder_agent.example.id - folder = "/home/coder" - install_goose = true - goose_version = "v1.0.16" + source = "registry.coder.com/modules/goose/coder" + version = "1.0.29" + agent_id = coder_agent.example.id + folder = "/home/coder" + install_goose = true + goose_version = "v1.0.16" # Icon is not available in Coder v2.20 and below, so we'll use a custom icon URL - icon = "https://raw.githubusercontent.com/block/goose/refs/heads/main/ui/desktop/src/images/icon.svg" + icon = "https://raw.githubusercontent.com/block/goose/refs/heads/main/ui/desktop/src/images/icon.svg" } -``` \ No newline at end of file +``` From f65c1365eac8e3d18184827e258127c559f74777 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 2 Apr 2025 00:46:14 +0000 Subject: [PATCH 33/34] fix --- claude-code/README.md | 11 +++++++++++ goose/README.md | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/claude-code/README.md b/claude-code/README.md index 9ef8de10..11ef1816 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -11,6 +11,17 @@ tags: [agent, claude-code] Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview) agent in your workspace to generate code and perform tasks. +```tf +module "claude-code" { + source = "registry.coder.com/modules/claude-code/coder" + version = "1.0.29" + agent_id = coder_agent.example.id + folder = "/home/coder" + install_claude_code = true + claude_code_version = "latest" +} +``` + ### Prerequisites - Node.js and npm must be installed in your workspace to install Claude Code diff --git a/goose/README.md b/goose/README.md index bee81178..41e8fc76 100644 --- a/goose/README.md +++ b/goose/README.md @@ -11,6 +11,17 @@ tags: [agent, goose] Run the [Goose](https://block.github.io/goose/) agent in your workspace to generate code and perform tasks. +```tf +module "goose" { + source = "registry.coder.com/modules/goose/coder" + version = "1.0.29" + agent_id = coder_agent.example.id + folder = "/home/coder" + install_goose = true + goose_version = "v1.0.16" +} +``` + ### Prerequisites - `screen` must be installed in your workspace to run Goose in the background From 13229c0af3a3ff47921a5e1d30b0bfa4357a18b8 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 2 Apr 2025 00:52:33 +0000 Subject: [PATCH 34/34] ok --- claude-code/README.md | 8 ++++---- filebrowser/README.md | 8 ++++---- goose/README.md | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/claude-code/README.md b/claude-code/README.md index 11ef1816..2422f174 100644 --- a/claude-code/README.md +++ b/claude-code/README.md @@ -14,7 +14,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude ```tf module "claude-code" { source = "registry.coder.com/modules/claude-code/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id folder = "/home/coder" install_claude_code = true @@ -53,7 +53,7 @@ variable "anthropic_api_key" { module "coder-login" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/coder-login/coder" - version = "1.0.15" + version = "1.0.31" agent_id = coder_agent.example.id } @@ -81,7 +81,7 @@ resource "coder_agent" "main" { module "claude-code" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/claude-code/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id folder = "/home/coder" install_claude_code = true @@ -100,7 +100,7 @@ Run Claude Code as a standalone app in your workspace. This will install Claude ```tf module "claude-code" { source = "registry.coder.com/modules/claude-code/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id folder = "/home/coder" install_claude_code = true diff --git a/filebrowser/README.md b/filebrowser/README.md index 13e06577..3a0e56bd 100644 --- a/filebrowser/README.md +++ b/filebrowser/README.md @@ -15,7 +15,7 @@ A file browser for your workspace. module "filebrowser" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/filebrowser/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id } ``` @@ -30,7 +30,7 @@ module "filebrowser" { module "filebrowser" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/filebrowser/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id folder = "/home/coder/project" } @@ -42,7 +42,7 @@ module "filebrowser" { module "filebrowser" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/filebrowser/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id database_path = ".config/filebrowser.db" } @@ -54,7 +54,7 @@ module "filebrowser" { module "filebrowser" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/filebrowser/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id agent_name = "main" subdomain = false diff --git a/goose/README.md b/goose/README.md index 41e8fc76..5735cb76 100644 --- a/goose/README.md +++ b/goose/README.md @@ -14,7 +14,7 @@ Run the [Goose](https://block.github.io/goose/) agent in your workspace to gener ```tf module "goose" { source = "registry.coder.com/modules/goose/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id folder = "/home/coder" install_goose = true @@ -46,7 +46,7 @@ Your workspace must have `screen` installed to use this. module "coder-login" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/coder-login/coder" - version = "1.0.15" + version = "1.0.31" agent_id = coder_agent.example.id } @@ -88,7 +88,7 @@ resource "coder_agent" "main" { module "goose" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/goose/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id folder = "/home/coder" install_goose = true @@ -113,7 +113,7 @@ Run Goose as a standalone app in your workspace. This will install Goose and run ```tf module "goose" { source = "registry.coder.com/modules/goose/coder" - version = "1.0.29" + version = "1.0.31" agent_id = coder_agent.example.id folder = "/home/coder" install_goose = true