Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

feat: add preinstall/postinstall script + tools for goose and claude code #424

Merged
merged 43 commits into from
Apr 18, 2025
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
470ae43
use `goose` if in PATH
bpmct Apr 7, 2025
364d468
feat(goose): add pre and post install script variables for customization
bpmct Apr 7, 2025
b7cc2f2
refactor(goose): improve handling of pre and post install scripts wit…
bpmct Apr 7, 2025
45b21e1
fix
bpmct Apr 7, 2025
220a026
fix
bpmct Apr 7, 2025
e8ef8f5
debug
bpmct Apr 7, 2025
5744f7a
fix
bpmct Apr 7, 2025
467ad91
cleanup
bpmct Apr 7, 2025
eaceba4
fixup
bpmct Apr 8, 2025
e2cb2fa
fixup
bpmct Apr 8, 2025
d9a7275
ok
bpmct Apr 8, 2025
55073da
add debug
bpmct Apr 8, 2025
3ccd98c
debug
bpmct Apr 8, 2025
d2ca53b
fix handling
bpmct Apr 8, 2025
c1e83e0
fixes
bpmct Apr 8, 2025
92fb309
cleanup
bpmct Apr 8, 2025
9865dec
fix path bs
bpmct Apr 8, 2025
324508e
fix
bpmct Apr 8, 2025
a025219
fix
bpmct Apr 8, 2025
928abda
fix escaping
bpmct Apr 8, 2025
bf41bb2
ok
bpmct Apr 8, 2025
19bda0d
fix
bpmct Apr 8, 2025
a50cb4b
fixup
bpmct Apr 8, 2025
abdbe1f
remove
bpmct Apr 8, 2025
4445af8
no prompt
bpmct Apr 8, 2025
04b9686
always reattach
bpmct Apr 8, 2025
4189f04
fix
bpmct Apr 8, 2025
2709f2a
Merge remote-tracking branch 'origin' into updates
bpmct Apr 8, 2025
e980d9c
fix system prompt
bpmct Apr 8, 2025
7634bd7
fix
bpmct Apr 8, 2025
81ad454
add support for additional extensions
bpmct Apr 9, 2025
2c7e9e9
fix
bpmct Apr 9, 2025
7f836ff
test
bpmct Apr 9, 2025
3542350
even clearer
bpmct Apr 9, 2025
3bf9e0f
fix
bpmct Apr 9, 2025
438c30f
fix again
bpmct Apr 9, 2025
20b1fca
fix
bpmct Apr 9, 2025
77bca7b
feat: add pre/post install for goose + custom extensions
bpmct Apr 9, 2025
d4ffca0
fmt
Apr 16, 2025
1f9d7ea
feat: add pre and post install script variables for Claude Code
Apr 16, 2025
b369d72
postinstallbetter
Apr 16, 2025
d31daad
test
Apr 16, 2025
7a1b282
base64 encode scripts
Apr 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
debug
  • Loading branch information
bpmct committed Apr 7, 2025
commit e8ef8f5f2d54f11cb7c0f1d20c0fd31fd73e1a3c
21 changes: 9 additions & 12 deletions goose/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ resource "coder_script" "goose" {
eval "$PRE_INSTALL_SCRIPT"
fi

# Store current PATH for screen session
export PATH_FOR_SCREEN="$PATH"

# Install Goose if enabled
if [ "${var.install_goose}" = "true" ]; then
if ! command_exists npm; then
Expand Down Expand Up @@ -188,19 +191,13 @@ EOL
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

# Check if goose is installed before running
if command_exists goose; then
GOOSE_CMD=goose
elif command_exists $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 '
cd ${var.folder}
$GOOSE_CMD run --text "$GOOSE_SYSTEM_PROMPT. Your task: $GOOSE_TASK_PROMPT" --interactive | tee -a "$HOME/.goose.log"
echo "Current PATH: $PATH" | tee -a "$HOME/.goose.log"
echo "Looking for goose in PATH..." | tee -a "$HOME/.goose.log"
which goose | tee -a "$HOME/.goose.log"
echo "Running goose command..." | tee -a "$HOME/.goose.log"
goose run --text "$GOOSE_SYSTEM_PROMPT. Your task: $GOOSE_TASK_PROMPT" --interactive | tee -a "$HOME/.goose.log"
exec bash
'
else
Expand Down Expand Up @@ -244,7 +241,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_CMD run --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; echo "Current PATH: $PATH" | tee -a "$HOME/.goose.log"; echo "Looking for goose in PATH..." | tee -a "$HOME/.goose.log"; which goose | tee -a "$HOME/.goose.log"; echo "Running goose command..." | tee -a "$HOME/.goose.log"; 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}
Expand Down