You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: goose/README.md
+30
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,36 @@ module "goose" {
111
111
}
112
112
```
113
113
114
+
### Adding Custom Extensions (MCP)
115
+
116
+
You can extend Goose's capabilities by adding custom extensions. For example, to add the desktop-commander extension:
117
+
118
+
```tf
119
+
module "goose" {
120
+
# ... other configuration ...
121
+
122
+
experiment_pre_install_script = <<-EOT
123
+
npm i -g @wonderwhy-er/desktop-commander@latest
124
+
EOT
125
+
126
+
experiment_additional_extensions = <<-EOT
127
+
desktop-commander:
128
+
args: []
129
+
cmd: desktop-commander
130
+
description: Ideal for background tasks
131
+
enabled: true
132
+
envs: {}
133
+
name: desktop-commander
134
+
timeout: 300
135
+
type: stdio
136
+
EOT
137
+
}
138
+
```
139
+
140
+
This will add the desktop-commander extension to Goose, allowing it to run commands in the background. The extension will be available in the Goose interface and can be used to run long-running processes like development servers.
141
+
142
+
Note: The indentation in the heredoc is preserved, so you can write the YAML naturally.
143
+
114
144
## Run standalone
115
145
116
146
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.
if [ "${var.experiment_use_screen}" = "true" ]; then
137
192
echo "Running Goose in the background..."
@@ -162,14 +217,28 @@ EOL
162
217
export LANG=en_US.UTF-8
163
218
export LC_ALL=en_US.UTF-8
164
219
165
-
screen -U -dmS goose bash -c '
220
+
# Determine goose command
221
+
if command_exists goose; then
222
+
GOOSE_CMD=goose
223
+
elif [ -f "$HOME/.local/bin/goose" ]; then
224
+
GOOSE_CMD="$HOME/.local/bin/goose"
225
+
else
226
+
echo "Error: Goose is not installed. Please enable install_goose or install it manually."
227
+
exit 1
228
+
fi
229
+
230
+
screen -U -dmS goose bash -c "
166
231
cd ${var.folder}
167
-
$HOME/.local/bin/goose run --text "$GOOSE_SYSTEM_PROMPT. Your task: $GOOSE_TASK_PROMPT" --interactive | tee -a "$HOME/.goose.log"
168
-
exec bash
169
-
'
232
+
\"$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\"
233
+
/bin/bash
234
+
"
170
235
else
171
236
# Check if goose is installed before running
172
-
if ! command_exists $HOME/.local/bin/goose; then
237
+
if command_exists goose; then
238
+
GOOSE_CMD=goose
239
+
elif [ -f "$HOME/.local/bin/goose" ]; then
240
+
GOOSE_CMD="$HOME/.local/bin/goose"
241
+
else
173
242
echo "Error: Goose is not installed. Please enable install_goose or install it manually."
echo "Error: Goose is not installed. Please enable install_goose or install it manually."
270
+
exit 1
271
+
fi
272
+
189
273
if [ "${var.experiment_use_screen}" = "true" ]; then
190
-
if screen -list | grep -q "goose"; then
191
-
export LANG=en_US.UTF-8
192
-
export LC_ALL=en_US.UTF-8
193
-
echo "Attaching to existing Goose session." | tee -a "$HOME/.goose.log"
194
-
screen -xRR goose
195
-
else
196
-
echo "Starting a new Goose session." | tee -a "$HOME/.goose.log"
197
-
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'
274
+
# Check if session exists first
275
+
if ! screen -list | grep -q "goose"; then
276
+
echo "Error: No existing Goose session found. Please wait for the script to start it."
277
+
exit 1
198
278
fi
279
+
# Only attach to existing session
280
+
screen -xRR goose
199
281
else
200
282
cd ${var.folder}
201
283
export LANG=en_US.UTF-8
202
284
export LC_ALL=en_US.UTF-8
203
-
$HOME/.local/bin/goose
285
+
"$GOOSE_CMD" run --text "Review goosehints. Your task: $GOOSE_TASK_PROMPT" --interactive
0 commit comments