diff --git a/registry/coder-labs/modules/gemini/README.md b/registry/coder-labs/modules/gemini/README.md index d0a113a0..57842ac6 100644 --- a/registry/coder-labs/modules/gemini/README.md +++ b/registry/coder-labs/modules/gemini/README.md @@ -13,7 +13,7 @@ Run [Gemini CLI](https://github.com/google-gemini/gemini-cli) in your workspace ```tf module "gemini" { source = "registry.coder.com/coder-labs/gemini/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.main.id folder = "/home/coder/project" } @@ -46,7 +46,7 @@ variable "gemini_api_key" { module "gemini" { source = "registry.coder.com/coder-labs/gemini/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.main.id gemini_api_key = var.gemini_api_key folder = "/home/coder/project" @@ -94,7 +94,7 @@ data "coder_parameter" "ai_prompt" { module "gemini" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder-labs/gemini/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.main.id gemini_api_key = var.gemini_api_key gemini_model = "gemini-2.5-flash" @@ -105,6 +105,22 @@ module "gemini" { You are a helpful coding assistant. Always explain your code changes clearly. YOU MUST REPORT ALL TASKS TO CODER. EOT + pre_install_script = <<-EOT + #!/bin/bash + set -e + + echo "Installing Node.js via NodeSource..." + + sudo apt-get update -qq && sudo apt-get install -y curl ca-certificates + + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash - + + sudo apt-get install -y nodejs + + echo "Node version: $(node -v)" + echo "npm version: $(npm -v)" + echo "Node install complete." + EOT } ``` @@ -118,7 +134,7 @@ For enterprise users who prefer Google's Vertex AI platform: ```tf module "gemini" { source = "registry.coder.com/coder-labs/gemini/coder" - version = "3.0.0" + version = "3.0.1" agent_id = coder_agent.main.id gemini_api_key = var.gemini_api_key folder = "/home/coder/project" diff --git a/registry/coder-labs/modules/gemini/main.tf b/registry/coder-labs/modules/gemini/main.tf index dbc81bc7..336c112f 100644 --- a/registry/coder-labs/modules/gemini/main.tf +++ b/registry/coder-labs/modules/gemini/main.tf @@ -148,22 +148,16 @@ locals { base_extensions = <<-EOT { "coder": { + "command": "coder", "args": [ "exp", "mcp", "server" ], - "command": "coder", - "description": "Report ALL tasks and statuses (in progress, done, failed) you are working on.", - "enabled": true, "env": { "CODER_MCP_APP_STATUS_SLUG": "${local.app_slug}", "CODER_MCP_AI_AGENTAPI_URL": "http://localhost:3284" - }, - "name": "Coder", - "timeout": 3000, - "type": "stdio", - "trust": true + } } } EOT diff --git a/registry/coder-labs/modules/gemini/scripts/install.sh b/registry/coder-labs/modules/gemini/scripts/install.sh index 7b70a6af..ce44beb9 100644 --- a/registry/coder-labs/modules/gemini/scripts/install.sh +++ b/registry/coder-labs/modules/gemini/scripts/install.sh @@ -17,6 +17,7 @@ echo "--------------------------------" printf "gemini_config: %s\n" "$ARG_GEMINI_CONFIG" printf "install: %s\n" "$ARG_INSTALL" printf "gemini_version: %s\n" "$ARG_GEMINI_VERSION" +printf "BASE_EXTENSIONS: %s\n" "$BASE_EXTENSIONS" echo "--------------------------------" set +o nounset @@ -140,6 +141,25 @@ function add_system_prompt_if_exists() { fi } +function patch_coder_mcp_command() { + CODER_BIN=$(which coder) + SETTINGS_PATH="$HOME/.gemini/settings.json" + + if [ -z "$CODER_BIN" ]; then + printf "Warning: could not find coder binary, MCP command path not patched.\n" + return + fi + + printf "Patching coder MCP command path to: %s\n" "$CODER_BIN" + + TMP_SETTINGS=$(mktemp) + jq --arg bin "$CODER_BIN" \ + '.mcpServers.coder.command = $bin' \ + "$SETTINGS_PATH" > "$TMP_SETTINGS" && mv "$TMP_SETTINGS" "$SETTINGS_PATH" + + printf "Patch complete.\n" +} + function configure_mcp() { export CODER_MCP_APP_STATUS_SLUG="gemini" export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284" @@ -149,4 +169,5 @@ function configure_mcp() { install_gemini populate_settings_json add_system_prompt_if_exists +patch_coder_mcp_command configure_mcp