Skip to content

Commit 83192ac

Browse files
Merge branch 'main' into main
2 parents e24e661 + bce0897 commit 83192ac

3 files changed

Lines changed: 43 additions & 12 deletions

File tree

registry/coder-labs/modules/gemini/README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Run [Gemini CLI](https://github.com/google-gemini/gemini-cli) in your workspace
1313
```tf
1414
module "gemini" {
1515
source = "registry.coder.com/coder-labs/gemini/coder"
16-
version = "3.0.0"
16+
version = "3.0.1"
1717
agent_id = coder_agent.main.id
1818
folder = "/home/coder/project"
1919
}
@@ -46,7 +46,7 @@ variable "gemini_api_key" {
4646
4747
module "gemini" {
4848
source = "registry.coder.com/coder-labs/gemini/coder"
49-
version = "3.0.0"
49+
version = "3.0.1"
5050
agent_id = coder_agent.main.id
5151
gemini_api_key = var.gemini_api_key
5252
folder = "/home/coder/project"
@@ -94,7 +94,7 @@ data "coder_parameter" "ai_prompt" {
9494
module "gemini" {
9595
count = data.coder_workspace.me.start_count
9696
source = "registry.coder.com/coder-labs/gemini/coder"
97-
version = "3.0.0"
97+
version = "3.0.1"
9898
agent_id = coder_agent.main.id
9999
gemini_api_key = var.gemini_api_key
100100
gemini_model = "gemini-2.5-flash"
@@ -105,6 +105,22 @@ module "gemini" {
105105
You are a helpful coding assistant. Always explain your code changes clearly.
106106
YOU MUST REPORT ALL TASKS TO CODER.
107107
EOT
108+
pre_install_script = <<-EOT
109+
#!/bin/bash
110+
set -e
111+
112+
echo "Installing Node.js via NodeSource..."
113+
114+
sudo apt-get update -qq && sudo apt-get install -y curl ca-certificates
115+
116+
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
117+
118+
sudo apt-get install -y nodejs
119+
120+
echo "Node version: $(node -v)"
121+
echo "npm version: $(npm -v)"
122+
echo "Node install complete."
123+
EOT
108124
}
109125
```
110126

@@ -118,7 +134,7 @@ For enterprise users who prefer Google's Vertex AI platform:
118134
```tf
119135
module "gemini" {
120136
source = "registry.coder.com/coder-labs/gemini/coder"
121-
version = "3.0.0"
137+
version = "3.0.1"
122138
agent_id = coder_agent.main.id
123139
gemini_api_key = var.gemini_api_key
124140
folder = "/home/coder/project"

registry/coder-labs/modules/gemini/main.tf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,16 @@ locals {
148148
base_extensions = <<-EOT
149149
{
150150
"coder": {
151+
"command": "coder",
151152
"args": [
152153
"exp",
153154
"mcp",
154155
"server"
155156
],
156-
"command": "coder",
157-
"description": "Report ALL tasks and statuses (in progress, done, failed) you are working on.",
158-
"enabled": true,
159157
"env": {
160158
"CODER_MCP_APP_STATUS_SLUG": "${local.app_slug}",
161159
"CODER_MCP_AI_AGENTAPI_URL": "http://localhost:3284"
162-
},
163-
"name": "Coder",
164-
"timeout": 3000,
165-
"type": "stdio",
166-
"trust": true
160+
}
167161
}
168162
}
169163
EOT

registry/coder-labs/modules/gemini/scripts/install.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ echo "--------------------------------"
1717
printf "gemini_config: %s\n" "$ARG_GEMINI_CONFIG"
1818
printf "install: %s\n" "$ARG_INSTALL"
1919
printf "gemini_version: %s\n" "$ARG_GEMINI_VERSION"
20+
printf "BASE_EXTENSIONS: %s\n" "$BASE_EXTENSIONS"
2021
echo "--------------------------------"
2122

2223
set +o nounset
@@ -140,6 +141,25 @@ function add_system_prompt_if_exists() {
140141
fi
141142
}
142143

144+
function patch_coder_mcp_command() {
145+
CODER_BIN=$(which coder)
146+
SETTINGS_PATH="$HOME/.gemini/settings.json"
147+
148+
if [ -z "$CODER_BIN" ]; then
149+
printf "Warning: could not find coder binary, MCP command path not patched.\n"
150+
return
151+
fi
152+
153+
printf "Patching coder MCP command path to: %s\n" "$CODER_BIN"
154+
155+
TMP_SETTINGS=$(mktemp)
156+
jq --arg bin "$CODER_BIN" \
157+
'.mcpServers.coder.command = $bin' \
158+
"$SETTINGS_PATH" > "$TMP_SETTINGS" && mv "$TMP_SETTINGS" "$SETTINGS_PATH"
159+
160+
printf "Patch complete.\n"
161+
}
162+
143163
function configure_mcp() {
144164
export CODER_MCP_APP_STATUS_SLUG="gemini"
145165
export CODER_MCP_AI_AGENTAPI_URL="http://localhost:3284"
@@ -149,4 +169,5 @@ function configure_mcp() {
149169
install_gemini
150170
populate_settings_json
151171
add_system_prompt_if_exists
172+
patch_coder_mcp_command
152173
configure_mcp

0 commit comments

Comments
 (0)