Compare commits

..

6 Commits

Author SHA1 Message Date
DevCats afa23b8d3c feat(goose): Add tmux support and Session Name variable to Goose (#113)
- Add Multiplexer, and tmux with mouse support.
- Add check to make sure tmux and screen are not set at the same time.
- Add Variable for session name so the name of the screen or tmux
session can be customized.

Tested in dev environment.

Reference: https://github.com/coder/registry/issues/31
2025-05-21 19:50:57 -05:00
Atif Ali fae52150cc chore: update README tags for clarity and consistency (#111)
- reduced excessive use of helper
2025-05-21 09:37:53 -05:00
Michael Smith ae6cf8c366 fix: add build step for deployment registry (#110)
## Changes made
- Updated the `deploy-registry` script to include steps for pushing to
the production registry
2025-05-19 12:18:14 -04:00
Anas 04669ec2fa feat(vscode-web): add platform settings option (#94) 2025-05-19 19:34:56 +05:00
dependabot[bot] 55c9829a27 chore(deps): bump google-github-actions/auth from 2.1.8 to 2.1.10 (#109)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-19 15:51:02 +05:00
DevCats 8da68871f0 fix(coder/modules/goose): update default values for Goose provider and model variables to empty strings (#106)
- Changed default values from null to empty strings for
`experiment_goose_provider` and `experiment_goose_model` variables in
main.tf to ensure compatibility and avoid null interpolation issues.
2025-05-16 15:10:04 -05:00
27 changed files with 143 additions and 74 deletions
+4 -5
View File
@@ -22,15 +22,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193
with:
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
service_account: registry-v2-github@coder-registry-1.iam.gserviceaccount.com
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a
# For the time being, let's have the first couple merges to main in
# modules deploy a new version to *dev*. Once we review and make sure
# everything's working, we can deploy a new version to *main*. Maybe in
# the future we could automate this based on the result of E2E tests.
- name: Deploy to dev.registry.coder.com
run: gcloud builds triggers run 29818181-126d-4f8a-a937-f228b27d3d34 --branch dev
- name: Deploy to registry.coder.com
run: |
gcloud builds triggers run 106610ff-41fb-4bd0-90a2-7643583fb9c0 --branch main
+1 -1
View File
@@ -4,7 +4,7 @@ description: Run Claude Code in your workspace
icon: ../../../../.icons/claude.svg
maintainer_github: coder
verified: true
tags: [agent, claude-code]
tags: [agent, claude-code, ai]
---
# Claude Code
+1 -1
View File
@@ -4,7 +4,7 @@ description: VS Code in the browser
icon: ../../../../.icons/code.svg
maintainer_github: coder
verified: true
tags: [helper, ide, web]
tags: [ide, web, code-server]
---
# code-server
+1 -1
View File
@@ -4,7 +4,7 @@ description: Add a one-click button to launch Cursor IDE
icon: ../../../../.icons/cursor.svg
maintainer_github: coder
verified: true
tags: [ide, cursor, helper]
tags: [ide, cursor, ai]
---
# Cursor IDE
+1 -1
View File
@@ -4,7 +4,7 @@ description: Allow developers to optionally bring their own dotfiles repository
icon: ../../../../.icons/dotfiles.svg
maintainer_github: coder
verified: true
tags: [helper]
tags: [helper, dotfiles]
---
# Dotfiles
+1 -1
View File
@@ -4,7 +4,7 @@ description: A file browser for your workspace
icon: ../../../../.icons/filebrowser.svg
maintainer_github: coder
verified: true
tags: [helper, filebrowser]
tags: [filebrowser, web]
---
# File Browser
@@ -9,7 +9,7 @@ tags: [helper, git]
# git-commit-signing
> [!IMPORTANT]
> [!IMPORTANT]
> This module will only work with Git versions >=2.34, prior versions [do not support signing commits via SSH keys](https://lore.kernel.org/git/xmqq8rxpgwki.fsf@gitster.g/).
This module downloads your SSH key from Coder and uses it to sign commits with Git.
+12 -8
View File
@@ -4,7 +4,7 @@ description: Run Goose in your workspace
icon: ../../../../.icons/goose.svg
maintainer_github: coder
verified: true
tags: [agent, goose]
tags: [agent, goose, ai]
---
# Goose
@@ -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/coder/goose/coder"
version = "1.1.0"
version = "1.2.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
@@ -24,14 +24,14 @@ module "goose" {
## Prerequisites
- `screen` must be installed in your workspace to run Goose in the background
- `screen` or `tmux` 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
Your workspace must have `screen` installed to use this.
Your workspace must have `screen` or `tmux` installed to use the background session functionality.
### Run in the background and report tasks (Experimental)
@@ -90,7 +90,7 @@ resource "coder_agent" "main" {
module "goose" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/goose/coder"
version = "1.1.0"
version = "1.2.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
@@ -99,8 +99,12 @@ module "goose" {
# Enable experimental features
experiment_report_tasks = true
# Run Goose in the background
# Run Goose in the background with screen (pick one: screen or tmux)
experiment_use_screen = true
# experiment_use_tmux = true # Alternative: use tmux instead of screen
# Optional: customize the session name (defaults to "goose")
# session_name = "goose-session"
# Avoid configuring Goose manually
experiment_auto_configure = true
@@ -143,12 +147,12 @@ Note: The indentation in the heredoc is preserved, so you can write the YAML nat
## 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.
Run Goose as a standalone app in your workspace. This will install Goose and run it directly without using screen or tmux, and without any task reporting to the Coder UI.
```tf
module "goose" {
source = "registry.coder.com/coder/goose/coder"
version = "1.1.0"
version = "1.2.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
+75 -30
View File
@@ -54,6 +54,18 @@ variable "experiment_use_screen" {
default = false
}
variable "experiment_use_tmux" {
type = bool
description = "Whether to use tmux instead of screen for running Goose in the background."
default = false
}
variable "session_name" {
type = string
description = "Name for the persistent session (screen or tmux)"
default = "goose"
}
variable "experiment_report_tasks" {
type = bool
description = "Whether to enable task reporting."
@@ -69,13 +81,13 @@ variable "experiment_auto_configure" {
variable "experiment_goose_provider" {
type = string
description = "The provider to use for Goose (e.g., anthropic)."
default = null
default = ""
}
variable "experiment_goose_model" {
type = string
description = "The model to use for Goose (e.g., claude-3-5-sonnet-latest)."
default = null
default = ""
}
variable "experiment_pre_install_script" {
@@ -187,8 +199,52 @@ EOL
mkdir -p "$HOME/.config/goose"
echo "$GOOSE_SYSTEM_PROMPT" > "$HOME/.config/goose/.goosehints"
# Run with screen if enabled
if [ "${var.experiment_use_screen}" = "true" ]; then
# Handle terminal multiplexer selection (tmux or screen)
if [ "${var.experiment_use_tmux}" = "true" ] && [ "${var.experiment_use_screen}" = "true" ]; then
echo "Error: Both experiment_use_tmux and experiment_use_screen cannot be true simultaneously."
echo "Please set only one of them to true."
exit 1
fi
# Determine goose command
if command_exists goose; then
GOOSE_CMD=goose
elif [ -f "$HOME/.local/bin/goose" ]; then
GOOSE_CMD="$HOME/.local/bin/goose"
else
echo "Error: Goose is not installed. Please enable install_goose or install it manually."
exit 1
fi
# Run with tmux if enabled
if [ "${var.experiment_use_tmux}" = "true" ]; then
echo "Running Goose in the background with tmux..."
# Check if tmux is installed
if ! command_exists tmux; then
echo "Error: tmux is not installed. Please install tmux manually."
exit 1
fi
touch "$HOME/.goose.log"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Configure tmux for shared sessions
if [ ! -f "$HOME/.tmux.conf" ]; then
echo "Creating ~/.tmux.conf with shared session settings..."
echo "set -g mouse on" > "$HOME/.tmux.conf"
fi
if ! grep -q "^set -g mouse on$" "$HOME/.tmux.conf"; then
echo "Adding 'set -g mouse on' to ~/.tmux.conf..."
echo "set -g mouse on" >> "$HOME/.tmux.conf"
fi
# Create a new tmux session in detached mode
tmux new-session -d -s ${var.session_name} -c ${var.folder} "\"$GOOSE_CMD\" run --text \"Review your goosehints. Every step of the way, report tasks to Coder with proper descriptions and statuses. Your task at hand: $GOOSE_TASK_PROMPT\" --interactive | tee -a \"$HOME/.goose.log\"; exec bash"
elif [ "${var.experiment_use_screen}" = "true" ]; then
echo "Running Goose in the background..."
# Check if screen is installed
@@ -217,31 +273,11 @@ EOL
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Determine goose command
if command_exists goose; then
GOOSE_CMD=goose
elif [ -f "$HOME/.local/bin/goose" ]; then
GOOSE_CMD="$HOME/.local/bin/goose"
else
echo "Error: Goose is not installed. Please enable install_goose or install it manually."
exit 1
fi
screen -U -dmS goose bash -c "
screen -U -dmS ${var.session_name} bash -c "
cd ${var.folder}
\"$GOOSE_CMD\" run --text \"Review your goosehints. Every step of the way, report tasks to Coder with proper descriptions and statuses. Your task at hand: $GOOSE_TASK_PROMPT\" --interactive | tee -a \"$HOME/.goose.log\"
/bin/bash
"
else
# Check if goose is installed before running
if command_exists goose; then
GOOSE_CMD=goose
elif [ -f "$HOME/.local/bin/goose" ]; then
GOOSE_CMD="$HOME/.local/bin/goose"
else
echo "Error: Goose is not installed. Please enable install_goose or install it manually."
exit 1
fi
fi
EOT
run_on_start = true
@@ -270,18 +306,27 @@ resource "coder_app" "goose" {
exit 1
fi
if [ "${var.experiment_use_screen}" = "true" ]; then
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
if [ "${var.experiment_use_tmux}" = "true" ]; then
if tmux has-session -t ${var.session_name} 2>/dev/null; then
echo "Attaching to existing Goose tmux session." | tee -a "$HOME/.goose.log"
tmux attach-session -t ${var.session_name}
else
echo "Starting a new Goose tmux session." | tee -a "$HOME/.goose.log"
tmux new-session -s ${var.session_name} -c ${var.folder} "\"$GOOSE_CMD\" run --text \"Review your goosehints. Every step of the way, report tasks to Coder with proper descriptions and statuses. Your task at hand: $GOOSE_TASK_PROMPT\" --interactive | tee -a \"$HOME/.goose.log\"; exec bash"
fi
elif [ "${var.experiment_use_screen}" = "true" ]; then
# Check if session exists first
if ! screen -list | grep -q "goose"; then
if ! screen -list | grep -q "${var.session_name}"; then
echo "Error: No existing Goose session found. Please wait for the script to start it."
exit 1
fi
# Only attach to existing session
screen -xRR goose
screen -xRR ${var.session_name}
else
cd ${var.folder}
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
"$GOOSE_CMD" run --text "Review goosehints. Your task: $GOOSE_TASK_PROMPT" --interactive
fi
EOT
@@ -5,7 +5,7 @@ icon: ../../../../.icons/vault.svg
maintainer_github: coder
partner_github: hashicorp
verified: true
tags: [helper, integration, vault, hashicorp, hvs]
tags: [integration, vault, hashicorp, hvs]
---
# HCP Vault Secrets
@@ -4,7 +4,7 @@ description: Add a one-click button to launch JetBrains Gateway IDEs in the dash
icon: ../../../../.icons/gateway.svg
maintainer_github: coder
verified: true
tags: [ide, jetbrains, helper, parameter]
tags: [ide, jetbrains, parameter, gateway]
---
# JetBrains Gateway
+1 -1
View File
@@ -5,7 +5,7 @@ icon: ../../../../.icons/jfrog.svg
maintainer_github: coder
partner_github: jfrog
verified: true
tags: [integration, jfrog]
tags: [integration, jfrog, helper]
---
# JFrog
@@ -4,7 +4,7 @@ description: A module that adds Jupyter Notebook in your Coder template.
icon: ../../../../.icons/jupyter.svg
maintainer_github: coder
verified: true
tags: [jupyter, helper, ide, web]
tags: [jupyter, ide, web]
---
# Jupyter Notebook
+1 -1
View File
@@ -4,7 +4,7 @@ description: A module that adds JupyterLab in your Coder template.
icon: ../../../../.icons/jupyter.svg
maintainer_github: coder
verified: true
tags: [jupyter, helper, ide, web]
tags: [jupyter, ide, web]
---
# JupyterLab
+1 -1
View File
@@ -4,7 +4,7 @@ description: A modern open source VNC server
icon: ../../../../.icons/kasmvnc.svg
maintainer_github: coder
verified: true
tags: [helper, vnc, desktop]
tags: [vnc, desktop, kasmvnc]
---
# KasmVNC
+1 -1
View File
@@ -4,7 +4,7 @@ description: Allow developers to customize their workspace on start
icon: ../../../../.icons/personalize.svg
maintainer_github: coder
verified: true
tags: [helper]
tags: [helper, personalize]
---
# Personalize
+1 -1
View File
@@ -4,7 +4,7 @@ description: Send a Slack message when a command finishes inside a workspace!
icon: ../../../../.icons/slack.svg
maintainer_github: coder
verified: true
tags: [helper]
tags: [helper, slack]
---
# Slack Me
@@ -5,7 +5,7 @@ icon: ../../../../.icons/vault.svg
maintainer_github: coder
partner_github: hashicorp
verified: true
tags: [helper, integration, vault, github]
tags: [hashicorp, integration, vault, github]
---
# Hashicorp Vault Integration (GitHub)
+2 -2
View File
@@ -5,7 +5,7 @@ icon: ../../../../.icons/vault.svg
maintainer_github: coder
partner_github: hashicorp
verified: true
tags: [helper, integration, vault, jwt, oidc]
tags: [hashicorp, integration, vault, jwt, oidc]
---
# Hashicorp Vault Integration (JWT)
@@ -109,7 +109,7 @@ resource "jwt_signed_token" "vault" {
sub = "${data.coder_workspace.me.id}"
aud = "https://vault.example.com"
iat = provider::time::rfc3339_parse(plantimestamp()).unix
# Uncomment to set an expiry on the JWT token(default 3600 seconds).
# Uncomment to set an expiry on the JWT token(default 3600 seconds).
# workspace will need to be restarted to generate a new token if it expires
#exp = provider::time::rfc3339_parse(timeadd(timestamp(), 3600)).unix agent = coder_agent.main.id
provisioner = data.coder_provisioner.main.id
+1 -1
View File
@@ -5,7 +5,7 @@ icon: ../../../../.icons/vault.svg
maintainer_github: coder
partner_github: hashicorp
verified: true
tags: [helper, integration, vault, token]
tags: [hashicorp, integration, vault, token]
---
# Hashicorp Vault Integration (Token)
@@ -4,7 +4,7 @@ description: Add a one-click button to launch VS Code Desktop
icon: ../../../../.icons/code.svg
maintainer_github: coder
verified: true
tags: [ide, vscode, helper]
tags: [ide, vscode]
---
# VS Code Desktop
+6 -6
View File
@@ -4,7 +4,7 @@ description: VS Code Web - Visual Studio Code in the browser
icon: ../../../../.icons/code.svg
maintainer_github: coder
verified: true
tags: [helper, ide, vscode, web]
tags: [ide, vscode, web]
---
# VS Code Web
@@ -15,7 +15,7 @@ Automatically install [Visual Studio Code Server](https://code.visualstudio.com/
module "vscode-web" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/vscode-web/coder"
version = "1.0.30"
version = "1.1.0"
agent_id = coder_agent.example.id
accept_license = true
}
@@ -31,7 +31,7 @@ module "vscode-web" {
module "vscode-web" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/vscode-web/coder"
version = "1.0.30"
version = "1.1.0"
agent_id = coder_agent.example.id
install_prefix = "/home/coder/.vscode-web"
folder = "/home/coder"
@@ -45,7 +45,7 @@ module "vscode-web" {
module "vscode-web" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/vscode-web/coder"
version = "1.0.30"
version = "1.1.0"
agent_id = coder_agent.example.id
extensions = ["github.copilot", "ms-python.python", "ms-toolsai.jupyter"]
accept_license = true
@@ -60,7 +60,7 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
module "vscode-web" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/vscode-web/coder"
version = "1.0.30"
version = "1.1.0"
agent_id = coder_agent.example.id
extensions = ["dracula-theme.theme-dracula"]
settings = {
@@ -78,7 +78,7 @@ By default, this module installs the latest. To pin a specific version, retrieve
module "vscode-web" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/vscode-web/coder"
version = "1.0.30"
version = "1.1.0"
agent_id = coder_agent.example.id
commit_id = "e54c774e0add60467559eb0d1e229c6452cf8447"
accept_license = true
+11
View File
@@ -136,6 +136,16 @@ variable "subdomain" {
default = true
}
variable "platform" {
type = string
description = "The platform to use for the VS Code Web."
default = ""
validation {
condition = var.platform == "" || var.platform == "linux" || var.platform == "darwin" || var.platform == "alpine" || var.platform == "win32"
error_message = "Incorrect value. Please set either 'linux', 'darwin', or 'alpine' or 'win32'."
}
}
data "coder_workspace_owner" "me" {}
data "coder_workspace" "me" {}
@@ -158,6 +168,7 @@ resource "coder_script" "vscode-web" {
AUTO_INSTALL_EXTENSIONS : var.auto_install_extensions,
SERVER_BASE_PATH : local.server_base_path,
COMMIT_ID : var.commit_id,
PLATFORM : var.platform,
})
run_on_start = true
+13 -2
View File
@@ -59,15 +59,26 @@ case "$ARCH" in
;;
esac
# Detect the platform
if [ -n "${PLATFORM}" ]; then
DETECTED_PLATFORM="${PLATFORM}"
elif [ -f /etc/alpine-release ] || grep -qi 'ID=alpine' /etc/os-release 2>/dev/null || command -v apk > /dev/null 2>&1; then
DETECTED_PLATFORM="alpine"
elif [ "$(uname -s)" = "Darwin" ]; then
DETECTED_PLATFORM="darwin"
else
DETECTED_PLATFORM="linux"
fi
# Check if a specific VS Code Web commit ID was provided
if [ -n "${COMMIT_ID}" ]; then
HASH="${COMMIT_ID}"
else
HASH=$(curl -fsSL https://update.code.visualstudio.com/api/commits/stable/server-linux-$ARCH-web | cut -d '"' -f 2)
HASH=$(curl -fsSL https://update.code.visualstudio.com/api/commits/stable/server-$DETECTED_PLATFORM-$ARCH-web | cut -d '"' -f 2)
fi
printf "$${BOLD}VS Code Web commit id version $HASH.\n"
output=$(curl -fsSL "https://vscode.download.prss.microsoft.com/dbazure/download/stable/$HASH/vscode-server-linux-$ARCH-web.tar.gz" | tar -xz -C "${INSTALL_PREFIX}" --strip-components 1)
output=$(curl -fsSL "https://vscode.download.prss.microsoft.com/dbazure/download/stable/$HASH/vscode-server-$DETECTED_PLATFORM-$ARCH-web.tar.gz" | tar -xz -C "${INSTALL_PREFIX}" --strip-components 1)
if [ $? -ne 0 ]; then
echo "Failed to install Microsoft Visual Studio Code Server: $output"
+1 -1
View File
@@ -4,7 +4,7 @@ description: Add a one-click button to launch Windsurf Editor
icon: ../../../../.icons/windsurf.svg
maintainer_github: coder
verified: true
tags: [ide, windsurf, helper, ai]
tags: [ide, windsurf, ai]
---
# Windsurf Editor
@@ -3,9 +3,8 @@ display_name: airflow
description: A module that adds Apache Airflow in your Coder template
icon: ../../../../.icons/airflow.svg
maintainer_github: nataindata
partner_github: coder
verified: true
tags: [airflow, idea, web, helper]
tags: [airflow, ide, web]
---
# airflow
+1 -1
View File
@@ -4,7 +4,7 @@ description: Install Node.js via nvm
icon: ../../../../.icons/node.svg
maintainer_github: TheZoker
verified: false
tags: [helper]
tags: [helper, nodejs]
---
# nodejs